Skip to main content

Notifications

Microsoft Dynamics AX (Archived)
Suggested answer

what is meant by forceliteral and force placeholder

(0) ShareShare
ReportReport
Posted on by 55

tell me what is meant by firstonly,firstfast,forceliteral,forceplaceholder.

*This post is locked for comments

  • Abishek_06 Profile Picture
    Abishek_06 165 on at
    RE: what is meant by forceliteral and force placeholder

    First Only:

         The word first only denotes to fetch first record only. Let me show an example with firstonly keyword and without firstonly keyword

    Example without Firstonly keyword:

    static void firstfind(Args _args)

    {

       SalesTable salestable;

       ;

        while select  * from salestable index hint CustIdx where salestable.CustAccount == "124578"

       info(strfmt("The output is %1",salestable.SalesName));

    }

    If you run the above code it will display all salesname based on condition(Equal To) mentioned . . Here you will get all the records as output that satisfy the condition.

    Example with Firstonly keyword:

    static void firstfind(Args _args)

    {

       SalesTable salestable;

       ;

        while select  firstonly * from salestable index hint CustIdx where salestable.CustAccount == "124578"

       info(strfmt("The output is %1",salestable.SalesName));

    }

    If you the run the above code it will all records based on condition(Equal to) mentioned and will return the first record from the condition satisfied. So you will get only one record as output.  

  • Suggested answer
    Re: what is meant by forceliteral and force placeholder

    These are hints and query modifiers that affect 1) which query plan a DBMS uses, 2) how AX creates queries. See also Select Statement Syntax

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

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,971 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,846 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans