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

questions about main method .run();

(0) ShareShare
ReportReport
Posted on by

Hello Everyone .

static void main(Args _args)
{
a_CustSelect custSelect = new a_CustSelect();
if (CustSelect.prompt())
{
CustSelect.run();
}
}


here is 2 questions

first one 

CustSelect.run();

in C# in main method we give main method startup point like a form in run(main form)

here which method will run after main method  

class CustSelect extends RunBase
{
DialogField fieldAccount;
DialogField fieldName;
DialogField fieldGroup;
DialogField fieldCurrency;
DialogField fieldPaymTermId;
DialogField fieldPaymMode;
}
container pack()
{
return conNull();
}
boolean unpack(container _packedClass)
{
return true;
}
protected Object dialog()
{
Dialog dialog;
DialogGroup groupCustomer;
DialogGroup groupPayment;
dialog = super();
dialog.caption("Customer information");
dialog.allowUpdateOnSelectCtrl(true);
fieldAccount = dialog.addField(
extendedTypeStr(CustAccount),
"Customer account");
fieldName = dialog.addField(extendedTypeStr(CustName));
fieldName.enabled(false);
dialog.addTabPage("Details");
groupCustomer = dialog.addGroup("Setup");
fieldGroup = dialog.addField(
extendedTypeStr(CustGroupId));
fieldCurrency = dialog.addField(
extendedTypeStr(CurrencyCode));
fieldGroup.enabled(false);
fieldCurrency.enabled(false);
groupPayment = dialog.addGroup("Payment");
fieldPaymTermId = dialog.addField(
extendedTypeStr(CustPaymTermId));
fieldPaymMode = dialog.addField(
extendedTypeStr(CustPaymMode));
fieldPaymTermId.enabled(false);
fieldPaymMode.enabled(false);
return dialog;
}
void dialogSelectCtrl()
{
CustTable custTable;
custTable = CustTable::find(fieldAccount.value());
fieldName.value(custTable.name());
fieldGroup.value(custTable.CustGroup);
fieldCurrency.value(custTable.Currency);
fieldPaymTermId.value(custTable.PaymTermId);
fieldPaymMode.value(custTable.PaymMode);
}
static void main(Args _args)
{
CustSelect custSelect = new CustSelect();
if (CustSelect.prompt())
{
CustSelect.run();
}
}

Second question is 

if (CustSelect.prompt())

also in C# always there are 2 operators like if(value1 == value2)
here what it means by one operator

thank you

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    239,163 Most Valuable Professional on at

    As in C#, main() is the entry point, so the question "which method will run after main" doesn't make a good sense. You should look at which methods you execute inside main, or - if you call main() from another method - which methods you call after main(). There is no magic that would call something for you.

    I have no idea what you mean by "also in C# always there are 2 operator like if(value1 == value2) here what it means".

  • Community Member Profile Picture
    on at

    if i call it from menu item which method will run 

  • Community Member Profile Picture
    on at

    about operators

    some time if be like this

    if (CustAccount)

    does it means if CustAccount found !!

  • Verified answer
    Martin Dráb Profile Picture
    239,163 Most Valuable Professional on at

    if (CustAccount) is true if CustAccount isn't equal to the default value of the data type, which is an empty string ("") for the str.

  • Community Member Profile Picture
    on at

    Thank you

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

#1
CP04-islander Profile Picture

CP04-islander 16

#2
GiacomoRovai Profile Picture

GiacomoRovai 4

#3
Douglas Noel Profile Picture

Douglas Noel 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans