web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Answered

Customized dialog control value

(1) ShareShare
ReportReport
Posted on by 55

Dear Community,

I have added a custom dialog control through x++ in a batch job. I wrote a post event handler method to add this to dialog form.

pastedimage1616726005431v1.png 

Now I want to get the value of this added dialog in another post event handler method. How can I achieve this???

Thank you in advance.

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    Please don't use pre- and post-method event handlers. They're fully replaced with CoC, which is much easier to use, it's safer and it gives you extract options.

    [ExtensionOf(classStr(ReqTransPoMarkFirm))]
    final class MyReqTransPoMarkFirm_Extension
    {
    	private DialogField myWarehouseField;
    	
    	public Object dialog()
        {
    		Dialog dialog = next dialog();
    		
    		if (reqTransPoMark.countMarkedElements() > 1)
    		{
    			myWarehouseField = dialog.addField(enumStr(AnEnumWithDescriptiveLabel));
    		}
    	}
    	
    	public boolean getFromDialog()
        {
    		// Do whatever you want with the value
    		... = myWarehouseField.value()
    		
    		return next getFromDialog();
    	}
    }

    By the way, it would have helped my if you shared your code as text. Please try to make it easier for people what want to help you. (Use Insert > Insert Code to preserve indentation when pasting code.)

    And why did you attach the tag "ax2012"? You also attached "D365" and you're asking in the D365FO forum, therefore I'm assuming that it's not about AX 2012.

  • Rashid Zaheer Profile Picture
    55 on at

    Thank you Martin for your help. I got the idea from you code and changed it according to my requirement and it worked.

    I didn't know about screenshot. I will take care in future.

    Yes it is not for Ax 2012, its for D365FO.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Siv Sagar Profile Picture

Siv Sagar 283 Super User 2025 Season 2

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 213 Super User 2025 Season 2

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 152 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans