insert value with Busines Rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2025 02:51 PM
Hi Team
i have this simple code with Business Rule. This rule it's running in incident table
i want to when i open any incident record number of incident needs to be inserted in this field "u_activity_2"
But it's not can be like display, needs to be modification with this symbol because if i take an report this value will be there
I need to do it with BR not Client Script
(function executeRule(current, previous /*null when async*/ ) {
var incidentId = current.number;
current.u_activity_2 = current.number;
})(current, previous);
Thank's advanced
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2025 03:19 PM
not work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2025 03:22 PM
Hi @Rafael Batistot ,
How did you tested? Have you created a new record?
If not then create a new incident record and see if the field is set with the inc number.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2025 03:29 PM
in this case i'm in Data Archive module, all the fields are not visible, and there's not possible to save ana data in this module
that's why i need to insert this values and save automatic. i've try with "current.updated()" but it's doesn't work as well
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2025 03:37 PM
Sorry I didn’t get you. You are saying that you won’t be able to create a new incident?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2025 07:56 PM - edited ‎03-28-2025 07:57 PM
Hello!
- Since you are using a display Business Rule, the 'u_activity_2' field has already been displayed on the Incident form.
In this case, you can try to use an onLoad Client Script to set a value for the 'u_activity_2' field
var activityValue = 'some text';
g_gorm.setValue('u_activity_2', activityValue);
- In case 'u_activity_2' does not display on the form, let's try to use a before Business Rule to set a value for the 'u_activity_2' field after User Save/Submit the Incident form
var activityValue = 'some text';
current.setValue('u_activity_2', activityValue);