How to Remove Condition Data Type Field Value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2024 06:09 AM
Hi,
I created the condition data type filed in the User Persona table. This condition filed reference to the department table once in the department table any department is deleted . In the condition, I am getting the sys_id I need to remove the sys_id. If anyone knows about this kind of scenario, could you please help me?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2024 06:14 AM
@subashds6515 You can create a business rule on the department table which runs on delete. In the business rule script. You can query the User persona table and check which records contains the condition where the deleted department was used. You can update those conditions and remove the deleted departments from them.
Hope this helps,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2024 06:35 AM
Hi @Sandeep Rajput ,
I have created an "After Delete" business rule. This is my code.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2024 07:30 AM
@subashds6515 Your department field on the User persona table is a condition field and not a reference field. You need to apply contains filter and not = filter in the query. Update your query as follows.
Also, you forgot to update the persona record after setting the value. Adde the line in script for you.
function executeRule(current, previous /*null when async*/ ) {
var persona = new GliedeRecord("u_user_persona");
persona.addQuery("u_department",'CONTAINS',current.name);
persona.query();
if (persona.next()) {
persona.setValue("u_department", '');
persona.update();
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2024 12:04 AM - edited 08-21-2024 12:05 AM
Thanks for the reply @Sandeep Rajput
We tried but it's not removing the value sysid is there.
When we updated it, it changed the value but when we deleted the record sys ID was not removed from the condition field.
at the same time, we did configure a notification to send when condition field changes...it was also not triggering in both the cases i.e while update and delete.