- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2022 03:28 AM
Hi Team,
I have a requirement wherein when we click on New Order task from the related list, it should then fetch some values and copy it to the fields of the order task.
I am writing the below code in OnLoad client sce
wI am writing the below code in screenshot but alert is throwin blank record instead of sys_id
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2022 03:45 AM
I would suggest to use the display business rule to get the parents details and copied to g_scratchpad variables.
for example:
g_scratchpad.parent_number = current.parent.number;
You can use these g_scratchpad variables in client scripts.
g_form.setValue('field name', g_scratchpad.parent_number);
Thanks!
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2022 08:49 AM
Your first answer was correct There was some syntax error at my side
Thanks for your support
I have one more query .
when I use scratchpad object from display BR and pass it on to Client script, it puts the same value again and again , even if the value is empty, it keeps on setting the old value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2022 09:04 PM
Hi Ankur,
You have to check the condition in client script before putting values into fields.
for example:
if (g_form.isNewRecord() || g_form.getValue('your_fields') == "") {
g_form.setValue('your_field1', g_scratchpad.value1);
g_form.setValue('your_field2', g_scratchpad.value2);
}
Thanks!
Sagar Pagar