- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Many of you probably have tried to develop something yourselves, only to find that you have started a recursive loop-from-hell where a comment is passed back and forth between related records.
Here is a simple solution without additional field and field checks.
You should be able to do this both in a flow and in a business rule. I have included an example of a business rule configuration.
Make a business rule with the following condition
var comment = current.comments+""; comment.indexOf('<div style="display:none;">#synched#</div>') == -1
And the following script (introduces an invisible HTML tag that we can evaluate upon to avoid recursive updates)
var grSCTask = new GlideRecord("sc_task");
grSCTask.addQuery("request_item", current.getValue('sys_id'));
grSCTask.query();
while (grSCTask.next()) {
grSCTask.comments = current.comments + '[code<div style="display:none;">#synched#</div>[code]';
grSCTask.update();
}
Make a business rule like this on the related table; voila, you have 2-way synch.
- 2,258 Views
- « Previous
-
- 1
- 2
- Next »
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.