Alert in Business rule

Naresh Damji
Tera Expert

Hi All,

I am having issue where i want to throw alert to user in business rule. Currently my business rule is running on sys_attachment table. The condition is like below :

find_real_file.png

The code is like below which checks if the file size is greater than certain limit :

(function executeRule(current, previous /*null when async*/) {

var i = parseInt(current.size_bytes);
gs.addErrorMessage('i is' + i);

if(i > 10)
{

current.setAbortAction(true);
gs.log('-=--------------------------i is' + i);
gs.addInfoMessage("File Size is too large");

}

})(current, previous);

All other script work but none of the gs.addInfoMessage() functions are working. I can able to see the log message and action is getting aborted as per script just needed the alert message throw to user.

I have tired various solution provided in community and forum but none of them worked.

Can someone please help on this case

Regards,

Naresh

1 ACCEPTED SOLUTION

Naresh Damji
Tera Expert

Just to update on this, I have achieved this by adding some code in UI page which helped me to restrict based on image size.

View solution in original post

13 REPLIES 13

Rohit Kaintura
Mega Guru

You can also do this by onsubmit client script.

 

Please mark my answer correct and helpful if my answer helped u. Thank you.

Ashutosh Munot1
Kilo Patron
Kilo Patron

HI,


Put this addInfoMessage above the abort action. It will show up and then might go away eventually.


Thanks,
Ashutosh

Hi Ashutosh,

Already tried this, didnt worked.

BeBold
Kilo Expert

Naresh,Can I know,In which domain and application you are executing this BR?