Labels can contain line breaks. For example, “Text1\nText2” (let it has ID @LBL1).
However, if you’ll try to display this label “as is”, the result will be not expected:
Box::info("@LBL1");
Gives
To get the expected message with line break strFmtLB() method should be used:
Box::info(strFmtLB("@LBL1"));
Gives
Another great tip. Thanks!
ReplyDeleteVery useful
ReplyDeleteVery useful and thanks very much.
ReplyDeletedoesn't work in AX2009
ReplyDeleteThanks works in AX 2012.
ReplyDeleteObrigado! Thanks! From Brazil.
ReplyDeleteVery nice
ReplyDeleteIs it Possible to break lines for labels in other objects like forms,tables etc?
ReplyDeleteDoes work in AX 2009, see the message info line in my code, this works really well cheers Stasiak
ReplyDeletestatic void TBP_SS_DialogSampleCode(Args _args)
{
Dialog dialog;
DialogField fieldSalesOrder;
DialogField fieldQty;
DialogButton dialogBut;
str message;
str messageInfo;
str messageSO;
str messageQty;
;
dialog = new Dialog("SalesOrder_Qty_Change");
message = "";
dialog.addText("Enter the Sales Order");
fieldSalesOrder = dialog.addFieldValue(typeId(Description),
message, "SO", "SO & Qty");
dialog.addText("Enter the revised Qty");
fieldQty = dialog.addFieldValue(typeId(Description),
message, "Qty", "SO & Qty");
dialog.run();
if (dialog.closedOk()
&& (fieldSalesOrder.value() != "")
&& (fieldQty.value() != ""))
{
messageSO = "Entered Sales Order " + fieldSalesOrder.value();
messageQty = "Entered A QTY Of " + fieldQty.value();
messageInfo = messageSO + "\n" + messageQty;
dialogBut = Box::yesNoCancel(messageInfo, DialogButton::No, "Message");
if (dialogBut == DialogButton::No)
{
info(strfmt( "The No button was clicked."));
}
if (dialogBut == DialogButton::Yes)
{
info(strfmt("Sales Order " + strfmt(fieldSalesOrder.value())));
info(strfmt("Sales Order QTY " + strfmt(fieldQty.value())));
}
}
else
{
if (fieldSalesOrder.value() == "")
{
error("No Sales Order Value");
warning("You must Enter a Valid SO");
}
if (fieldQty.value() == "")
{
error("No Sales Ordsdr QTY Value");
warning("You must Enter a Valid Qty");
}
}
}
HI,
ReplyDeleteI have a small issue, can you please help me. I have a code like below, the output shows in single line. I want to show in seperate lines.Please help me. I tried it all ways like \r\n and strFmtLB Thanks in advance.
static void XMLReadVendorList(Args _args)
{
XMLDocument doc;
XMLNode nodeRoot,
nodeRecID,
nodeCreatedDateTime,
nodeVendGroup,
nodeVendAc,
nodeCompanyID,
nodePurchaseOrderNum,
nodePurchaseOrderCreatedDateTime,
nodeVendorName,
nodeUnitPrice;
XMLParseError xmlError;
int i;
doc = new XMLDocument();
doc.load("C:\\Result.xml");
xmlError = doc.parseError();
if(xmlError && xmlError.errorCode() != 0)
{
throw error(strFmt("Error: %1",xmlError.reason()));
}
nodeRoot = doc.documentElement();
nodeRecID = nodeRoot.selectSingleNode("//IDENTITY_KEY_");
nodeCreatedDateTime = nodeRoot.selectSingleNode("//DATE_TIME_");
nodeVendGroup = nodeRoot.selectSingleNode("//VENDOR_TYPE_");
nodeVendAc = nodeRoot.selectSingleNode("//VENDOR_NO_");
nodeCompanyID = nodeRoot.selectSingleNode("//COMPANY_ID_");
nodePurchaseOrderNum = nodeRoot.selectSingleNode("//ORDER_NO_");
nodePurchaseOrderCreatedDateTime = nodeRoot.selectSingleNode("//ORDER_DATE_");
nodeVendorName = nodeRoot.selectSingleNode("//CUSTOMER_NAME_");
nodeUnitPrice = nodeRoot.selectSingleNode("//VENDOR_ACTL_COST_");
info(("nodeRoot.text()"));
}
شركة كشف تسربات الغاز بالرياض
ReplyDeleteشركة كشف تسربات المياه بالرياض
افضل شركة كشف بالرياض
افضل شركة كشف بالرياض
شركة تنظيف بالرياض
شركة كشف تسربات بالرياض
شركة كشف تسربات الغاز بالرياض
شركة نقل اثاث خارج الرياض
تسليك بالرياض
شركة تنظيف بالرياض
شركة تنظيف بيوت بالرياض
شركة تنظيف منازل بالرياض
شركة تنظيف كنب بالرياض
شركة رش شمال الرياض
شركة كشف تسربات الغاز بالرياض
شركة كشف تسربات المياه بالرياض
شركة كشف بالرياض
Embedded system training in chennai
ReplyDeleteBest Embedded system training in chennai
Embedded training in chennai
Embedded system training institute in chennai
Embedded system
Embedded training
Embedded system courses in chennai
Matlab training in chennai
Arduino training in chennai
Autocad training in chennai
Best embedded training in chennai
Continue to Perbiki his blog to get a good blog !!
ReplyDeletePengobatan Varises dengan Bahan Alami
Obat Radang Dinding Rahim
Obat Penyakit Miom dan Kista
Obat Penyakit Sembelit