- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 07:13 AM
Table: alm_hardware
We import assets that are delivered into stock room as and when necessary to alm_hardware under our designated stockroom with the serial number , state in stock , stockroom = stockroom name.
When intune integration updates these assets with the correct asset name etc. from the serial number, we want the state of these assets to change from "in stock" to "in use"
The intune update will rename the "configuration item" field to the correct asset name.
I am trying to get the state to change to "in use" and tried this via Business Rule and Flow Designer which hasn't worked.
The updates are made by "system" when the Intune sync happens using the Intune plugin.
Is there a way to make the Intune plugin update the state of these assets when the sync happens or fix my Business rule / Flow designer?
Current BR / FD is not triggering.
Business rule tried (also tried before update):
Flow designer tried:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 09:00 AM
Hi @Ahmet1
If you use a business rule, set it to run "Before". Set Order to a value greater than 100, Set Advanced and use the following script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
current.install_status = 1; // value for 'In use' choice for state field on alm_hardware table
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 07:34 AM
Hi @Ahmet1
Is the BR running if the condition is removed? If it is not running even without any condition, the transform script might be not running.
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 07:34 AM
Hi @Ahmet1,
As far as using a business rule, you haven't posted the script logic. (I see "Advanced" is checked.) Also, 'When to run' should be "Before" or you have to use a "current.update()" in the script, which is not 'Best Practice' (don't update the record just written to the database a second time).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 08:47 AM
Hi, I must of missed that! there was no script logic so I've unchecked it and retried to trigger it by manually syncing our Intune just now and it didn't get triggered again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 09:00 AM
Hi @Ahmet1
If you use a business rule, set it to run "Before". Set Order to a value greater than 100, Set Advanced and use the following script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
current.install_status = 1; // value for 'In use' choice for state field on alm_hardware table
})(current, previous);