Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

SysWorkflowTracking label

(0) ShareShare
ReportReport
Posted on by 351

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 

  • Martin Dráb Profile Picture
    Martin Dráb 230,962 Most Valuable Professional on at
    RE: SysWorkflowTracking label

    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?

  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: SysWorkflowTracking label

    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.

  • waytod365 Profile Picture
    waytod365 351 on at
    RE: SysWorkflowTracking label

    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

  • Suggested answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: SysWorkflowTracking label

    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.

  • waytod365 Profile Picture
    waytod365 351 on at
    RE: SysWorkflowTracking label

    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 

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,962 Most Valuable Professional on at
    RE: SysWorkflowTracking label

    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.

  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: SysWorkflowTracking label

    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.

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,160 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