Skip to main content

Notifications

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
    Martin Dráb 230,962 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
    BCC 18 on at
    RE: info(strFmt - question

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

  • Jeson Profile Picture
    Jeson 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
    Komi Siabi 12,759 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
    Danial47 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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

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

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,162 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans