Solved

How to add process and process all actions

  • 17 April 2023
  • 8 replies
  • 198 views

Userlevel 1
Badge
public class NewTest : PXGraph<NewTest>
{
public PXFilter<TestFilter> Filter;
public PXCancel<TestFilter> Cancel;
public PXFilteredProcessing<APPayment, TestFilter, Where<
APPayment.docType.IsEqual<TestFilter.docType.FromCurrent>.
And<TestFilter.fromDate.FromCurrent.IsNull.
Or<APPayment.adjDate.IsGreaterEqual<TestFilter.fromDate.FromCurrent>>>.
And<TestFilter.toDate.FromCurrent.IsNull.
Or<APPayment.adjDate.IsLessEqual<TestFilter.toDate.FromCurrent>>>>, OrderBy<Desc<APPayment.createdDateTime>>> CheckPayments;

[PXHidden]
public class TestFilter : IBqlTable
{
#region IsVoid
[PXString(3, IsFixed = true)]
[PXUIField(DisplayName = "Doc. Type")]
[PXDefault(APDocType.Check)]
[PXStringList(
new string[]
{
APDocType.Check,
APDocType.VoidCheck
},
new string[]
{
"Check",
"VoidCheck"
})]
public virtual string DocType { get; set; }
public abstract class docType :
PX.Data.BQL.BqlString.Field<docType>
{ }
#endregion

#region FromDate
[PXDate]
[PXUIField(DisplayName = "From Date")]
[PXUnboundDefault(typeof(Today))]
public virtual DateTime? FromDate { get; set; }
public abstract class fromDate :
PX.Data.BQL.BqlDateTime.Field<fromDate>
{ }
#endregion

#region ToDate
[PXDate]
[PXUIField(DisplayName = "To Date")]
[PXUnboundDefault(typeof(Today))]
public virtual DateTime? ToDate { get; set; }
public abstract class toDate :
PX.Data.BQL.BqlDateTime.Field<toDate>
{ }
#endregion
}
}

I have added a custom graph for processing and want to add the process and process all button for processing. How can I do that I followed T240 but not able to do so. I am sharing my code below if anyone can help.

 

I tried adding following code but no effect

 

CheckPayments.SetProcessCaption("Assign");
CheckPayments.SetProcessAllCaption("Assign All");

icon

Best answer by slesin 20 April 2023, 00:29

View original

8 replies

Userlevel 7
Badge +17

Hi @tanuj81  Basically Process and Process All buttons are added in the constructor. It seems the constructor code is missing your code. please add like below

 

  public NewTest()
        {
            CheckPayments.SetProcessCaption("Process");
            CheckPayments.SetProcessAllCaption("ProcessAll");
            TestFilter currentFilter = this.Filter.Current;
            CheckPayments.SetProcessDelegate(
                delegate (List<APPayment> list)
                {
                    GetOpenSSaaSOrders(list, currentFilter);
                });
        }

 

Userlevel 1
Badge

@Naveen Boga I added the code still I cannot see the process buttons. Any aspx settings needed ??

Userlevel 7
Badge +17

@tanuj81  Nothing to be added in the .aspx page. Can you please share the graph file here.

Userlevel 1
Badge
using System;
using System.Collections;
using System.Collections.Generic;
using PX.Data;
using PX.Objects.AP;

namespace MyCust
{
public class Test : PXGraph<Test>
{
public PXFilter<TestFilter> Filter;
public PXCancel<TestFilter> Cancel;
public PXFilteredProcessing<APPayment, TestFilter, Where<
APPayment.docType.IsEqual<TestFilter.docType.FromCurrent>.
And<TestFilter.fromDate.FromCurrent.IsNull.
Or<APPayment.adjDate.IsGreaterEqual<TestFilter.fromDate.FromCurrent>>>.
And<TestFilter.toDate.FromCurrent.IsNull.
Or<APPayment.adjDate.IsLessEqual<TestFilter.toDate.FromCurrent>>>>, OrderBy<Desc<APPayment.createdDateTime>>> CheckPayments;

public Test()
{
CheckPayments.SetProcessCaption("Process");
CheckPayments.SetProcessAllCaption("ProcessAll");
TestFilter currentFilter = this.Filter.Current;
CheckPayments.SetProcessDelegate(
delegate (List<APPayment> list)
{
GetOpenSSaaSOrders(list, currentFilter);
});
}



private static void GetOpenSSaaSOrders(List<APPayment> workOrder, TestFilter filter)
{

}

[PXHidden]
public class TestFilter : IBqlTable
{
#region IsVoid
[PXString(3, IsFixed = true)]
[PXUIField(DisplayName = "Doc. Type")]
[PXDefault(APDocType.Check)]
[PXStringList(
new string[]
{
APDocType.Check,
APDocType.VoidCheck
},
new string[]
{
"Check",
"VoidCheck"
})]
public virtual string DocType { get; set; }
public abstract class docType :
PX.Data.BQL.BqlString.Field<docType>
{ }
#endregion

#region FromDate
[PXDate]
[PXUIField(DisplayName = "From Date")]
[PXUnboundDefault(typeof(Today))]
public virtual DateTime? FromDate { get; set; }
public abstract class fromDate :
PX.Data.BQL.BqlDateTime.Field<fromDate>
{ }
#endregion

#region ToDate
[PXDate]
[PXUIField(DisplayName = "To Date")]
[PXUnboundDefault(typeof(Today))]
public virtual DateTime? ToDate { get; set; }
public abstract class toDate :
PX.Data.BQL.BqlDateTime.Field<toDate>
{ }
#endregion
}
}
}

@Naveen Boga this is the graph code.

Userlevel 7
Badge +17

Hi @tanuj81  I don’t see any issues with the code and I just created in my local with the same code and created a screen.

I can able to see the Process and Process All buttons. Please find attached screenshot for reference.

Can you please try in the new/different instance and check once ?

 

 

Userlevel 1
Badge

@Naveen Boga did you use the exact code I provided or made any changes I am still facing the issue ??

Userlevel 7
Badge +17

Yes @tanuj81  Tried the EXACT code as shared above and it is working for me.

Userlevel 2
Badge

@tanuj81, please make sure that in the aspx file the PrimaryView attribute is set to “Filter”, not “CheckPayments”.

If you are OK with standard captions of these buttons, you don’t need CheckPayments.SetProcessCaption("Process") in the constructor.

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