Skip to main content
Solved

How to add process and process all actions


Forum|alt.badge.img
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");

Best answer by slesin

@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.

View original
Did this topic help you find an answer to your question?

8 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3410 replies
  • April 17, 2023

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);
                });
        }

 


Forum|alt.badge.img
  • Author
  • Freshman I
  • 21 replies
  • April 17, 2023

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


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3410 replies
  • April 17, 2023

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


Forum|alt.badge.img
  • Author
  • Freshman I
  • 21 replies
  • April 17, 2023
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.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3410 replies
  • April 17, 2023

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 ?

 

 


Forum|alt.badge.img
  • Author
  • Freshman I
  • 21 replies
  • April 17, 2023

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


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3410 replies
  • April 17, 2023

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


slesin
Acumatica Employee
Forum|alt.badge.img
  • Acumatica Employee
  • 9 replies
  • Answer
  • April 19, 2023

@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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings