Skip to main content
Solved

Display processing dialog with PXProcessButton


Forum|alt.badge.img+1

I have a custom processing screen:

In order to get the non-intrusive validation to work I had to create my own PXProcessButton vs. using the built-in processing delegate.  All is working, however, now that I have done this I don’t have a processing dialog, just a little green dot that shows everything processed.  How can I show the processing dialog in this scenario?  FYI, I used code in AR507000 (Calculate Overdue charges) as the example for hooking up a custom processing button and having my required fields validate in this way prior to processing.  Client didn’t like the behavior of just throwing PXExceptions.

Here is my custom PXProcessButton:

 

        public PXAction<PMTaskToAssignFilter> Assign;

        [PXUIField(DisplayName = "Assign", MapEnableRights = PXCacheRights.Update, MapViewRights = PXCacheRights.Update)]

        [PXProcessButton]

        public virtual IEnumerable assign(PXAdapter adapter)

        {

            PMTaskToAssignFilter filter = Filter.Current;

            if (!CheckRequiredFieldsFilled(Filter.Cache, filter))

            {

                return adapter.Get();

            }

            List<PMTask> pMTasks = new List<PMTask>();

            foreach (PMTask task in Tasks.Select())

            {

                if (task.Selected ?? false)

                {

                    pMTasks.Add(task);

                }

            }

            if (pMTasks.Count == 0) {

                // Acuminator disable once PX1050 HardcodedStringInLocalizationMethod [Justification]

                throw new PXException("No records selected!");

                

            }


            PXLongOperation.StartOperation(this, () =>

            {

                this.IsProcessing = true;

                PMTaskAssignValues assignGraph = PXGraph.CreateInstance<PMTaskAssignValues>();

                assignGraph.AssignValues(pMTasks, filter);

            });


            return adapter.Get();

        }

 

Best answer by Naveen Boga

Hi @rjean09  Understood. Still, I can suggest go with the default “PROCESS” action instead of Custom action.

For the required fields, you can provide “Required = True” at the DAC level, so that fields will show as mandatory fields, but will NOT throw any validations.

For this, you can have view delegate for the Processing and check if these values are present then only records will be populated on the grid.

This way you can achieve processing popup and mandatory fields red mark. 

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

6 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3407 replies
  • August 7, 2021

Hi @rjean09  You better have a logic in the default Acumatica button, instead of having new action and writing code for “Processing Dialogue” box.

 

If you see the default Acumatica Processing screens does not show any validations, always required fields will be populated with the defaults OR Process will execute if values are NOT present. 
 

Also, there is NO “Process All” action in your screen, is this processing screen ran by the user manually everytime? 

 


Forum|alt.badge.img+1
  • Author
  • Semi-Pro III
  • 77 replies
  • August 7, 2021

Hi @Naveen B 

I would prefer to use the default Acumatica Process button, however, I could not figure out how to get the type of field validation (see screen shot above) with that due to the static method and not having PXAdapter, etc.  User said the PXException method I was using was “ugly”.  (like you said, Process will execute so have to handle in static process method).  Yes, it was a requirement that Process All button be removed.  Users MUST select the rows they want processed.  So, all is “functional” but I’m getting complaints about the “look” of things.  New validation that works like AR507000 is nice, but side-effect with having to implement with custom PXProcessButton is that processing dialog is now gone.  Trying to make everyone happy but quite the struggle I’m having.


Forum|alt.badge.img+1
  • Author
  • Semi-Pro III
  • 77 replies
  • August 7, 2021

Also note, these required fields are not for filtering but are used to bulk update attributes in the process logic.  The filter is just based on Project ID and the assign drop down.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3407 replies
  • Answer
  • August 9, 2021

Hi @rjean09  Understood. Still, I can suggest go with the default “PROCESS” action instead of Custom action.

For the required fields, you can provide “Required = True” at the DAC level, so that fields will show as mandatory fields, but will NOT throw any validations.

For this, you can have view delegate for the Processing and check if these values are present then only records will be populated on the grid.

This way you can achieve processing popup and mandatory fields red mark. 


Forum|alt.badge.img+1
  • Author
  • Semi-Pro III
  • 77 replies
  • August 9, 2021

@Naveen B I checked with our implementer and they are OK with just having the green dot show for the processing results vs. having the processing dialog for this screen.  I had attempted to check the required values this way from the Process view delegate and had some trouble which is why I changed to a custom PXProcessButton.  If this comes back or comes up again I’ll explore trying to do this using the delegate and built-in process button again.  So, problem solved for now but thank you again for feedback and help.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3407 replies
  • August 9, 2021

Hi @rjean09 Sure. Thanks for sharing an update.


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