Solved

Get column values from "Documents to Apply" table at Checks and Payments tab

  • 21 January 2022
  • 19 replies
  • 227 views

Userlevel 4
Badge +2

Hi,

My application is called when the user presses RELEASE button at Checks and Payments tab

Previously the similar logic was done for Payments and Applications tab is such way

foreach (PXResult<AR.ARAdjust, AR.ARInvoice, PX.Objects.AR.Standalone.ARRegisterAlias, ARTran> gridRow in Base.Adjustments.Select())
                                {
                                    AR.ARAdjust _adjust = gridRow;

                                 } 

And I have ability to access all columns from Documents to Apply tab

How to build same contraction for  Checks and Payments tab in order to get column values ?

icon

Best answer by jinin 27 January 2022, 19:39

View original

19 replies

Userlevel 7
Badge +17

Hi, @Ivan  Have you tried below code and verified it?

 

 foreach (PXResult<APAdjust, APPayment, AP.Standalone.APRegisterAlias, APTran> res in Base.Adjustments.Select())
{
APAdjust adj = res;
}

 

 

Userlevel 4
Badge +2

Hi, @Ivan  Have you tried below code and verified it?

 

 foreach (PXResult<APAdjust, APPayment, AP.Standalone.APRegisterAlias, APTran> res in Base.Adjustments.Select())
{
APAdjust adj = res;
}

 

 

@Naveen B  I will check it and let you know, thanks

Userlevel 7
Badge +11

Hi @Ivan 

If you want to get only the Documents to Apply tab details, we can try like below as well.

 foreach (APAdjust res in Base.Adjustments.Select())
            {
                APAdjust adj = res;
            }
               

Userlevel 4
Badge +2

Hi, @Ivan  Have you tried below code and verified it?

 

 foreach (PXResult<APAdjust, APPayment, AP.Standalone.APRegisterAlias, APTran> res in Base.Adjustments.Select())
{
APAdjust adj = res;
}

 

 

@Naveen B  I will check it and let you know, thanks

Hi @Naveen B 

Visual Studio does not see Adjustments in Base 

Are there any references that must be added ?

 

Userlevel 4
Badge +2

Hi @Ivan 

If you want to get only the Documents to Apply tab details, we can try like below as well.

 foreach (APAdjust res in Base.Adjustments.Select())
            {
                APAdjust adj = res;
            }
               

Hi @jinin 

I also need to extract APInvoices

Userlevel 4
Badge +2

Hi @Ivan 

If you want to get only the Documents to Apply tab details, we can try like below as well.

 foreach (APAdjust res in Base.Adjustments.Select())
            {
                APAdjust adj = res;
            }
               

In previous letter I wrote : “I also need to extract APInvoices”, I mean APPayment

Userlevel 7
Badge +17

Hi @Ivan  Can you please confirm on below points

  • Which Acumatica version you are using?
  • Where you have written this code?
foreach (PXResult<APAdjust, APPayment, AP.Standalone.APRegisterAlias, APTran> res in Base.Adjustments.Select())

{

APAdjust adj = res;

APPayment payment = res;

}

 

Userlevel 4
Badge +2

Hi @Ivan  Can you please confirm on below points

  • Which Acumatica version you are using?
  • Where you have written this code?
foreach (PXResult<APAdjust, APPayment, AP.Standalone.APRegisterAlias, APTran> res in Base.Adjustments.Select())

{

APAdjust adj = res;

APPayment payment = res;

}

 

Hi @Naveen B 

Acumatica version 2021R2

I am using the code provided by you, it can’t find Adjustments

 

Userlevel 7
Badge +11

Hi @Ivan 

If you want to get only the Documents to Apply tab details, we can try like below as well.

 foreach (APAdjust res in Base.Adjustments.Select())
            {
                APAdjust adj = res;
            }
               

In previous letter I wrote : “I also need to extract APInvoices”, I mean APPayment


@Ivan  Can you please confirm that you are writing the code on the existing APPayment graph or you written the code inside any static method?

If we extend the graph, we can get the Base details. If using any static method you cant get the Base details. 

Can you please share the code where you are exactly using the code?
 

Userlevel 4
Badge +2

Hi @Ivan 

If you want to get only the Documents to Apply tab details, we can try like below as well.

 foreach (APAdjust res in Base.Adjustments.Select())
            {
                APAdjust adj = res;
            }
               

In previous letter I wrote : “I also need to extract APInvoices”, I mean APPayment


@Ivan  Can you please confirm that you are writing the code on the existing APPayment graph or you written the code inside any static method?

If we extend the graph, we can get the Base details. If using any static method you cant get the Base details. 

Can you please share the code where you are exactly using the code?
 

Hi @jinin 

You are right, I am using a different thing, not APPayment graph

The class, that is used is provide by you in this topic - 

So, I need access to Documents to Apply tab, when I am releasing Checks and Applications Item

Userlevel 7
Badge +11

Hi @Ivan 

I hope this issue is resolved as per the update on the  below post

Call Checks and Payments item RELEASE button via event | Community (acumatica.com) 

Userlevel 4
Badge +2

Hi @Ivan 

I hope this issue is resolved as per the update on the  below post

Call Checks and Payments item RELEASE button via event | Community (acumatica.com) 

Hi @jinin 

These topics are different. In this topic - Call Checks and Payments item RELEASE button via event | Community (acumatica.com) you have mentioned that extending the graph APPayment, we can get the Base details. In this case APReleaseProcess is extended. How can I access Base.Adjustments from this Method ?

 

Userlevel 7
Badge +11

Hi @Ivan 

I hope this issue is resolved as per the update on the  below post

Call Checks and Payments item RELEASE button via event | Community (acumatica.com) 

Hi @jinin 

These topics are different. In this topic - Call Checks and Payments item RELEASE button via event | Community (acumatica.com) you have mentioned that extending the graph APPayment, we can get the Base details. In this case APReleaseProcess is extended. How can I access Base.Adjustments from this Method ?

 

Hi @Ivan 

You need to write BQL and get the data. For the above example, payment Info we are getting from the APPayment with the Refnbr field. Same as you need to write the bqls and fetch the data.

Userlevel 4
Badge +2

Hi @Ivan 

I hope this issue is resolved as per the update on the  below post

Call Checks and Payments item RELEASE button via event | Community (acumatica.com) 

Hi @jinin 

These topics are different. In this topic - Call Checks and Payments item RELEASE button via event | Community (acumatica.com) you have mentioned that extending the graph APPayment, we can get the Base details. In this case APReleaseProcess is extended. How can I access Base.Adjustments from this Method ?

 

Hi @Ivan 

You need to write BQL and get the data. For the above example, payment Info we are getting from the APPayment with the Refnbr field. Same as you need to write the bqls and get the data.

Hi @jinin The elemnts that I need to extract atr located in different enitites

For example date is located in Invoices

and reference Nbr is located in Adjust

That construction that was used in class that extends APPaymentEntry

allowed to extract all rows elements coherently. How I must form the request, which fields must be used for mapping in order to ensure that fields belongs to one row ?

Userlevel 7
Badge +11

Hi @Ivan 

If you are not getting the Base graph details, you need to write the BQL. Please try with the below BQL and check

 

foreach (PXResult<APAdjust, APPayment, PX.Objects.AP.Standalone.APRegisterAlias, APTran> res in PXSelectJoin<APAdjust, LeftJoin<APInvoice, On<APInvoice.docType, Equal<APAdjust.adjdDocType>, And<APInvoice.refNbr, Equal<APAdjust.adjdRefNbr>>>,
                                          LeftJoin<APTran, On<APInvoice.paymentsByLinesAllowed, Equal<True>,  And<APTran.tranType, Equal<APAdjust.adjdDocType>, And<APTran.refNbr, Equal<APAdjust.adjdRefNbr>,And<APTran.lineNbr, Equal<APAdjust.adjdLineNbr>>>>>>>,
                                          Where<APAdjust.adjgDocType, Equal<Required<APPayment.docType>>,  And<APAdjust.adjgRefNbr, Equal<Required<APPayment.refNbr>>,
                                          And<APAdjust.released, NotEqual<True>>>>>.Select(new PXGraph(), doc.DocType, doc.RefNbr))
                    {

                        APAdjust adj = res;
                        APPayment apPayment = res;
                        APTran tran = res;


                    }

Userlevel 4
Badge +2

Hi @Ivan 

If you are not getting the Base graph details, you need to write the BQL. Please try with the below BQL and check

 

foreach (PXResult<APAdjust, APPayment, PX.Objects.AP.Standalone.APRegisterAlias, APTran> res in PXSelectJoin<APAdjust, LeftJoin<APInvoice, On<APInvoice.docType, Equal<APAdjust.adjdDocType>, And<APInvoice.refNbr, Equal<APAdjust.adjdRefNbr>>>,
                                          LeftJoin<APTran, On<APInvoice.paymentsByLinesAllowed, Equal<True>,  And<APTran.tranType, Equal<APAdjust.adjdDocType>, And<APTran.refNbr, Equal<APAdjust.adjdRefNbr>,And<APTran.lineNbr, Equal<APAdjust.adjdLineNbr>>>>>>>,
                                          Where<APAdjust.adjgDocType, Equal<Required<APPayment.docType>>,  And<APAdjust.adjgRefNbr, Equal<Required<APPayment.refNbr>>,
                                          And<APAdjust.released, NotEqual<True>>>>>.Select(new PXGraph(), doc.DocType, doc.RefNbr))
                    {

                        APAdjust adj = res;
                        APPayment apPayment = res;
                        APTran tran = res;


                    }

Hi @jinin 

Thanks you a lot for the request

One thing I need to clarify : In previous moment I mentioned that I need to extract dueDate column which has type APInvoice, in example, which you provide this type is absent 

Will it be enough if I just add this type to parameters list or it should be done in another way ?

Userlevel 4
Badge +2

Hi @Ivan 

If you are not getting the Base graph details, you need to write the BQL. Please try with the below BQL and check

 

foreach (PXResult<APAdjust, APPayment, PX.Objects.AP.Standalone.APRegisterAlias, APTran> res in PXSelectJoin<APAdjust, LeftJoin<APInvoice, On<APInvoice.docType, Equal<APAdjust.adjdDocType>, And<APInvoice.refNbr, Equal<APAdjust.adjdRefNbr>>>,
                                          LeftJoin<APTran, On<APInvoice.paymentsByLinesAllowed, Equal<True>,  And<APTran.tranType, Equal<APAdjust.adjdDocType>, And<APTran.refNbr, Equal<APAdjust.adjdRefNbr>,And<APTran.lineNbr, Equal<APAdjust.adjdLineNbr>>>>>>>,
                                          Where<APAdjust.adjgDocType, Equal<Required<APPayment.docType>>,  And<APAdjust.adjgRefNbr, Equal<Required<APPayment.refNbr>>,
                                          And<APAdjust.released, NotEqual<True>>>>>.Select(new PXGraph(), doc.DocType, doc.RefNbr))
                    {

                        APAdjust adj = res;
                        APPayment apPayment = res;
                        APTran tran = res;


                    }

Hi @jinin 

I want to add some information together with previous letter. this request returns empty list

After I pressed Release

I started to debug my project and the pointer in code do not entered the foreach cycle. It returned nothing. Is there can be something that is missed ?

Can you, please, explain these parameters : APAdjust, APPayment, PX.Objects.AP.Standalone.APRegisterAlias, APTran

The question is : it is obligatory to define only these types ? For example I do not use PX.Objects.AP.Standalone.APRegisterAlias and APTran, but as I have mentioned in previous letter I need extract Duedate field that is located in APInvoice entity. Can be such defining be possible ? 

if no, how can I get DueDate ?

Userlevel 4
Badge +2

Hi @jinin 

I tried to change type of parameters and remove some part of checks for search due to the initial request did not returned any data, but the result remains same

can you, please, suggest what should be changed in this request ? 

Userlevel 7
Badge +11

Hi @Ivan 

If you are not getting the Base graph details, you need to write the BQL. Please try with the below BQL and check

 

foreach (PXResult<APAdjust, APPayment, PX.Objects.AP.Standalone.APRegisterAlias, APTran> res in PXSelectJoin<APAdjust, LeftJoin<APInvoice, On<APInvoice.docType, Equal<APAdjust.adjdDocType>, And<APInvoice.refNbr, Equal<APAdjust.adjdRefNbr>>>,
                                          LeftJoin<APTran, On<APInvoice.paymentsByLinesAllowed, Equal<True>,  And<APTran.tranType, Equal<APAdjust.adjdDocType>, And<APTran.refNbr, Equal<APAdjust.adjdRefNbr>,And<APTran.lineNbr, Equal<APAdjust.adjdLineNbr>>>>>>>,
                                          Where<APAdjust.adjgDocType, Equal<Required<APPayment.docType>>,  And<APAdjust.adjgRefNbr, Equal<Required<APPayment.refNbr>>,
                                          And<APAdjust.released, NotEqual<True>>>>>.Select(new PXGraph(), doc.DocType, doc.RefNbr))
                    {

                        APAdjust adj = res;
                        APPayment apPayment = res;
                        APTran tran = res;


                    }

Hi @jinin 

I want to add some information together with previous letter. this request returns empty list

After I pressed Release

I started to debug my project and the pointer in code do not entered the foreach cycle. It returned nothing. Is there can be something that is missed ?

Can you, please, explain these parameters : APAdjust, APPayment, PX.Objects.AP.Standalone.APRegisterAlias, APTran

The question is : it is obligatory to define only these types ? For example I do not use PX.Objects.AP.Standalone.APRegisterAlias and APTran, but as I have mentioned in previous letter I need extract Duedate field that is located in APInvoice entity. Can be such defining be possible ? 

if no, how can I get DueDate ?



Yes. Based on the requirement, we can join the tables and get the data. Please make sure the Join and conditions should be added correctly. To verify the result, We can write SQL script as per the requirement and convert same as BQL.

To get the Due date, you can add the APInvoice table and get the value. 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved