- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 12:43 AM
how to update the stockroom name based on the assignment group ?
i tried to use this but stockroom field of the form is still blank
i created the business rule on it .
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 05:15 AM - edited 02-02-2024 05:22 AM
Hi @chercm,
Got it. I've spotted a few minor issues based on what you're trying to achieve.
I've tested this on a PDI and can confirm it works as required.
Update the following:
Business Rule. When to run: 'before'
Business Rule Script: (Ready for you to copy and paste)
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 05:55 AM
Hi @chercm ,
The reason you need to pass the sys_id when setting the stockroom is because the field is of type reference, meaning that it is actually pointing to another table. In order to set this value, you need to use the sys_id.
You will however see the name displayed on the form.
Have you seen my latest post? I've checked the script on a PDI and it works as required. Please can you copy and paste my script.
Please also ensure you have the Business Rule to operate 'on before' and check the 'Update' checkbox.
Out of interest, when do you set the assignment group? Do you have an Assignment Rule in operation? Have you implemented the script and changed the Assignment group value manually on the form to ensure the script is at least running?
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 05:29 AM
@Robbie tried what you suggested but the field is still blank , i was looking for the name of the stockroom.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 05:55 AM
Hi @chercm ,
The reason you need to pass the sys_id when setting the stockroom is because the field is of type reference, meaning that it is actually pointing to another table. In order to set this value, you need to use the sys_id.
You will however see the name displayed on the form.
Have you seen my latest post? I've checked the script on a PDI and it works as required. Please can you copy and paste my script.
Please also ensure you have the Business Rule to operate 'on before' and check the 'Update' checkbox.
Out of interest, when do you set the assignment group? Do you have an Assignment Rule in operation? Have you implemented the script and changed the Assignment group value manually on the form to ensure the script is at least running?
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 06:12 AM - edited 02-02-2024 06:13 AM
@Robbie if some one was to reassign the ticket to another assignment group, how can i get script to check whether there is available stock based on the variables by the user ? and that it will display error if there are not stock for that location ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 04:38 AM - edited 02-02-2024 04:39 AM
Hi @chercm,
I've confirmed the script provided works as requested. Can you confirm this isn't a data issue. Do you have assignment group values set against Stockrooms. Can you share a screenshot similar to the below. It sounds obvious, but please also make sure you test using an assignment group that absolutely has a Stockroom associated with it. (Baseline configuration, the assignment groups are not set)
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 01:03 AM - edited 02-02-2024 05:21 AM
Hi @chercm,
You're almost there, you just need to tweak the addQuery statement of your GlideRecord to check against the assignment group rather than the sys_id.
Use the below instead:
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.
Thanks, Robbie