Skip to Content

Access OCHH table from Service Layer

I am trying to access the OCHH table, but when looking at the Service Layer documentation, it does not have the Get method to be able to make queries to it, how can I access the data of said table and filter it from the SL?

captura.png (21.3 kB)
captura-2.png (193.1 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

6 Answers

  • Best Answer
    Posted on Jul 22, 2020 at 07:02 AM

    Dear Mario Galeano,

    Here is how you can add Deposit by Check Using Service Layer:

    POST /b1s/v1/Deposits
    {
    "DepositType": "dtChecks",
    "DepositDate": "2020-07-22",
    "DepositCurrency": "GBP",
    "DepositAccount": "102020",
    "ReconcileAfterDeposit": "tYES",
    "CheckDepositType": "cdtCashChecks",
    "CheckLines": [
    {
    "CheckKey": 13,
    "CheckCurrency": "GBP"
    }
    ],
    "CreditLines": [],
    "BOELines": []
    }
    

    Here is how you can add Deposit by Check Using DI API:

    SAPbobsCOM.CompanyService oCompanyService = (SAPbobsCOM.CompanyService)oCompany.GetCompanyService();
    SAPbobsCOM.DepositsService dpService = (SAPbobsCOM.DepositsService)oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.DepositsService);
    SAPbobsCOM.Deposit oDeposit = (SAPbobsCOM.Deposit)dpService.GetDataInterface(SAPbobsCOM.DepositsServiceDataInterfaces.dsDeposit);
    oDeposit.DepositType = SAPbobsCOM.BoDepositTypeEnum.dtChecks;
    oDeposit.CheckDepositType = SAPbobsCOM.BoCheckDepositTypeEnum.cdtCashChecks;
    oDeposit.ReconcileAfterDeposit = SAPbobsCOM.BoYesNoEnum.tYES;
    oDeposit.Checks.Add();
    oDeposit.Checks.Item(0).CheckKey = 12;
    oDeposit.DepositAccount = "102020";
    dpService.AddDeposit(oDeposit);
    

    Hope it helps!

    Kind regards,

    ANKIT CHAUHAN

    SAP Business One Support

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 18, 2020 at 05:55 PM

    Dear Mario Galeano,

    Will Deposits Entity help for your cause?

    GET /b1s/v1/Deposits(7)

    Otherwise, Semantic Layer View Exposure should help you.

    Check this blog and section SAP Business One Semantic Layer View Exposure in Service Layer User Manual.

    Kind regards,

    ANKIT CHAUHAN

    SAP Business One Support

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 21, 2020 at 02:35 PM

    Hello ANKIT CHAUHAN

    If you had tried that way, but it tells me that there is no record, this is my example:

    http://192.168.0.169:50000/b1s/v1/Deposits(1271)

    Kind regards,

    Mario


    captura.png (35.1 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 21, 2020 at 03:17 PM

    Dear ANKIT CHAUHAN

    If the deposit code exists


    captura.png (23.9 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 21, 2020 at 03:36 PM

    Dear ANKIT CHAUHAN

    Ok, I see why the GET method was not working for me, one last consultation, to make the POST request, in this case using the option of "deposits by check", what would be the format for sending?

    Kind regards,

    Mario

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 22, 2020 at 10:02 PM

    Dear ANKIT CHAUHAN

    Thank you very much for the help

    King regards,

    Mario

    Add a comment
    10|10000 characters needed characters exceeded