cancel
Showing results for 
Search instead for 
Did you mean: 

Looping through items in a form

Former Member
0 Kudos

Does anyone know how to iterate through all active items in any given form.  What I am trying to do is get all UIDs on a form and then configure a form via xml with the retrived IDs.  I am working with SAP B1 9.0

Accepted Solutions (1)

Accepted Solutions (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Jesus,

Here is how you would get all items on a form:

foreach (Item item in oForm.Items)

                                {

                                    if (BoFormItemTypes.it_MATRIX == item.Type)

                                    {

                                        var matrix = (SAPbouiCOM.Matrix)item.Specific;

                                        matrix.LoadFromDataSourceEx(true);

                                    }

                                }

Hope it helps.

Thanks & Regards

Ankit Chauhan

Former Member
0 Kudos

Thank you for your reply Ankit.  I appreciate the help.  This to has been useful

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Jesus,

Please help to close the thread, if your problem has been resolved.

Thanks & Regards

Ankit Chauhan

Answers (2)

Answers (2)

pedro_magueija
Active Contributor
0 Kudos

Hi Jesus,

Form objects have a .GetAsXml() method that returns an xml string that "represents" the form. Perhaps you can use that. Otherwise have a look at answer.


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

Former Member
0 Kudos

Thank you Pedro, this answer helped me.  Now I am able to see the entire xml document of the sales orders and use that information towards my ongoing project.

0 Kudos

Moved to B1 forums