cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with registered UDO

Former Member
0 Kudos

For example we create UDO with embedded options SAP Business One.

open him in B1 Studio and Import as .srf file.

Then, as Show below, we read this .srf in XmlDocument and assigned it FormSRF field.

What we have after call method add() and registered addon:

What we doing wrong ?

Accepted Solutions (1)

Accepted Solutions (1)

former_member185682
Active Contributor
0 Kudos

Hi Евгений,

Try this:

Add your UDO as you did in your code.

After this run a code like this:

                SAPbobsCOM.UserObjectsMD userObjectsMD = (SAPbobsCOM.UserObjectsMD)company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserObjectsMD);


                if(userObjectsMD.GetByKey(ObjectName))
                {
                    userObjectsMD.FormSRF = formSRF;
                    userObjectsMD.RebuildEnhancedForm = BoYesNoEnum.tNO;


                    CodErro = userObjectsMD.Update();
                    this.ValidateAction();
                }

To update the srf of your UDO. My formSRF is a string variable with my xml as string. After this, do the logout and login in your SAP B1.

Hope it helps.

Kind Regards,

Diego Lother

Former Member

Thank you so mutch Diego !!!!!!

Very pleased with you to keep communication 🙂

Answers (2)

Answers (2)

pedro_magueija
Active Contributor

Hi,

Found this as well in the documentation:

RebuildEnhancedForm If needed, rebuild the UDO enhanced form (UDO form with header-line style).

Field name: IsRebuild.

Perhaps setting that to Yes will rebuild the UDO form?

Pedro Magueija

LinkedIn | Twitter | Blog

Former Member
0 Kudos

Try, but still don`t work

pedro_magueija
Active Contributor
0 Kudos

Hi,

Have you tried setting that property to the path to the SRF file? The documentation is a bit unclear but it seems to be the path.

The *.srf file of the UDO enhanced form (UDO form with header-line style).

Field name: NewFormSrf.

Length: 16 characters.


Also, the length of the field seems to be too short to contain the full XML.

I haven't tested this, but maybe you can give it a go and leave some feedback.

Good luck.

Pedro Magueija

LinkedIn | Twitter | Blog

Former Member
0 Kudos

I was trying to assign only path to .srf file but still don`t work (