Hi Experts,
I am trying to write a Javascript on the Editable grid(of opportunity product) that gets triggered onrecordselect. I want to get data from the related record and based of that manuplate the editable grid.
Ex. We have a custom field on the product called "New" which is "Yes" or "No", I want to retrieve the value of the field in the javascript so that i can manipulate the editable grid based of that.
The code that i have now is able to select or read data from the selected row which is "Opportunity product", from here how to i read "Product" (Existing product) which is a lookup- a related entity. Please help me out
function gridRowSelected(executionContext) { var selected = executionContext.getFormContext().data.entity; var Width= selected.attributes.getByName("as_width").getValue(); }
Thanks in advance for your response.
Thanks for your response and help. Appreciate it a lot
Hi, Davyjones
please consider marking as an answer if it was helpful
Hi Pablo,
Thank you for your response.
I added the lookup in the editable grid in the view and i was able to get the array, but the array did not have all the fields on the record, rather it had only the name, id and the array pointer.
Please help.
Hi, Davyjones .
where is the lookup in the editable grid?, can you add that field to the view that is using your grid?
then you could do the same as you are doing
data.entity.attributes.getByName("NAME_OF_THE_FIELD").getValue(), and it'll give you a array with an object as result.
Regards.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156