BackgroundThe XML Engine is a IImport plugin designed to de-serialize XML files into QBO 3 objects and perform some operation on them, usually 'Save'.
For example, to insert a message:
<ImportCollection>
<MessageItem>
<Object>Loan</Object>
<ObjectID>127</ObjectID>
<Message>This is the subject</Message>
<BodyText>Message Content Goes here</BodyText>
</MessageItem>
</ImportCollection>
To insert an Attachment, you can Base64 encode the binary file as a Content node:
<ImportCollection>
<AttachmentItem>
<Attachment>My Test File</Attachment>
<FileName>TestFile.txt</FileName>
<Object>Foreclosure</Object>
<ObjectID>7288</ObjectID>
<Description>Description goes here</Description>
<Content><![CDATA[VGVzdCBEYXRhIEdvZXMgSGVyZQ==]]></Content>
</AttachmentItem>
</ImportCollection>
SubscriptionsFrequently, the data being stored in QBO is imported from other systems. It is often useful to track the 'keys' associated with these other systems. QBO3 offers an ObjectSubscription module for this. For example, moving a Loan from a servicing system into QBO can be done like this:
<ImportCollection>
<LoanItem> <Loan>1234567890</Loan> <SubscriberID>www.acme.com-MSP107-1234567890</SubscriberID> <UPBAmount>123456.78</UPBAmount> <Property> <Address>123 Main Street</Address> <City>Anywhere</City> <State>CA</State> <PostalCode>92101</PostalCode> </Property> <Borrowers> <BorrowerItem> <LastName>Doe</LastName> <FirstName>Jane</FirstName> <BorrowerType>Primary</BorrowerType> <USSSN>555124444</USSSN> <Address>123 Maple</Address> <City>Irvine</City> <State>CA</State> <PostalCode>92064</PostalCode> <Sequence>1</Sequence> </BorrowerItem> </Borrowers> </LoanItem> </ImportCollection>
There are several items to note here: - The SubscriberID
www.acme.com-MSP107-123456789 will be used to see if the loan already exists in QBO; if not, it will be inserted, otherwise it will be updated - The Loan.PropertyID column is a foreign key to the Property table; this allows you to specify the Property in the XML above
- If the Loan already exists and has a PropertyID, the property will be updated from the XML, otherwise a new Property will be inserted, and Loan.PropertyID will be set accordingly
- The Loan.Borrowers property in the C# class file is marked as a ChildKey, this allows you to specify Borrowers in the XML above
Setting up an Import File TemplateImport File Templates are used to map particular file formats to some IImportEngine. To create an XML Engine based template, go to Design > Import Files, and choose Options > New Template. Ensure you specify: - Template: the name of your import template
- Import Engine: XmlEngine
Other properties that may be of interest, but are not covered in this setup are: - Pre-transform Schema: you can upload an XSD file, and check Pre Validate Schema, ensuring that the inbound XML passes your schema before any data is imported
- Import Transform: you can upload an XSLT file, and the inbound XML will be transformed with this XSLT prior to being imported
|
|