How to add UDF
John Slaats
Hi,Can anyone give me an example how to add an UDF to a systemtable?
I can't figure out how to use SAPbobsCOM.UserFieldsMD with the Framework.
The example in Samples_SAP88.zip does not work.
Kind regards,
John
Thilo-Simon Studt
Hi,I'm using following code:
Dim oUserFieldsMD As SAPbobsCOM.UserFieldsMD
oUserFieldsMD = SwissAddonFramework.B1Connector.GetB1Connector().Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields)
oUserFieldsMD.TableName = "RDR1"
oUserFieldsMD.Name = "Test"
oUserFieldsMD.Description = "Test"
oUserFieldsMD.Type = SAPbobsCOM.BoFieldTypes.db_Numeric
oUserFieldsMD.SubType = SAPbobsCOM.BoFldSubTypes.st_Quantity
oUserFieldsMD.Add()
System.Runtime.InteropServices.Marshal.ReleaseComObject(oUserFieldsMD)
John Slaats
Hi,I know this method but this doesn't use the Coresystems Framework.
Can anyone give me an example using the Framework?
Kind regards,
John
Anders Olsson
Hello John,Can you please specify what doesn't work in the sample? Do you get an exception? Please provide more details. Are you referring to the COR_SystemTable project?
There is nothing wrong with using the SAP DI when that is easier (which the framework does under the hood anyway). In this case I would take Thilo's appoach.
Regards,
Anders Olsson
John Slaats
Hi,If I try this I get an error on:
oUserFieldsMD = SwissAddonFramework.B1Connector.GetB1Connector().Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields)
Error:
Reference required to assembly 'SAPbobsCOM, Version=2007.0.0.0, Culture=neutral, PublicKeyToken=null' containing the type 'SAPbobsCOM.Company'. Add one to your project.
Even when I change the reference to SapbobsCOM 2007 in my project I keep getting this error.
This is Framework 2.71. I don't get this error in 2.9. Is this a known bug?
Kind regards,
John
0
Please sign in to leave a comment.
Comments
0 comments