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)

Method not getting executed when called from the main method.

(0) ShareShare
ReportReport
Posted on by

hi,

i have written the below code and on debugging, the first method is not being executed, its not executing the method definition but it is executing the second method and going inside its definition

class HSUpdateCardDetails

{

public static void main(Args _args)
{
str multipleFields;
SalesLine salesLineLoc;
HSUpdateCardDetails updateCardDetails = new HSUpdateCardDetails();
multipleFields = _args.parm();
salesLineLoc= _args.record();

updateCardDetails.getCardDetails(multipleFields); // This method is not getting executed. it is directly executing the below one.
updateCardDetails.validateCardDetails(salesLineLoc);
updateCardDetails.updateCardDetails();
}

void getCardDetails(str _multipleLineFields)
{

con = str2con(_multipleLineFields,",");
hSGiftNum = conPeek(con,3);
hSGiftCard = HSGiftCard::find(hSGiftNum, false);


discAmount = conPeek(con,1);

custAccount = conPeek(con,2);

}

void validateCardDetails(SalesLine _salesLine)
{
salesLine = _salesLine;
select firstonly giftCardTransIssue
where giftCardTransIssue.GiftCardNumber == hSGiftNum
&& giftCardTransIssue.Operation == HSOperation::Issue;

if (discAmount >= giftCardTransIssue.Amount)
{
throw error ("@HSMasterGiftCard:ErrorInsufficientAmount");
}
else
{
if (SalesLine.LineAmount < discAmount)
{
throw error("@HSMasterGiftCard:ErrorMessageDiscountAmount");
}
}
}

*This post is locked for comments

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

    Make sure your code is fully built. If it is, the method must execute, therefore the problem must be in how you identify whether it's executed or not. Please give us more information about the way how you debug it.

  • Suggested answer
    Alex Voytsekhovskiy Profile Picture
    on at

    Compile the class

    Incremental  CIL

    Close the client and delete *.auc Local cache files.

    Restart AOS.

    Full CIL

    Full application compilation

    Try all these steps one by one. There is no other magic

  • Martin Dráb Profile Picture
    239,257 Most Valuable Professional on at

    Note that the version tag is "current version", i.e. AX 7, therefore there is no separate step for CIL compilation and no .auc files.

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 26

#2
imran ul haq Profile Picture

imran ul haq 8

#3
André Arnaud de Calavon Profile Picture

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

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans