Business rule in mobile

asham2
Kilo Contributor

Hi,

My business rule script in approval table is working only on desktop and it is not working in mobile....Does business rule run on mobile? If so then how to select both mobile and desktop options?

4 REPLIES 4

Ayush Sharma2
Giga Contributor

Hi,



Business rules runs on Server side and this can be triggered by both Desktop and Mobile UI



Thanks


Ayush


Please Hit like, Helpful or Correct depending on the impact of the response


raves12
Kilo Sage

HI Asha,



Business rules are server side code and should not be dependent on UI type. If you are having issue please share the code to look into.


asham2
Kilo Contributor

Hi RaviKumar,



Thanks for your response.



When approval changes to   rejected in approval form then rejection comments become mandatory. This is not working in mobile app



Business rule:


When: Before -update  


Condition: Approval changes to rejected



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



var notes = current.comments.getJournalEntry(-1);
if(notes == ''){
  gs.addErrorMessage('Please enter comments on rejection');
  current.setAbortAction(true);
}


})(current, previous);


Hi Asha,



Add logs in the script to see if it is picking up notes and another log at the top to see if the business rule is firing. Then try to reject the approval on your mobile.



Please share your results thereafter.