Set value in TEXT field in invoice line item while importing Invoice.

SOLVED

Hi All,

I am using SDO (Sage Data Object)  to import invoices in Sage 50 UK. I would like to pass a multiline text in the details(Text) field. I tried many ways but unable to set value in that field. I tried to pass simple text but the value does not populate in the sage invoice.

objInvoiceItem = (InvoiceItem)objWorkSpace.CreateObject("InvoiceItem"); 
objInvoicePost = (InvoicePost)objWorkSpace.CreateObject("InvoicePost"); 

setInvoiceItemValue(objInvoiceItem, "TEXT", "test detail text" 1);

I tried all invoice types "product invoice", "service invoice" but unable to. Can you please help me with this? 

Regards,

Pinkesh

Parents Reply Children
  • +1 in reply to Pinkesh
    verified answer

    Are you setting the SERVICE_FLAG field of the InvoiceItem? (particularly if the InvoicePost object is set as a Product invoice):

    SDOHelper.Write(
        oInvoiceItem, 
        "SERVICE_FLAG", 
        (Byte)SageDataObject230.InvoiceItemType.sdoItemQtyService
    );
    oInvoiceItem.Text = (String)"test detail text";

    It certainly works for me.

  • 0 in reply to Chris Burke

    Hi Chris,

    I am setting the SERVICE_Flag. I tried values 0, 1, 2. I tried Invoice types 2, 3 means service type and product type. But the Details field remains blank in the Invoice. 

    What value you are using in SERVICE_Flag and Ivoice_type code.

    Regards,

    Pinkesh