Skip to Content

How to Add service related documents for Service call using DI API

Hi Experts,

Can you please help me,How to Add the service related document for Service Call using DI API and please provide sample Code.

Thanks in Advance,
P.Pallavi

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Oct 07, 2017 at 10:43 PM

    Hi Pallavi,

    Use the ServiceCallInventoryExpenses object to related documents to your service call.

    A sample:

    ServiceCalls oService = oCompany.GetBusinessObject(BoObjectTypes.oServiceCalls);
    //Load your service call
    if (oService.GetByKey(22))
    {
        //Check if it is necessary open a new line for your expense
        if (oService.Expenses.DocEntry != 0)
            oService.Expenses.Add();
    
    
        //Provide the docEntry of your document and the type of your document
        oService.Expenses.DocEntry = 148;
        oService.Expenses.DocumentType = BoSvcEpxDocTypes.edt_Invoice;
    
    
        if (oService.Update() != 0)
            MessageBox.Show(oCompany.GetLastErrorDescription());
    }
    

    Hope it helps.

    Kind Regards,

    Diego Lother

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 13 at 10:52 AM

    Hi, I tried the solution provided Diego. It works but not always. Sometimes I get an error that says:

    "10000677 - No related record found"

    Can anyone help?

    Add comment
    10|10000 characters needed characters exceeded