Showing results for 
Search instead for 
Did you mean: 

Why can't I load system form as xml file (with LoadBatchAction method)?

Former Member
0 Kudos

As promissed in the webex session here is the answer to this question:

The partner had complained that after saving a system form as xml file he is not able to load it to

SAP Business One application using the method: LoadBatchAction.

In order to be able to load a system form from an xml file, first you have to update the unique ID (@uid) node value (in the xml string).

For example please look at the code below:

I've saved order form as an xml file (with GetAsXml method) and call the file "OrderXML.xml".

In order to load this form I use the following code:

Dim Strxml As String

Set oXMLDoc = New MSXML2.DOMDocument

oXMLDoc.Load ("C:KnowledgeBaseMikCOM UILoadXMLFrmWithMtxOrderXML.xml")

    'In the following line I update the Unique ID node in the xml file

oXMLDoc.selectSingleNode("Application/forms/action/form/@uid").nodeValue = "MyOrderFrm"

m_App.LoadBatchActions oXMLDoc.xml

    'Notice that you refer to the same unique id you've updated the xml with

Set Frm = m_App.Forms.Item("MyOrderFrm")

one more tip:

If you want to be able to have more than one instance of a form at the same time -each one of the instances must have a different Unique ID. You have to manage it by yourself.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Miki,

thanks a lot for the information.

Hi (to anybody who's reading this),

I propose, two things:

1. You might use a prefix like "INFO: " for the topic, so that it is at least easier to find these posts again in future when there are - hopefully - much more posts in the forum.

2. You might consider to reply to your "INFO: " post by yourself, so that it's not listed with "0" replies - as I'm at least once a day monitoring the forum looking for new posts I could reply to...