Restrict a business rule based on view

richofing
Mega Contributor

I have created a module (displays a view called "reserve_assets")   that allows asset managers to create the shell for multiple hardware assets (ie create 10 hardware asset records for Computer XYZ). These are created with a status of On Order (there is a UI action script that inserts the records).   Once the assets arrive they will be assigned to users and any additional details will be updated in the individual records.

One of the fields on the form, in the Financial tab, is "Requested Item Number" .   If I select and RITM for this field, the status of the newly created asset records is Pending Install, not On Order. This is caused by a business rule that runs based on a condition which results to true if there is a value in the Requested Item Number field. It sets the status to Pending Install, which is not what I want. I don't want to disable this business rule as it will likely have an impact elsewhere.

So, is there a way that I can tell the BR to not run if the view is "reserve_assets"?

Ric

4 REPLIES 4

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Community Alums
Not applicable

Ric,


At the risk of deflecting your question and turning the discussion in a different direction, have you looked at using the catalog and procurement provided in the system to handle this? It feels like (from your description, which I may be misinterpreting) you are building out functionality that is already handled in ServiceNow. The process would look something like this:


  1. Publish the Model to the Catalog with the appropriate details.
  2. Configure the Catalog Item with criteria so only the people you want to see it can see it.
  3. You could also configure variables to identify the Reserved for information.
  4. The asset manager would just go to the Service Catalog to "reserve assets."
  5. In the procurement, you determine whether stock already exists to fulfill the request.
  6. With items you need to procure, you can create the assets prior to delivery, which creates them with the On order state.
  7. This supports the drive through the rest of the process as well, from receipt and reservation. If you create a workflow for the deployment, you can attach that to the Catalog Item as well, so support the management of the deployment.


Perhaps you've already looked at this and found it does not meet your needs. If this is the case, I would be very interested to understand why.



Thanks,


Ben


Hi Ben, all of this functionality was in place before I started working with this customer, and they have been using it for some time.   I am not sure if making major changes would be the best idea right now, but I do like your suggestion and I will keep it in mind.



Ric


Jay Gamblin
Mega Sage

I found this in an OOTB BR: 

GlideTransaction.get().getRequestParameter("sysparm_view")

Can use it in the condition field if you want to only fire a BR on certain views.

Or use it in the script.