- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2024 12:40 AM
Hello All
I have a requirement to copy filed values changing on the form to capture n Additional comment as present on the form.
For example, I have 2 fields. These two are reference fields. Whenever we are changing the values of these 2 fields the values should be captured on the Additional comment(customer visible) part.
Please guide me to achieve this requirement.
Thanks in Advance
Souvick
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2024 01:51 AM - edited ‎06-21-2024 01:52 AM
@Souvick6917 , try to update directly then.
var field1 = current. < fieldname > ;
var field2 = current. < fieldname > ;
current.comments = 'Field 1 is :' + field1+','+ 'Field 2 is :' + field2;
Let me know if this also dosent work
Please check and Mark Helpful and Correct if it really helps you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2024 12:54 AM
Hi @Souvick6917 ,
You can create a before update business rule and give condition as field1 changes and field2 changes , select advance and in script write something as below,
(function executeRule(current, previous /*null when async*/ ) {
var field1 = current. < fieldname > ;
var field2 = current. < fieldname > ;
current.comments.setJournalEntry(field1, 'System'); // i have added system so that it will show updated as system you can remove it.
current.comments.setJournalEntry(field2, 'System');
})(current, previous);
Please check and Mark Helpful and Correct if it really helps you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2024 01:24 AM - edited ‎06-21-2024 01:26 AM
Hi Swathi
I have tried the above script but after saving the BR and running validation on the form , I am getting an error as below error message
Error Message
Function setJournalEntry is not allowed in scope sn_bom_payment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2024 01:51 AM - edited ‎06-21-2024 01:52 AM
@Souvick6917 , try to update directly then.
var field1 = current. < fieldname > ;
var field2 = current. < fieldname > ;
current.comments = 'Field 1 is :' + field1+','+ 'Field 2 is :' + field2;
Let me know if this also dosent work
Please check and Mark Helpful and Correct if it really helps you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2024 05:16 AM
I need to modify the script to few things but thanks a lot Swathi for providing the structure of the script.
Regards
Souvick