Returning object from script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2017 11:56 PM
I just have a small problem in retrieving the returned value, i'm calling a business rule on change request form to retrieve the 'assigned_to' of the two change tasks. I'm able to fetch the value of the assigned_to but unable to return it. i have a screenshot of the code below.
Business Rule:
I'm getting undefined when i display the answer.
Script Include:
When i use logs it displays the obj values as required, so there is some problem in encoding or decoding the values.
And i need one more help, when the values are sent back it should be added to the eventQueue as parameters as you can see in the business rule.
So when the event is fired a notification will run.
When to send:
Who will receive:
i have to send it to three users, opened by and the two assigned_to of the tasks, so I have checked the two parameters as receivers, so is this enough to send notification email to all three or is there anything else i need to do.
This is my first time working on notifications so i don't have much idea how this works, please point out if i need to make any changes.
Many Thanks!!
- Jayanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2017 12:01 AM
Do you really need to get assigned_to in an object?
Why not just returning the sys_id of the assigned_to (reference field to sys_user) and then get that directly from sys_user?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2017 01:20 AM
Hi Sergiu, thank you for responding,
I have to return two sys_id's, so i preferred using obj, is there any other way?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2017 01:27 AM
To me it looks you can't have both in the same time, right? As you can't have 2 different short descriptions for same record. So you actually return only one sys_id at any point in time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2017 01:40 AM
The if statement is just to differentiate the tasks, but there are already two tasks and i need the sys_id of both tasks assigned_to. Only reason for using the if statement is so that i can store the sys_id of implement task assigned_to in obj.one and post implement task assigned_to value in obj.two. The while loop will run two times, first it'll fetch the imp.. task assigned_to and next the post imp.. task assigned_to.