cancel
Showing results for 
Search instead for 
Did you mean: 

My first steps in XML

leon_laikan
Participant
0 Kudos

Hi, everybody

My team has always developed SAP B1 add-ons in pure SDK code, without the use of Screen Painter or SAP B1 Studio.

I know it's the hard way, but we learn everything ourselves from the SDK forum and SDK samples only.

Now comes the time to learn how to load an XML form rather than hard code it in VB.NET.

Unfortunately, although I have read a lot about XML Forms on the forum, it is not very clear to me how to proceed.

Please look at the picture. It's an add-on we developed in VB.NET, and it works perfectly, albeit a bit slow.

I intend initially to generate an XML Form using Form.GetAsXML and my existing code.

Then, in future runs, I won't use the native code, but will load the XML form using the XmlData property of FormCreationParams Object.

From this point, I don't understand anything, and hope you can shed some light:

.

My Questions:

.

1. Have a look at my form. It contains many UI features: grid, buttons, choose from list, folders, linkedbutton.

It also contains many events. Some data on the grid are generated by running stored procedures.

.

2. So, when I save the form as XML, do I save my entire project as XML? so I don't need to write any further code???

or do I save only the form together with the UI objects on it?

.

3. Do I save the event handlers also? Or must I write the event handlers after loading the XML form?

.

4. If only the skeleton form is saved, then I should write the SDK code in Visual Studio to make it come alive?

.

5. If I need to write additional code after loading the XML form, how will I know the UID of every object on the form?

.

6. If anybody could send me a copy of the VB,NET code for an actual small add-on which starts by loading an XML file, I will understand immediately. If you don't want to post the code on the forum, you can mail it to me at leon_laikan@yahoo.com .

Thanks a lot

Leon


Accepted Solutions (1)

Accepted Solutions (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Leon,

Have you been able to check the SDK Sample "WorkingWithXML" from the following path:

C:\Program Files (x86)\sap\SAP Business One SDK\Samples\COM UI\CSharp\04.WorkingWithXML

This should answer many of your questions. Apart form that:

So, when I save the form as XML, do I save my entire project as XML? No

so I don't need to write any further code??? Yes

or do I save only the form together with the UI objects on it? Yes

Do I save the event handlers also? Or must I write the event handlers after loading the XML form? You must write.

If only the skeleton form is saved, then I should write the SDK code in Visual Studio to make it come alive? Yes, if there are certain validations or logic you need.


Kind regards,

ANKIT CHAUHAN

SAP SME Support

leon_laikan
Participant
0 Kudos

Hi, Ankit

Thanks for your reply, and it has answered many of my questions.

Best Regards,

Leon

Answers (0)