
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2017 10:32 AM
HI,
somehow I stuck.
I have a Business Rule that need to check if field A or field B is set. Both is ok. This is relevant if status is INSTALLED.
Now I do have a UI action that will DEINSTALL the record - meaning setting all field values to blank and the status to DEINSTALLED.
Now the Business Rule is blocking the UI Action to be executed, as the status still is INSTALLED when trying to execute the UI ACTION.
Important is, that I need the system to only have ONE Update to be done ... so changing the state first and changing the values of the fields in a second step is no option due to automatic updates that need to be triggered in one step due to legacy system ...
I think this a minor issue I'm not aware of to solve this issue ... . As the issue is a little bit more complex that I'm describing here .. I'd like to somehow stick to the BR and anyhow run the UI Action ...
thank you
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2017 03:54 AM
Sounds like this is a client side UI Action then, and I see from your code that this is correct. You need to change the UI Action to run on the server side. This will allow the code to do what it needs regardless of ACL's.
You will not be able to do a confirm as you currently are.
The other option that you have is removing the ACL and adding a UI Policy to make the field read only.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2017 10:40 AM
Can't you just add a condition to the Business rule says and status != deinstalled so its skipped when you click the UI Action???

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2017 10:43 AM
The problem is, that this is not working.
It only runs when status is INSTALLED.
But the UI action does the "transformation" of the fields and chaning the state to DEINSTALLED ... while obviously the state is not yet changed .. so the BR is blocking the action ... I get an invalid update and the message from the business rule ...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2017 10:48 AM
So the BR has a condition of state=installed and it is running even if the state is not installed? Can you post a screen shot of your condition and code?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2017 11:08 AM
I run the UI Action on a record that is status INSTALLED. The UI Action should change the state to DEINSTALLED and clear out other fields too .. . But while running the ui action, the condition of the BR become active, as field A & B will be empty.
The UI action looks like this .. .
function deinstall123(){
var txt;
txt="Are you sure?";
var r = confirm(txt);
if (r == true) {
g_form.setValue('u_status',deinstalled);
g_form.setValue('u_field_a','');
g_form.setValue('u_field_b','');
// ...
g_form.submit();
//...
}
}
The BR condition checks if field A & B is empty and status is installed ... on before insert/update