cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I fetch token from specific Localization Table programatically through extension SDK in twx?

Highlighted
Level 6

How can I fetch token from specific Localization Table programatically through extension SDK in twx?

I am trying to fetch token from specific Localization Table (i.e. only from the Localization Table named as  "es") through the extension SDK in thingworx.

I am using "com.thingworx.localization.LocalizationTable.GetToken" api. But it always returns the token value from the "Default" Localization Table. I also tried  "com.thingworx.localization.LocalizationTable.setName" api to set the name of the expected Localization Table but it didn't worked.

Can I get any code reference in java?

Tags (1)
3 REPLIES 3

Re: How can I fetch token from specific Localization Table programatically through extension SDK in

You can call against the table directly.

So within Thingworx it would be LocalizationTables["es"].GetToken{params}

sorry not sure how that would translate into the SDK

I don't think there is a service that allows you to do that by doing a call that specifies the actual localization table you want it from.

Re: How can I fetch token from specific Localization Table programatically through extension SDK in

The Java code should look like this:

LocalizationTable esLocalizationTable = (LocalizationTable)EntityUtilities.findEntity("es", RelationshipTypes.ThingworxRelationshipTypes.LocalizationTable);
try {
  String valueToken = esLocalizationTable.GetToken("yourtoken");
} catch (Exception e1) {
   e1.printStackTrace();
}

Re: How can I fetch token from specific Localization Table programatically through extension SDK in

Thanks a lot! It worked for me.