- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2018 07:23 PM
Hi,
We have a requirement that when user clicks in the new button of the related list “Project Change Requests” of the “Project” form:
The values from the “Project manager” field and “Sponsor” (custom) field of the “Project” form:
Goes to the 2 custom fields “Project Manager” and “Sponsor” of the “Project Change Request” form:
Can anyone help us to achieve this please?
Thanks and best regards,
Paulo
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2018 10:20 PM
Hi pauloferreira,
If you only want values from the “Project manager” field and “Sponsor” (custom) field of the “Project” form should go to the 2 custom fields “Project Manager” and “Sponsor” of the “Project Change Request” form only when user clicks on New button in related list on "Project" table then you can use the Display Business rule and onLoad client script as shown below:
Display BR on "Project Change Request" table:
(function executeRule(current, previous /*null when async*/) {
g_scratchpad.projectManager= current.parent.project_manager; // use Parent and Project Manager field name of "Project Change Request" table
g_scratchpad.sponsor= current.parent.sponsor;// use Parent and Sponsor field name of "Project Change Request" table
gs.info("projectManager : " + g_scratchpad.projectManager);
gs.info("sponsor: " + g_scratchpad.sponsor);
})(current, previous);
onLoad Client Script on "Project Change Request" table:
function onLoad() {
if(!g_form.getValue('project_manager')) // use Project Manager field name of "Project Change Request" table
g_form.setValue('project_manager', g_scratchpad.projectManager);
if(!g_form.getValue('sponsor')) // use sponsor field name of "Project Change Request" table
g_form.setValue('sponsor', g_scratchpad.sponsor);
}
Please let me know if you face any issue in this.
Please mark it correct, if it resolves your problem.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 05:03 AM
Hi Mahendra,
Did the above solution work for you.
I have a similar requirement, the display business rule part worked for me (validated in the system log). however, the client script did not work. The values are not getting set to the referenced table new record creation.
Best Regards,