Hi
We are SAP Business One our version 9.3, with boyum
I am trying to make use of this guide, in C# to run a UF in some dynamic code, which has to be written in vb.net, due to company support requirements
The guide is
The aim is after my main code has run I launch a UF which is a SQL report to display the new data
I am trying
Dim C As System.Threading.Thread = New Threading.Thread(
Try
Dim universalFunctionToRun = "UF-131"
company.UniversalFunctions.Module.ActivateUniversalFunction(SBO.AddonLogic.Addon.AddonData, eventForm, universalFunctionToRun, "Dynamic code")
Catch ex As Exception
SBO.UI.Notification.MessageBox("Error running UF: " & ex.ToString())
End Try ).Start
unfortunately this is struggling to compile.
and if I try
''Call MRP report
''message in status bar
application.StatusBar.SetText("Opening MRP Purchase Orders Created...", SAPbouiCOM.BoMessageTime.bmt_long,1)
Try
Dim universalFunctionToRun = "UF-131"
company.UniversalFunctions.Module.ActivateUniversalFunction(SBO.AddonLogic.Addon.AddonData, eventForm, universalFunctionToRun, "Dynamic code")
Catch ex As Exception
SBO.UI.Notification.MessageBox("Error running UF: " & ex.ToString())
End Try
I get

Can any one suggest a solution or something to try
Thanks
Request clarification before answering.
Hi Ian,
Sorry, I haven't actually used the UniveralFunction object.
What error are you getting when you remove the company reference?
The only thing I can see in the code sample you reference is that the eventForm object is not defined and is not one I am familiar with. The B1UP code documents the company, application and form SDK objects but not eventForm. You could try replacing the eventForm value with the form object. However, eventForm could be something that is defined outside the scope of the Dynamic Code UF the same as the form, application, company variables.
Cheers,
Sean
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You are referencing the company object which in the B1UP Dynamic Code is a reference to the standard SAPbobsCOM.Company object. The UniversalFunctions object will be an object in the B1UP libraries.
The sample you gave shows the UniversalFunctions being called directly rather than via the company object.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 13 | |
| 13 | |
| 6 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.