c# - How to Customize screen AP Release All and AR Relase All in Acumatica ERP System -


i have problem in customize screen ar relase (ar501000). problem when try pass value of invoice number (customer order's field) in screen invoices , memos (ar301000) using screen ar release process (ar501000) using checkbox.

first, create gltranextension below :

using system; using px.data; using px.objects.cm; using px.objects.cs; using px.objects.pm; using px.objects.cr; using px.objects.tx; using system.collections.generic; using px.objects; using px.objects.gl;  namespace sglcustomizeproject {   [serializable]   public class gltranextension: pxcacheextension<px.objects.gl.gltran>   {     #region usrinvoicenbr     public abstract class usrinvoicenbr : ibqltable { }      [pxdbstring(60, isfixed = true)]     [pxuifield(displayname = "vendor ref. / customer order")]     public string usrinvoicenbr { get; set; }     #endregion  } } 

and try create customize arreleaseprocessextension. below customize code :

using system; using system.collections.generic; using system.linq; using system.text; using system.threading.tasks; using px.data; using px.objects.ar; using px.objects.gl; using px.objects.cm; using px.objects.ca; using px.objects.cr; using px.objects.cs; using px.objects.ct; using px.objects.pm;  namespace sglcustomizeproject {  public class arrelaseprocessextension: pxgraphextension<arreleaseprocess>  {    public delegate list<arregister> releasedocprocdel(journalentry je, ref arregister doc, pxresult<arinvoice, currencyinfo, terms, customer, account> res, out pmregister pmdoc);   [pxoverride]   public list<arregister>releasedocproc(journalentry je, ref arregister doc, pxresult<arinvoice, currencyinfo, terms, customer, account> res, out pmregister pmdoc, releasedocprocdel del)   {       je.rowinserting.addhandler<gltran>((sender, e) =>           {               gltran gltran = e.row gltran;                arinvoice ari = pxresult<arinvoice>.current;               if (ari != null && ari.invoicenbr != null)               {                   gltranextension gltex = pxcache<gltran>.getextension<gltranextension>(gltran);                   gltex.usrinvoicenbr = ari.invoicenbr;               }           });       return del(je, ref doc, res, out pmdoc);   }  } } 

if go screen release ar documents (ar501000) , need release 1 transaction using checkbox button. works.. when try release more 1 transactions using checkbox button also, second transactions fill same invoice number in journal transaction screen, i'll describe using condition :

if release 2 transactions

  1. reference number = 000012 , invoice number (in field customer order) = inv1254
  2. reference number = 000013 , invoice number (in field customer order) = inv1255

and release 2 transactions, , in journal transactions shows result below :

  1. reference number = 000012 , invoice number (in field customer order) = inv1254
  2. reference number = 000013 , invoice number (in field customer order) = inv1254

i don't know why in second transaction shows same invoice number value in journal transaction screen.

in case it's happening because of

arinvoice ari = pxresult<arinvoice>.current; 

pxresult.current can differ actual invoice processing.

it better explicitly select required invoice in case:

arinvoice ari = pxselect<arinvoice, where<arinvoice.refnbr, equal<required<gltran.refnbr>>, and<arinvoice.doctype, equal<required<gltran.trantype>>>>>.select(sender.graph, gltran.refnbr, gltran.trantype); 

Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -