cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic data in error message-Urgent

Former Member
0 Kudos

Hi All,

Can amyone help me out with the API or syntax to be used if the error message has some dynamic input.

e.g. if the error message has to be :

u201CMA of type " + ma_type + "cannot be created from Rfx you are trying to create. No such master data maintainedu201D

Where ma_type is dynamic / parameter.

If we create a Error message as LR (exception), in that case how to pass this parameter?

The syntax I use is :

Doc.createApplicationException(null, u201Crfx¬.masterdata.erroru201D);

But could not figure out how to pass the parameter. Your help will be appreciated.

Thanks,

Srikanth Emani

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Use the following code to throw exception once you have retrived dynamic value ma_type

throw new ApplicationException("MA of type"+ ma_type+"cannot be created from Rfx you are trying to create. No such master data maintained");

Regards

Mudit Saini

Former Member
0 Kudos

Hi Mudit,

We have been using this syntax also. But the main problem arises when we have to show a user the error message in his/her local's language. since we are hard coding the error it will only be displayed in english. So for that reason we wanted to used localized resources which can be used to display a message in user locale specific language.

So, we would be glad if there is any solution for our problem.

Thanks,

Srikanth Emani

0 Kudos

Hi Srikanth,

You could use the setMessageModifiers on the ApplicationException class for this. This method takes an object array as the input parameter which is basically the array of values you want displayed as part of your error message on the UI.

In your localized resource, you could define your parameter as shown in the example below.

Master Agreement ID with Expiration Date u2026.. During runtime, the , , etc. in the localized resource will be replaced with the values passed to the object array.

Hope this helps.

Vikram

Answers (0)