Skip to main content
Answer

Don't Copy 'n Paste Invoice Discounts

  • September 12, 2022
  • 3 replies
  • 111 views

asommer
Varsity I
Forum|alt.badge.img

Hey all,

I have a situation with a document discount that when an Invoice is Copy ‘n Pasted it creates a copy of the discount.  I read this article, which is helpful, but I feel I’m missing something because nothing I’ve tried has worked.

I’ve set a PXCopyPasteHiddenView in a PXGraphExtension<ARInvoiceEntry> class:


[PXCopyPasteHiddenView]        

public PXSelectJoin<ARInvoiceDiscountDetail, InnerJoin<ARInvoice, On<ARInvoice.docType, Equal<ARInvoiceDiscountDetail.docType>, And<ARInvoice.refNbr, Equal<ARInvoiceDiscountDetail.refNbr>>>» Discounts;

 

I’m wondering if my PXSelect/PXSelectJoin is incorrect and if so what should it be?

Thanks all!

Best answer by jinin

Hi @asommer 

You need to use the same view name to hide the copy paste  view on the extension graph. Can you please try  like below?

   [PXCopyPasteHiddenView]
        public PXSelect<ARInvoiceDiscountDetail,
            Where<ARInvoiceDiscountDetail.docType, Equal<Current<ARInvoice.docType>>,
                And<ARInvoiceDiscountDetail.refNbr, Equal<Current<ARInvoice.refNbr>>>>,
            OrderBy<Asc<ARInvoiceDiscountDetail.lineNbr>>> ARDiscountDetails;

3 replies

jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • Answer
  • September 12, 2022

Hi @asommer 

You need to use the same view name to hide the copy paste  view on the extension graph. Can you please try  like below?

   [PXCopyPasteHiddenView]
        public PXSelect<ARInvoiceDiscountDetail,
            Where<ARInvoiceDiscountDetail.docType, Equal<Current<ARInvoice.docType>>,
                And<ARInvoiceDiscountDetail.refNbr, Equal<Current<ARInvoice.refNbr>>>>,
            OrderBy<Asc<ARInvoiceDiscountDetail.lineNbr>>> ARDiscountDetails;


asommer
Varsity I
Forum|alt.badge.img
  • Author
  • Varsity I
  • September 12, 2022

@jinin that worked!  Thank you very much, I appreciate it.

 

Woops, I clicked the “Best Answer” for my thank you message, but totally meant it to be your reply.


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • September 12, 2022

Hi @asommer - I have fixed the best answer 😀