- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2024 08:31 AM
Hi,
I'm trying to update a field in another table using a reference field dot walking based on a condition on the original table.
I have a custom true / false field on our cmdb_ci_computer table
In the software installation table i'm looking for a particular software using display name and if it exists using the installed on field i'm trying to update the true/false field.
i have tried business rules and workflow it looks like it's running but for whatever reason the true/false field will not update.
I've tried this method before and it's worked - does anyone know if there is something stopping the field updating on / from the software installation table?
Cheers,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2024 08:44 AM
Hi @Sam Motley Share your code which you tried and try below code
if (current.software.display_name == 'YourSoftwareName') {
var computerGr = new GlideRecord('cmdb_ci_computer');
if (computerGr.get(current.installed_on)) {
computerGr.your_true_false_field = true; // or false depending on your logic
computerGr.update();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2024 08:44 AM
Hi @Sam Motley Share your code which you tried and try below code
if (current.software.display_name == 'YourSoftwareName') {
var computerGr = new GlideRecord('cmdb_ci_computer');
if (computerGr.get(current.installed_on)) {
computerGr.your_true_false_field = true; // or false depending on your logic
computerGr.update();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2024 08:48 AM
so simple i love it thank you , this seems to have done the trick although i don't know why "set values" wasn't working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2024 09:48 AM
If you were trying this on the Actions tab without a script, that doesn't usually work when either side is a related field / dot-walk. I'm not sure why the condition builder includes these since they don't seem to be able to be used.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2024 08:45 AM - edited 09-10-2024 08:46 AM
You may have a Data Policy, ACL, or Business Rule preventing the update. Are you able, as an admin, to update this field manually? Have you logged your attempted BR script to confirm if/when it is running, the value it's attempting to update, etc? Have you tried to update with the value true vs 'true'? Is there anything useful in the system log when the BR runs?