Githere
Githere

Reputation: 21

How can you pass a custom field value from sales order screen to sales invoice screen in acumatica code

I have a custom field in sales order header. I want to paste the value from this field to sales invoice when i click the prepare invoice action in Acumatica. here is the image of the screen:

enter image description here

Upvotes: 2

Views: 574

Answers (1)

Yuriy Zaletskyy
Yuriy Zaletskyy

Reputation: 5151

You'll need to override the Action PrepareInvoice and pass the custom fields.

There are two ways of achieving this:

public class SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
{

    [PXOverride]
    public IEnumerable PrepareInvoice(PXAdapter adapter, Func<PXAdapter, IEnumerable> baseMethod)
    {
        //You can paste your field either here
        return baseMethod(adapter); // and then return
    }

or like this:

public class SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
{        
    [PXOverride]
    public IEnumerable PrepareInvoice(PXAdapter adapter, Func<PXAdapter, IEnumerable> baseMethod)
    {
        var result = baseMethod(adapter); 
        // add your pasting of your field here + some logic

        return result;
    }

depending from what is your use case.

Upvotes: 2

Related Questions