cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to create an prompt message on Bundle and Order Screen when validation fails?

0 Kudos

Hi there,

Is it possible to prompt a customized message on the Bundle and Order Screen (Purchase Request > Bundle and Order) once the Order Button is clicked and it fails its validation?

The validation is to require the user to enter values on the added extension fields. Once that validation fails, there should be an alert message that will tell the user that he/she still needs to input values on those added extension fields. I followed this blog (https://blogs.sap.com/2017/12/12/an-easy-way-to-message-translation/) to prompt a custom message but I'm still getting an error when I already added the scripts. The error message says "Method or action 'Create' is not permitted in script file related to a business object validation."

Here is my script on ActionValidation-SubmitForOrder.absl

import ABSL;


if (this.POHeader_Client != ""){ 
 if (this.POHeader_Source!= "")  
 {
  return true;  
 }  
 else  
{
 var message : PROMPTMESSAGECode;
 message.content= "10";
 var messageText = message.GetDescription();
 raise PROMPTMESSAGE.Create("E", messageText);
 return false;
 }
}
else
{
 return false;
}

Any suggestion about how I can do that validation or any other workaround? Thank you.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member592782
Active Participant
0 Kudos

Hi Jeramay,

The Create operation expects one parameter for an error message being raised.

i.e raise ErrorMessage.Create("E");

The error message itself is defined in the BODL and raised on the necessary node.

Hope this helps,

Piotr.