Need to set a flag in incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2013 11:58 AM
I have created a boolean field named Updated by Customer? (u_updated_by_customer_) on incident. I have to set the flag true if if the customer has last updated incident else false. I have created below business rule but unsuccessful. Can anybody help..?
if(current.sys_updated_by.changes)
{
u_updated_by_customer_= true;
}
else
{
u_updated_by_customer_= false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2013 12:11 PM
if(current.sys_updated_by.changes() && current.sys_updated_by == gs.getUserName()){
u_updated_by_customer_= true;
}
else{
u_updated_by_customer_= false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2013 01:56 PM
still no luck..:( not working..:(
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2013 02:13 PM
Try it with
current.u_updated_by_customer_= true;
and
current.u_updated_by_customer_= false;
And make sure the BR runs before Insert/Update
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2013 03:29 PM
So I forgot the current. in my last post. But I think if you named the field 'Updated by customer' then the resulting db name would be u_updated_by_customer without the trailing underscore.
var uname = current.caller_id.user_name;
if(current.sys_updated_by.changes() && current.sys_updated_by == uname){
current.u_updated_by_customer = true;
}
else{
current.u_updated_by_customer = false;
}