web
You’re offline. This is a read only version of the page.
close
Skip to main content
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

I have the same question (0)
  • 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.

  • Suggested answer
    Komi Siabi Profile Picture
    13,049 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))

  • 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  

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

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

  • Martin Dráb Profile Picture
    236,394 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.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,004

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 857 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 548 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans