Skip to main content

Universal function - Dynamic code

Answered

Comments

4 comments

  • Rasmus Jensen

    Dynamic Code is just a method you write being executed so you can't make a class directly in the product. The only way to do it is to make your own DLL with various classes and methods and mention that DLL in the Reference field.

  • Alvin Li

    Hi Rasmus,

    Thanks for your comment. Once I create my DLL file, where should I store the file?

    Cheers,

    Alvin

  • Rasmus Jensen

    If you store it inside the B1UP installation folder next to BOY_USABILITY.exe it gives best compatibility.

    However please note you need to replace it there after an Add-on upgrade.

    You could also register the DLL in the GAC (Global Assembly Cache) but that tend to be overkill for many

  • Sean Archer - Business Evolution

    I have found the most reliable way to do this is to store your class library, and any dependent dll's, in a sub folder under the B1 Usability Package folder (e.g. C:\Program Files\SAP\SAP Business One\AddOns\BOY\B1 Usability Package\<your folder name>). 

    That way the files persist even if the B1UP is upgraded and will prevent any clashes if your class library references different versions of the system dlls etc that the B1UP has in it's application folder.

    When you reference your class library within the Dynamic Code UF you just need to prefix the dll name with the relative path I.E.    .\<your folder name>\<your file name>.dll

Please sign in to leave a comment.