Advertisement
Zavaski

Untitled

Oct 5th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. /*
  2. Add your SAP Business ByDesign scripting language implementation for:
  3. Business Object: Opportunity
  4. Node: Root
  5. Validation: OnSave
  6.  
  7. Script file signature
  8. ----------------------------
  9. Returns: Boolean
  10.  
  11. Note:
  12. - To access the elements of the business object node,
  13. use path expressions, for example, this.<element name>.
  14. - To use code completion, press CTRL+J.
  15. - The solution uses this script before an instance of the business object is saved to the data base.
  16. It can have a return value of either true or false, which determines whether the instance of the business object is saved or not.
  17. All fields in this business object are read-only and cannot be changed.
  18. */
  19.  
  20. import ABSL;
  21. var result = this.allowSave;
  22. if(result == false) { //Check if there is an error and then show a message, it must show a message.
  23. //If not it will show by default the message: "Save rejected by validation (Solution aaaaaa, Business Object Opportunity, Node Root)"
  24. raise GenericMessage.Create("E", "Por favor, verifique as mensagens de erro."); //Generic message
  25. //See: https://blogs.sap.com/2016/08/04/problem-with-new-feature-mandatory-error-message-for-onsave-validation/
  26. }
  27. return result;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement