Skip to Content
0

Problem with registered UDO

Feb 20, 2017 at 04:09 PM

133

avatar image
Former Member

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 ?

what-we-have.png (7.2 kB)
code.png (138.7 kB)
it-should-be.png (8.0 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
DIEGO LOTHER Feb 21, 2017 at 11:59 AM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thank you so mutch Diego !!!!!!

Very pleased with you to keep communication :)

1
avatar image
Former Member Feb 21, 2017 at 06:01 AM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

0
avatar image
Former Member Feb 21, 2017 at 08:44 AM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Try, but still don`t work

0