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 :
Microsoft Dynamics AX (Archived)

Dialog customized in SysOperationService class

(0) ShareShare
ReportReport
Posted on by 1,421

Hi all,

I need to create a customized dialog, developed with the SysOperationService framework. In particular, I must implement the following job (that open a dialog in "multiselect" mode):

static void multiselectField(Args _args)
{
    int             idx;
    int             cnt;
    boolean         result;
    System.String[] files;
    Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
 
    dlg.set_Multiselect(true);
    dlg.set_DefaultExt(".txt");
    dlg.set_Filter("Text documents|*.txt|All files|*.*");


    result = dlg.ShowDialog();
    if (result)
    {
        files = dlg.get_FileNames();
        cnt = files.get_Count();
        for (idx = 0; idx <= cnt; idx++)
        {
            info(files.get_Item(idx));
        }
    }
}

Where should I insert the code shown below? In the contract class?

Thanks in advance.

Giuseppe

*This post is locked for comments

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

    First consider the logical perspective - does this logic form a part of data contract? It doesn't. It belongs to the UI builder component.

    The other question is implementation. Either you will find a way how to inject your code to a UI builder class, or you'll have to create a new form in AOT and use it as the dialog. Look for controllers overriding templateForm() method, if you need an example of the latter approach.

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans