- 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:09 AM
Can you select the insert and update checkbox to true and select the advanced checkbox too with action as after..
Sent from my android device.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2015 07:24 AM
I've tried them all, but it has no effect.
Anytime I flag them and do Update from the form, I see them false again (I have access as the system admin)...
I really do not understand. And I cannot find similar questions in web or communities..
Here is the debug output:
16:18:38.87: Execute before_display business rules on sys_script:Insert Dpt when Owner is Skender associate Depart
16:18:38.88: === Skipping 'Check advanced business rule' on sys_script: Insert Dpt when Owner is Skender associate Depart; condition not satisfied: Filter Condition: advanced=false^conditionISNOTEMPTY^ORscriptISNOTEMPTY^EQ
16:18:38.90: Execute before business rules on sys_template:
16:18:38.90: === Skipping 'SNC Template Query' on sys_template:; condition not satisfied: Condition: gs.isInteractive() && !gs.hasRole("template_editor_global")

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2015 07:30 AM
The business rule is getting skipped as per the logs .. The condition is getting satisfied .. Is u_owner a string field or a reference field? If a reference field , you need to give the sys id of the user record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2015 07:39 AM
Hi Kalai,
Yes, Owner is a reference field (picks the information from Users).
How can I give the sys_id?
Thanks,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2015 07:45 AM
Anurag's suggestion should work well