Blogs

Non Super Users and B1DE version 2.0 UDO classes
Miki Zilbershtein SAP Employee
Business Card
Company: SAP
Posted on Aug. 10, 2009 06:35 AM in Beginner, SAP Business One

Subscribe.Subscribe
Print. Print
Permalink Permalink
 

This blog is relevant for auto generated add-ons that use auto generated UDO class. 

 

You've used the B1DE wizard and generated an Add-On.

You've installed the Add-On at customer site.

Everything looks fine however when user tries to use the Add-On and do any data manipulation the following error occurs:

"The Loged On user does not have permission to use this object"

 

The limitation is:

The user who uses the auto generated B1DE Add-On must be a SAP Business One Superuser or have authorization to "User-Defined Object Registration".

 

This limitation is going to be removed in the next version of B1DE (planned to be released in September 2009).

 

At the mean time we'd like to suggest 2 different work arounds:

1) Grant full authorization to "User-Defined Object Registration" to the users who needs to work with the Add-On.

In SAP Business One Administration -> System Initialization -> Authorization -> General Authorizations form.

image

Or

2) Modify the constructor of your UDO generated class.

* Make sure this is the relevant class for your UDO!

a. Remove the call to the ‘Init' method and replace it with the code mentioned in section b. and c. below.

b. Add the UDOType assignment according to your UDO type:

  • If your UDO is Document type, add the following line:

          UDOType = SAPbobsCOM.BoUDOObjType.boud_Document;

 

  • If your UDO is Master Data type, add the following line:

          UDOType = SAPbobsCOM.BoUDOObjType.boud_MasterData;

 

c. Copy the lines below:

// Initialize the class

this.oUdoService = (SAPbobsCOM.GeneralService)B1Connections.diCompany.GetCompanyService().GetGeneralService(sUdoUniqueID);

// Point to the Header GeneralData of the MD UDO

this.oUdoHeaderGeneralData = (SAPbobsCOM.GeneralData)oUdoService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralData);

// Init ChildObjs collection

childObjs = new BaseChild[ChildTableNames.Length];

 

 

For example: here is the constructor of my Doc type UDO after the changes :

public MyDocUDO() {

sUdoUniqueID = "MyDocUDO";

// Child Tables Array

ChildTableNames = new string[1];

ChildTableNames[0] = "SAP_DOCL";

UDOType = SAPbobsCOM.BoUDOObjType.boud_Document;

// Initialize the class

this.oUdoService = (SAPbobsCOM.GeneralService)B1Connections.diCompany.GetCompanyService().GetGeneralService(sUdoUniqueID);

// Point to the Header GeneralData of the MD UDO

this.oUdoHeaderGeneralData = (SAPbobsCOM.GeneralData)oUdoService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralData);

// Init ChildObjs collection

childObjs = new BaseChild[ChildTableNames.Length];

 

this.Child_SAP_DOCL = new ChildSubObj1(ChildTableNames[0], this);

this.childObjs[0] = this.Child_SAP_DOCL;

}

Miki Zilbershtein is a SAP Business One SDK Solution Architect


Add to: del.icio.us | Digg | Reddit


Comment on this article
Comment on this weblog