如何在 Dynamics AX 中创建简单的对话框?

发布于 2024-10-06 11:12:34 字数 35 浏览 0 评论 0原文

如何在 Dynamics ax 中创建一个简单的对话框?

How can you create a simple dialog box in Dynamics ax?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

内心荒芜 2024-10-13 11:12:35
static void DialogSampleCode(Args _args)
{
    Dialog      dialog;
    DialogField field;
    ;
    dialog = new Dialog("My Dialog");
    dialog.addText("Select your favorite customer:");
    field = dialog.addField(typeid(CustAccount));

    dialog.run();
    if (dialog.closedOk())
    {
        info(field.value());
    }
}
static void DialogSampleCode(Args _args)
{
    Dialog      dialog;
    DialogField field;
    ;
    dialog = new Dialog("My Dialog");
    dialog.addText("Select your favorite customer:");
    field = dialog.addField(typeid(CustAccount));

    dialog.run();
    if (dialog.closedOk())
    {
        info(field.value());
    }
}
只有一腔孤勇 2024-10-13 11:12:35

对于非常简单的对话框,请使用 Box Class

    Box::info("your message");

    Box::warning("your message");

    if (Box::okCancel("continue?", DialogButton::Cancel) == DialogButton::Ok)
    {
        // pressed OK
        ...

或其他静态方法之一(infoOnceyesNoyesNoCancelyesAllNoAllCancel、.. .)

for really simple dialog boxes, use the Box Class:

    Box::info("your message");

or

    Box::warning("your message");

or

    if (Box::okCancel("continue?", DialogButton::Cancel) == DialogButton::Ok)
    {
        // pressed OK
        ...

or one of the other static methods (infoOnce, yesNo, yesNoCancel, yesAllNoAllCancel, ...)

半夏半凉 2024-10-13 11:12:35

DAX 2012 没有“typeid”作为方法。但是您可以使用 ExtendedTypeStr 然后传入已知的 EDT 或使用内置的字符串长度版本:

str getStringFromUser(str _prompt, str _title)
{
    str         userResponse = "";
    Dialog      dlg = new Dialog(_title);
    DialogField dlgUserResponse = dlg.addField(extendedTypeStr(String15), _prompt);

    // This prompts the dialog
    if (dlg.run())
    {
        try
        {
            userResponse = dlgUserResponse.value();
        }
        catch(Exception::Error)
        {
            error("An error occurred. Please try again.");
        }
    }
    return userResponse;
}

DAX 2012 does not have "typeid" as a method. But you can use extendedTypeStr and then pass in either a known EDT or use the built in string length versions:

str getStringFromUser(str _prompt, str _title)
{
    str         userResponse = "";
    Dialog      dlg = new Dialog(_title);
    DialogField dlgUserResponse = dlg.addField(extendedTypeStr(String15), _prompt);

    // This prompts the dialog
    if (dlg.run())
    {
        try
        {
            userResponse = dlgUserResponse.value();
        }
        catch(Exception::Error)
        {
            error("An error occurred. Please try again.");
        }
    }
    return userResponse;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文