Skip to Content
avatar image
Former Member

Problem with registered UDO

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Feb 21, 2017 at 11:59 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 21, 2017 at 06:01 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 21, 2017 at 08:44 AM

    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

    Add comment
    10|10000 characters needed characters exceeded