Hi all,
I want to get label to another language.
Table name : WorkflowTrackingStatusTable
Field name : DocumentType
As i mentioned above documentType field list of tableid name store in the WorkflowTrackingStatusTable table.
Now, i want to get tableid name to another language.
I.e
EN-us : project
Ar, Fr,,,,, blah blah...
I tried below code let me know what am I doing wrong here.
SysWorkflowTracking tracking = SysWorkflowTracking::construct();
SysDictTable sitc = new SysDictTable(tracking.parmContextTableId());
Info(strFmt("%1", sitc.label()));
Thanks
waytod365, your code is difficult to read, because you pasted it in a wrong way. Please always use Insert > Code in the rich formatting view.
Your code doesn't return any value at all, therefore it can't return null either. What do you mean by that. Does it put an empty string to infolog, or throw an exception?
What did you find when you debugged the code? Is labelId2String() called with the expected value?
Try using labelId2String2 instead of labelId2String.
Get the labelId in the variable and then pass the labelId as mentioned in the below blow with "@" symbol.
Refer to the below blog.
http://www.fourone.se/blog/2007/11/01/get-label-value-in-different-languages/
Thanks,
Girish S.
Hi Girish,
It's not working as expected.
WorkflowTrackingStatusTable trackingStatusTable;
Trans trans = Trans::find("TUSMF-000001");
DictTable dict;
select firstonly trackingStatusTable
where trackingStatusTable.ContextRecId == trans.RecId
&& trackingStatusTable.ContextTableId == tableNum(Trans);
dict = new DictTable(trackingStatusTable.ContextTableId);
Info(strFmt("%1", SysLabel::labelId2String(dict.label(), 'Ar')));
As i mentioned above code return null.
Note : Trans table has label : @SYS3820
You can do something like below.
WorkflowTrackingStatusTable trackingStatus; DictTable dict; select * from trackingStatus; dict = new DictTable(trackingStatus.ContextTableId); SysLabel::labelId2String(literalstr(dict.label()), 'AR');
Thanks,
Girish S.
Thanks for your reply Girish,
Yes! I want to get the label 'DocumentType'
But, in the WorkflowTrackingStatusTable table list of table name label store to documentType.
Thanks for your reply Martin sir,
SysLabel::labelId2String2(DocumentType, 'fr')
LabelId2string2 we can only pass labelId.
Please, give me a example sir.
Thanks
It seems that you know how to get a label ID, but not how to get the label text in a different language. You can do it with SysLabel::labelId2String2(), for example.
Hi waytod365,
Do you want to get table label present in the WorkflowTrackingStatusTable in specified language?
Also, ContextTableId will be the field that will be storing the tableId in WorkflowTrackingStatusTable.
Thanks,
Girish S.
André Arnaud de Cal...
292,160
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156