Skip to main content
Answer

Error: A dialog cannot be requested

  • May 25, 2025
  • 6 replies
  • 106 views

aaghaei
Captain II
Forum|alt.badge.img+10

Hello all,

The below is a follow up question re the below post.

With ​@andriitkachenko help I have almost completed a derived class on “EPApprovalAutomation”. Now I am going to call it in “APInvoiceEntry” graph extension. It works as expected if in the Approval Maps screen (EP205015) the “Reason for Approval” and/or “Reason for Rejection” is set to “Is Not Prompted”. As soon as I set their value to either “Is Required” or “Is Optional” that requires the engine to display the “Enter Reason” dialog, I get this error that “Error: A dialog cannot be requested”.

I tested the “Reassign” that also displays dialog too but this works fine (Acumatica base code added the Approve/Reject actions through the workflow extensions but Reassign action is added in the EPApprovalAutomation class though)

I thought maybe the derived class initialization override causes issue and spent quite bit of time on it but couldn’t find anything wrong with the Derived class. So I commented the full class as it doesn’t exist at all. Then, I just simply copied and pasted the “Approval” view class in my “APInvoiceEntry” graph extension to see if this is what causes problem. Surprisingly with the below code which is identical to Acumatica base code but just placed in a graph extension (just for sake of testing but of course when issue is addressed I will call the custom derived class), I get the exact same error. This is the simple identical code that causes the issue when I click on Approve or Reject with Reason Settings is set to “Is Required” or “Is Optional”:

using PX.Data;
using PX.Objects.AP;
using PX.Objects.EP;
using EPMessages = PX.Objects.EP.Messages;

namespace HCL.ApprovalWorkflow
{
public class HCLAPInvoiceEntryApprovalWorkflow : PXGraphExtension<APInvoiceEntry>
{
public static bool IsActive() => true;

[PXViewName(EPMessages.Approval)]
public EPApprovalAutomationWithoutHoldDefaulting<APInvoice, APInvoice.approved, APInvoice.rejected, APInvoice.hold, APSetupApproval> Approval;
}
}

Any idea what is happening?

Best answer by aaghaei

Hi ​@Chris Hackett 

unfortunately I couldn’t get much of help from the dev support. We ended up extending on EPApprovalList instead of EPApprovalAutomation and copy the methods of ApprovalAutonation to our class. Anyways we meant to override most of the methods and handlers. Not clean but works. 

6 replies

andriitkachenko
Jr Varsity III
Forum|alt.badge.img+6

Hi ​@aaghaei 

Odd thing, but when I tried on my instance, it doesn’t show consistent behavior.

At first, it show the same error as for you. But then, when I copied the Reassign method (it’s virtual, so I overrode it, just to try to debug), it stopped complaining - and even more, it didn’t complain later on when I remove the override as well! Strange.

However, I also noticed that the document status doesn’t change at all, regardless of action: approve, reject or reassign. So this might be a more global issue.

Can it be because you’re hiding the original view named “Approval”?

I looked into the error, and it is appearing if the final method down the stack of AskExt receives either graph or view as null.


aaghaei
Captain II
Forum|alt.badge.img+10
  • Author
  • Captain II
  • May 27, 2025

Hi ​@andriitkachenko 

Thank you as always for the response and the time. I am not sure how else I can call the EPApprovalAutomation override if I do not override the Approval view as it is used in many places. Also I am not really comfortable to put a code on the live tenant I am not confident about and can have random behavior. I created a dev support case with Acumatica (Case #443023) assigned to Mark Volshteyn to see what response I get. I will post the result on community so others can benefit in case they come across the same issue.

Thank you again.


andriitkachenko
Jr Varsity III
Forum|alt.badge.img+6

@aaghaei completely agree with your reasoning. These heisenbugs are hard to triage, and always take a lot of time to figure out - especially, when 95% of the codebase is out of your hands.

Even if naming the view with some other name would make Reassign popup work, it wouldn’t be a sufficient solution anyway, as you need to hide original view per your requirements.

I was just thinking out loud about possible reasons why it occurs - sometimes such ideas can lead to a breakthrough in troubleshooting, even if they are not a suitable solutions by themselves.


aaghaei
Captain II
Forum|alt.badge.img+10
  • Author
  • Captain II
  • May 27, 2025

@andriitkachenko Sure thing pal, I always appreciate the brainstorming and 100% agree with you. Cheers and thanks. Let see what support has to say.


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • July 3, 2025

Hi ​@aaghaei were you able to find a solution? Thank you!


aaghaei
Captain II
Forum|alt.badge.img+10
  • Author
  • Captain II
  • Answer
  • July 5, 2025

Hi ​@Chris Hackett 

unfortunately I couldn’t get much of help from the dev support. We ended up extending on EPApprovalList instead of EPApprovalAutomation and copy the methods of ApprovalAutonation to our class. Anyways we meant to override most of the methods and handlers. Not clean but works.