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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Dialog Box Not opening

(0) ShareShare
ReportReport
Posted on by 456

Hi,

I have extended runbase class for creating dialog box. But when i run the code dialog box is not opening. Here is my code 

class CustCreateDialog extends RunBase
{
    DialogField fieldAccount;
    DialogFIeld fieldGroup;

    CustTable   custTable;
    CustTrans   custTrans;
    CustAccount custAccount;
    CustGroupId custGroup;
}

--------------------------------------------------------------------------------------------------------------------------

protected Object Dialog()
{
    Dialog dialog;
    ;

    dialog = super();

    // Set a title for dialog
    dialog.caption( 'Simple Dialog');

    // Add a new field to Dialog
    fieldGroup   =  dialog.addField(extendedTypeStr(CustGroupId), 'Customer Group');
    fieldAccount = dialog.addField(extendedTypeStr(CustAccount),'Customer account');

    return dialog;
}

-------------------------------------------------------------------------------------------------------------------------

public boolean getFromDialog()
{
    // Retrieve values from Dialog
    custAccount = fieldAccount.value();
    custGroup   = fieldGroup.value();
    return super();
}


-------------------------------------------------------------------------------------------------------------------------

public void run()
{
    while select AccountNum, CustGroup from custTable
        where custTable.AccountNum == custAccount
            && custTable.CustGroup == custGroup
        join Voucher, AmountCur, TransDate from custTrans
            where custTrans.AccountNum == custTable.AccountNum
       
    if (custTable)
    {
        // Shows retrieved information
        info( strFmt('%1 -- %2 -- %3 --- %4 ---%5' , custTable.AccountNum, custTable.name(), custTrans.Voucher, custTrans.AmountCur, custTrans.TransDate));
    }
    else
    {
        error( 'Customer Account not found!');
    }
}

--------------------------------------------------------------------------------------------------------------------------

public static void main(Args _args)
{
    CustCreateDialog custCreate = new CustCreateDialog();

    // Prompt the dialog, if user clicks in OK it returns true
    if (custCreate.prompt())
    {
        custCreate.run();
    }
}

Regards,

Ram

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,172 Moderator on at

    How do you run it? To me your code looks ok. But you shared only parts of it. 

    Check Tutorial_RunBaseBatch, it's a working example. 

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Ram,

    Have you implemented the pack and unpack methods as well?

    Please check this link and try this code. Please do a CIL as well after your code change.

  • Ram Kumar Profile Picture
    456 on at

    Hi Gunjan,

    I have used pack and unpack methods also. But its not working

    Regards,

    Ram

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Ram,

    Did you do a CIL generation? Did you try to debug and find if the dialog method is being called?

  • nmaenpaa Profile Picture
    101,172 Moderator on at

    Also, could you share the full source code of your class? This way it would be easier for us to help understanding what's wrong with it.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 632 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 624

#3
CP04-islander Profile Picture

CP04-islander 301

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans