- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2015 06:04 AM
Hi,
I am trying to do a simple thing (in project mgmt module):
I am inserting some values in a string field (called 'Owner') and I want that in accordance to this values, some values will fill another field (called 'Department'), AUTOMATICALLY.
I know it should be a business rule, but I'm not having success with this script:
if (current.u_owner=="owner_name")
{
current.u_lead_bus_sub_dept="department_name";
}
Thank you all for any help,
Skender
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2015 07:40 AM
BR Details
Active = true
Insert/Update
Before
Script:
if (current.u_owner.getDisplayValue()=="owner_name")
{
current.u_lead_bus_sub_dept="Any string"+ current.department;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2015 07:32 AM
I Wil get back to you soon with an example
Sent from my android device.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2015 07:40 AM
BR Details
Active = true
Insert/Update
Before
Script:
if (current.u_owner.getDisplayValue()=="owner_name")
{
current.u_lead_bus_sub_dept="Any string"+ current.department;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2015 06:11 AM
You need to use current to access the field you want ..
Ex:
current.u_lead_bus_sub_dept="Any string"+ current.department;
where department is the field you want....

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2015 07:53 AM
Hi Skender,
I have created a BR "Set department" on Incident table. You can edit it as per your requirements.
Here is the link for the demo https://demo007.service-now.com/login.do
Username : admin
Password : admin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2015 08:48 AM
Thanks,
Yours works perfectly!!!
When I flag insert and update the next time I see them, they are false again...
I do not have also the Advance option...
Anyway, I did exactly the same thing, but I get this debug msg:
Execute before business rules on sys_user:
17:46:19.721: === Skipping 'user query' on sys_user:; condition not satisfied: Condition: gs.getSession().isInteractive() && !gs.hasRole("admin")