Salesforce

How Do I Handle Errors Encountered During XML Access? (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

How Do I Handle Errors Encountered During XML Access? (Magic xpa 3.x)

Some of the XML functions give return codes which can be used to determine that an error occurred. For instance, XMLSetEncoding() returns a 0 if it worked properly, a negative value otherwise.

Note: Since the return code can be negative, be sure your variable allows negative values (that is, that the picture contains an ā€œNā€, ā€œ5Nā€ for example).

Creating a global error handler

All the error codes are negative integers. So, you can create a handler that will be triggered whenever your return code becomes negative, as shown here.

If you use a return code in the Main Program, you can capture the error globally for all your XML functions.

The same return code values are used for all the XML functions, so you can also create user-friendly error messages. The error codes are listed in the Magic xpa Help file for the function.

See also

The Online and Rich Client Samples projects (program XM12 and RXM12)

Reference
Attachment 
Attachment