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
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.
Thanks, then I understand a little more how this works :)
Hi, "%" means correspond to the value of the variables or fields before the commas, see the illustration below;
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
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))
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.
André Arnaud de Cal...
292,162
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156