How to expand the dialog box

I would like to rewrite the dialog screen that appears when updating the header information (e.g., Delivery address) on a purchase order.
Specifically, I would like to change the standard wording and selections that are displayed.

How can this be implemented?

Thanks for your help.

The first step is finding the current implementation. For example, open Label search and find labels containing Update delivery address on purchase. It’ll find a single one; right-click it and choose Find references.

In the Find Symbol Results window, you’ll see a single reference: to promptCopyDeliveryAddress() method on PurchTable table. Right-click it and choose Go To Reference to open the code.

You’ll see this:

static DialogButton  promptCopyDeliveryAddress()
{
    return Box::yesYesAllNoCancel("@SYS89799", DialogButton::Yes);
}

The method is extensible, but it’s not replaceable, therefore you can’t prevent the call of Box::yesYesAllNoCancel() and replace it with something else.
If you look at where the method is called from, you’ll see you can’t prevent it there either.

At this moment, I’d consider again the actual business requirement. Maybe there is a different way how to address the business problem.

If not, you have the only option. Think about how you’d like the standard code to change and then create an extensibility request, where you’ll document your reasons and the suggested change.

Hi MartinDrab, Can u tell me how to identify the method as [Replaceable], I tried looking in the method properties but it doesn’t seem to be mentioned there.
Thank u very much, have a nice day.

The square brackets mean that it’s an attribute; you’d see it in code just above the method header.

You can find examples in standard code by using Find references on ReplaceableAttribute class. Here is one of them:

[Replaceable]
protected void deleteProdBOM(ProdBOMSearch _search)
{
    _search.prodBOM().delete();
}
1 Like

Hi MartinDrab, thanks for the response…

I have one more question, is there any way to auto click the Cancel button on the Dialog.
I am extending promptCopyDeliveryAddress() to create my own custom dialog.
I tried to find the ControlName of the dialog to use FormCommandButtonControl.clicked() but couldn’t find it.
Do you have any keywords or suggestions for me?
Thanks again.

I don’t see how extending promptCopyDeliveryAddress() can solve your problem. Make sure test it before investing time to such an approach.

Regarding the Cancel, I would need to know more about how you’ve implemented the dialog. Because it a different topic than How to expand the dialog box, please create a new thread for it (after you verify that your design is otherwise feasible).

At first, I planned that after calling the system promptCopyDeliveryAddress(), I would set the default button to Cancel and press it to hide the standard dialog. Then I would extend it and write my custom dialog.
However, while researching, I found that selecting the buttons on that dialog is impossible, so I will try to find another solution.


System-defined buttons - Finance & Operations | Dynamics 365

Thanks for your feedback.

The documentation page is about a completely different thing, but anyway, I agree that your design wasn’t feasible.

1 Like