web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Use of ForceLiterals, ForcePlaceholders

(0) ShareShare
ReportReport
Posted on by

Hi All,

can someone explain the use of ForceLiterals, ForcePlaceholders  keywords in AX. 

When should we use these keywords?

Regards,

Nunna.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Nunna,

    In order to use these keywords, you should have a good understanding of SQL execution plans and option clause.  There are many good blog posts which explains these concepts: here are some good reads.

    https://fredshen.wordpress.com/2006/01/02/forceliterals-forceplaceholders/

    http://www.databaseskill.com/675246/

    We do not see extensive use of these keywords in AX. If you scan the AOT you might find only couple of instances where these keywords are used for example :

    \Classes\ReleaseUpdateDB60_Ledger\updateTaxTransGeneralJournalAccountEntry()

    \Data Dictionary\Tables\ReqTrans\Methods\bulkInitFromInventTransOrigin()

    Unless you have a very good understanding of SQL server execution plans , leave it to the SQL server to select it's own plan as SQL server query optimizer may pick a plan that is targeting to return a few rows quickly, rather than a plan that will minimize the total result set retrieval.

    Hope this help.

  • Suggested answer
    Community Member Profile Picture
    on at

    Please review following link for most comprehensive details

    msdn.microsoft.com/.../aa656402.aspx

    forceLiterals and forcePlaceholders are mutually exclusive.

    please verify and update us if this helps you

  • Suggested answer
    Community Member Profile Picture
    on at

    As per MSDN documents you are not advised to use ForceLiterals keywords as it may expose code to an SQL Injection threat. It reveals physical values of where clause.

    ForcePlaceholders  hide physical values, moreover its default parameter.

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…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Volodya Profile Picture

Liquid error: Object of type 'Adxstudio.Xrm.Web.Mvc.Liquid.EntityReferenceDrop' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Volodya 2

#2
tgudwanski Profile Picture

Liquid error: Object of type 'Adxstudio.Xrm.Web.Mvc.Liquid.EntityReferenceDrop' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. tgudwanski 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans