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

info(strFmt - question

(0) ShareShare
ReportReport
Posted on by 18

Hello

In one of our jobs in AX2012 R3, there is this part (when we e.g. cancel a line in a purchase order) with "info(strFmt("%1 - %2", PurchLine.RemainPurchPhysical, PurchLine.RemainInventPhysical)); ".

What does "%1 - %2" mean here?

If there are several fields that you want to correct in the table "Salesline", should you eg write "%1 - %4" etc.?

regards Andreas

  • Martin Dráb Profile Picture
    231,723 Most Valuable Professional on at
    RE: info(strFmt - question

    Please mark the helpful reply, or replies, as the verified answer. This is done by clicking Did this answer your question? > Yes at the reply.

  • BCC Profile Picture
    18 on at
    RE: info(strFmt - question

    Thanks, then I understand a little more how this works :)

  • Jeson Profile Picture
    120 on at
    RE: info(strFmt - question

    Hi, "%" means correspond to the value of the variables or fields before the commas, see the illustration below;

     pastedimage1662622673835v1.png

    so it means if you want more to be display you just add more "%" with its corresponding values before the commas

    Example:

    var1 = 1

    var2 = 2

    var3 = 3

    var4 = 4

    var5 = 5 

    info(strfrmt("%1 - %2 - %3 - %4 - %5", var1,var2,var3,var4,var5));

    so the displayed info will be 1 - 2 - 3 - 4 - 5  

  • Suggested answer
    Komi Siabi Profile Picture
    12,772 Most Valuable Professional on at
    RE: info(strFmt - question

    Hi BCC,

    % in strFmt simply stands as a placeholder for your values(arguments).

    So, you have strFmt (str, values).

    %1 = PurchLine.RemainPurchPhysical

    %2 = PurchLine.RemainInventPhysical

    You could decide to have a 3rd value, say the Recid, then you would have

    %3 = PurchLine.recid

    istrFmt("%1 - %2 %3 ", PurchLine.RemainPurchPhysical, PurchLine.RemainInventPhysical,PurchLine.recid))

  • Danial47 Profile Picture
    142 on at
    RE: info(strFmt - question

    Hi,

    When you use strfmt function then you can pass parameters to the text that would be printed in info.

    In your case, %1 is equal to PurchLine.RemainPurchPhysical and %2 is equal to PurchLine.RemainInventPhysical.

    for more clarification you can use this:

    info(strFmt("RemainPurchPhysical = %1 - RemainInventPhysical=%2", PurchLine.RemainPurchPhysical, PurchLine.RemainInventPhysical)); ".

    BR.

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,865 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,723 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans