While Oracle EPM boasts global reach and multilingual capabilities, English often dominates its error messages. This leaves non-English speaking users frustrated and confused. Thankfully, the EPM Groovy era empowers us to create internationalized error messages using Groovy! This ensures every user, regardless of language, receives clear and helpful prompts, ultimately leading to a smoother and more inclusive user experience.
Want to ensure users enter positive sales numbers in your EPM Groovy script? We’ll build a validation checker that iterates through edited webform cells, flagging any negative inputs with a localized error message (in English and Japanese for this demo). Using MessageBundleLoader, you’ll learn how to tailor error messages to different languages. Let’s dive in!
Define the English Message:
def englishMessageBundle = messageBundle(["invalidInput":"Sorry! Inputs with negative values are not allowed {0}"])
Define the Japanese Message:
def japaneseMessageBundle = messageBundle(["invalidInput":"申し訳ございません。マイナスの値は入力できかねます。{0}"])
Load the Message bundles
def messageBundleLoader = messageBundleLoader(["en" : englishMessageBundle, "ja": japaneseMessageBundle]);
Utilize the Message bundle in the exception definitions
We’ll start with the “invalidInput” message, but this script flexes to handle your specific error needs – tailor it for your needs!
operation.grid.dataCellIterator{DataCell cell-> cell.edited}.each { DataCell cell ->
if(cell.data < 0) {
throwVetoException(messageBundleLoader, "invalidInput", "${cell.getMemberName('Account')},$cell.periodName : $cell.data")
}
}
Lets add the rule to the form
My webform now guards against negative values with a pre-save rule, ensuring data integrity.
VALIDATING ENGLISH MESSAGES
User Preference Update
Input Negative Number
Save and Validate the Message
Validating Japanese Messages
I switched my language to Japanese in the user preference settings
User Preference Update
Input Negative Number
I don’t have multiple Alias tables now. So my form shows member names in English.
Save and Validate the Message
What happens if the Language is undefined:
Imagine a German user encountering these English/Japanese messages – oops! Let’s see what happens when the script faces languages it doesn’t have error messages for.
I get the below error message when the user tries to enter a negative number.
The system is unable to load the resource files. It is important to specify the required language messages in the bundle loader.
That’s a wrap:
As we cater to diverse regions, leveraging EPM’s multilingual capabilities is crucial. The evident thought put into API design by Oracle shines through, and we eagerly await further enhancements in the EPM Groovy library!
I hope this information is helpful.