Skip to Content
0

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

Oct 05, 2017 at 12:15 PM

193

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

DIEGO LOTHER Oct 07, 2017 at 10:43 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Feb 13 at 10:52 AM
0

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?

Share
10 |10000 characters needed characters left characters exceeded