Universal function - Dynamic code
AnsweredHi,
I am new here and hope I come to the right place for my question.
Is it possible to create my own class in Dynamic Code? If it is possible, could you please provide some sample code, or other work around?
My system is B1 ver. 9.3 PL 02. B1UP ver.2018.08.00.0
Thanks.
Alvin
-
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.
-
Hi Rasmus,
Thanks for your comment. Once I create my DLL file, where should I store the file?
Cheers,
Alvin
-
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
-
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.
Comments
4 comments