Skip to Content
avatar image
Former Member

When SAP is checking authorization through DI API?

I've got such code:

     SAPbobsCOM.Documents mainEntry = ConnectionHolder.GetCompany(Token).GetBusinessObject(BoObjectTypes.oInventoryGenEntry);

 if (mainEntry.Add() != 0)
                   {
                       throw new UDOException(ConnectionHolder.GetCompany(Token).GetLastErrorDescription(), "");
                   }

Is checking authorization is in moment of adding document or I have to write some additional code to check.

I'm wondering if this is SAP issue. My example is that when I have 'No authorization' for closing period. System on UI is working properly and prevent of adding documents but when I'm adding document programaticly system doesn't throw any message.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Nov 30, 2017 at 01:44 PM

    Solution: SAP note 2108119

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 22, 2017 at 01:16 PM

    Hi Sebastian,

    Usually an addon can connect to B1 in three different ways:

    1. In an internal addon, the DI API will use the user that is logged in at that moment, unless you would have somehow hard coded another user.
    2. An external addon can access a B1 client that is open on the machine at that moment, and the DI API will then also use the logged in user unless you would have somehow hard coded another user.
    3. An external addon can access B1 if you provide it a user name and password.

    The question is, which user is actually logging in?

    Regards,

    Johan

    Add comment
    10|10000 characters needed characters exceeded