how to get any BO data value in custom javascript/render

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
swiftinitpvtltd
Posts: 370
Joined: Sat Apr 28, 2018 3:33 am
Location: India
Contact:

how to get any BO data value in custom javascript/render

Post by swiftinitpvtltd »

how to get any BO data value in custom javascript/render? I can only get <<LoggedInUser.>> or <<SystemSettings.>> values in my js or render script. If I have BO called mycustomBO I need to get one item Find mycustomBO where ID=23 and then get its mycustomBO.Column2 value in js or render script.
idpSteve
Posts: 201
Joined: Thu Jul 27, 2017 6:13 am
Location: Johannesburg, South Africa
Contact:

Re: how to get any BO data value in custom javascript/render

Post by idpSteve »

Only way I know to do this would be have a proc saying

FIND mycustomBO WHERE (mycustonBO.ID='23')
INSERT mycustomBO IN LoggedInRegularUser.ps_mycustomBO

then <<LoggedInRegularUser.ps_mycustomBO.Column2>>

If you have the object in context there might be some way, but I haven't found it.. It will be interesting to follow this thread
swiftinitpvtltd
Posts: 370
Joined: Sat Apr 28, 2018 3:33 am
Location: India
Contact:

Re: how to get any BO data value in custom javascript/render

Post by swiftinitpvtltd »

When I use this in menu render js it says value is not defined- value is test or the actual value in the column and then it says
testvalue is not defined or testvalue1 is not...

in render-
<<LoggedInSystemUser.Column2>>
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: how to get any BO data value in custom javascript/render

Post by tford »

I'm not familiar with custom javascript/render, but is it possible in your scenario to have a process which find the BO.attribute info you need to use and place it in a LoggedInRegularUser.attribute?
Tom - V8.8 build 3137 - MySql / PostGres
swiftinitpvtltd
Posts: 370
Joined: Sat Apr 28, 2018 3:33 am
Location: India
Contact:

Re: how to get any BO data value in custom javascript/render

Post by swiftinitpvtltd »

Thanks for this suggestion. I have the data like what you explained but I need that data as decision maker at render and then do something at render in js. I can access this object but never saw any sample <<BO.columndata>> in render or js. I could access it in html.
Jaymer
Posts: 2539
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: how to get any BO data value in custom javascript/render

Post by Jaymer »

this is in a Grid, correct?
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
aware_support
Posts: 7572
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: how to get any BO data value in custom javascript/render

Post by aware_support »

If you want to get a value of an attribute of a business object from the SERVER in your custom Javascript you can so this:

var action = new AwareApp_GetAttributeValueAction (objectName, objectId, attributeName, null, null, function (value) {
/** Do something with the received value */
});
action.run ();

Check out the code of this action in postFormData.js
Aware IM Support Team
swiftinitpvtltd
Posts: 370
Joined: Sat Apr 28, 2018 3:33 am
Location: India
Contact:

Re: how to get any BO data value in custom javascript/render

Post by swiftinitpvtltd »

aware_support wrote:If you want to get a value of an attribute of a business object from the SERVER in your custom Javascript you can so this:

var action = new AwareApp_GetAttributeValueAction (objectName, objectId, attributeName, null, null, function (value) {
/** Do something with the received value */
});
action.run ();

Check out the code of this action in postFormData.js
This works just fine. Thank you.
Post Reply