Salesforce

How Do I Create an XML Doc from Scratch? (Magic xpa 4.x)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

How Do I Create an XML Doc from Scratch? (Magic xpa 4.x)

For the most part, you can handle an XML document that was defined in an XML view as you would any other data source. However, with an XML documents, all data is hierarchical, even when you might expect it is “flat”. And every XML file has to be initialized at the root record, or you will get a message such as the one shown here.

Initializing an XML Document

In this example, for instance, there are three views into the Productions.xml file. All point to the same XML document, but a different part of the hierarchy is used in each view. The part that is used in the current view has green checkmarks on the fields involved, which are also shown below.

Now, if you want to write some titles to this XML file, you will have to create a root record in the Productions data source first. In practical terms, that means writing one record to data source #7 before adding any Titles to data source #8. You can use a Link Write or a small batch task to do create the root if the XML file does not already exist.

You can experiment with this by viewing the data in the Data repository and creating records there (Ctrl+G). If you create a record at your root level (#7) then you can create records at the lower levels (#8 and #9) and they will be inserted correctly. But the reverse does not work.

See also

The Online and Rich Client Samples projects (program XM01 and RXM01)

Reference
Attachment 
Attachment