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

  • nmaenpaa Profile Picture
    101,156 Moderator on at
    RE: Dialog Box Not opening

    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.

  • Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: Dialog Box Not opening

    Hi Ram,

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

  • Ram Kumar Profile Picture
    454 on at
    RE: Dialog Box Not opening

    Hi Gunjan,

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

    Regards,

    Ram

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: Dialog Box Not opening

    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.

  • Suggested answer
    nmaenpaa Profile Picture
    101,156 Moderator on at
    RE: Dialog Box Not opening

    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. 

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,884 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,760 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans