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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Dialog Box Not opening

(0) ShareShare
ReportReport
Posted on by 454

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,160 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
    454 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,160 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

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans