Programming User Messages 
User Messages are messages that are displayed on the mobile device depending on the user action performed.
You have created:
A Mobile Service Component
More information: Creating a Mobile Service Component
A custom operation, to which you want to add one or more exceptions
More information: Modeling a Custom Operation
An Exception
More information: Handling Exceptions
A Mobile UI Component
More information: Creating a Mobile UI Component
Double-click the Message Pool node.
Alternatively, press F3, or, in the Message Pool context menu, choose Open.
In the Resource Text tab page, click Add to add a new resource.
In the New Resource dialog window, choose errorMessage as the Resource Type.
Enter a Resource Name.
Use an ID for the exception, such as InvalidEmployeeNameException.
Enter a Text.
Use a text targeted for the user, such as Employee Name is not valid!
The created resource appears in the table of the *<<Service Component>>.xlf tab page.
Save your data.
Note
By using the message pool, you can ensure internationalization of your application.
Create an instance of the exception in the custom operation.
More information:
Provide logging and user notification details in the controller implementation of the UI Component.
More information:
Syntax
//Creating an instance for the exception InvalidEmployeeNameException and display the message on the mobile device
//@@begin implementation
if ((arg0.getName() == null) || (arg0.getName().length() == 0)) {
throw new InvalidEmployeeNameException("INVALID_EMPLOYEE_NAME_ID",
WDLite.getApplicationDCName(),
new String[] {"null"}, IOCAException.ERROR);
}
//@@end
Syntax
//Use the Exception Handler class to log and raise the exception message
public void saveNewEmployee() {
//@@begin saveNewEmployee()
try {
EmployeeSdoEmployee arg0 = (EmployeeSdoEmployee) wdContext
.nodeNewEmployee().getCurrentElement().model();
service.checkEmployee(arg0);
root.commit();
refreshEmployeeList();
} catch (InvalidEmployeeNameException e) {
// To be displayed on CFS RT Container UI
WDLite.getExceptionHandler().logAndRaiseMessage(e);
}