Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Business Rule to update Work Notes from a scoped application

Wayne Richmond
Tera Guru

Hi team. I have created a record producer in a scoped application that updates a custom field called additional_details. I have been asked to copy everything from the additional_details into Work Notes when the record is created. I figured I would just create a Business Rule that ran on insert to copy additional_details to work_notes. However, when this didn't work, I found an article or doc explaining you can't acheive this across scopes. 

How else can I copy additional_details to work_notes?

I've tried creating a Cross scope privilege record from my scope to global (table \ task \ write \ approved), but that didn't work

I tried direct from the script field where I set the additional_details field

I can get it to work via an onChange Client Script, however, it doesn't work when the record is created

Thanks

1 ACCEPTED SOLUTION

Wayne Richmond
Tera Guru

I got this working in the end via a Business Rule, I just had to change the "script":

(function executeRule(current, previous /*null when async*/) {

	current.work_notes.setDisplayValue(current.additional_details);

})(current, previous);

 

View solution in original post

6 REPLIES 6

maryam7
Tera Expert

Hi all , I write this BR for location field but show me the sys_id of location in work note . can you help me please .

(function executeRule(current, previous /*null when async*/) {

current.work_notes.setDisplayValue(current.location.toString());

})(current, previous);

Hi @maryam7 , 

its better to store location value inside a variable.

you can use below code in your BR to get and set value of work_notes.

current.work_notes.getJournalEntry(-1); // to get work notes value.
current.work_notes.setJournalEntry(variableName) // to set work notes value.
 
Regards,
Keshav K