How to send custom field value from salestable to custinvoicejour ?

Hi All,

I have added one checkbox in salestable form and when I do invoice it is reflect to custInoiveJournal form.

Thanks in advance.

You can easily find the answer by yourself. Think about it - isn’t there already code for all the standard fields? You can use cross-references to find out how it works for standard fields and then do the same for your custom field.

Notice that CustInvoiceJour has initFromSalesTable() method, which gets a SalesTable buffer as a parameter. It’s called from SalesInvoiceJournalCreate.initInvoiceHeaderFromSourceTable(), but you don’t have to worry about it. You can simply use CoC on initFromSalesTable() to initialize your extra field.

Thanks Martin,

But when I Click Invoice menubutton from saleorder it should reflect to CustInvoiceJour table. Any suggestion

Sorry, I have no idea what you’re talking about. Can you please give us more details about your problem?

I thought you wanted to copy a file from SalesTable to CustInvoiceJour when posting an invoice and that’s what I’ve explained above.

I have added below code for my requirement it is working.

[ExtensionOf(classStr(SalesInvoiceJournalCreateBase))]
final class SalesInvoiceJournalCreateBase_Extension
{   

    protected void createJournalHeader()
    {
        SalesParmTable      salesParmTable;
        CustInvoiceJour     custInvoiceJour;
        SalesTable          salesTable;


        next createJournalHeader();
    
        custInvoiceJour = this.getJournal();
        salesParmTable  = this.parmParmTable();
        salesTable      = SalesTable::find(salesParmTable.salesID);
        if(salesTable.DIPLIsChecked)
        {
            custInvoiceJour.selectforUpdate(true);
            custInvoiceJour.IsChecked = salesTable.IsChecked;
            custInvoiceJour.doupdate();
        }
    }

}