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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

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

rborse
5-Regular Member

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?

3 REPLIES 3
PaiChung
22-Sapphire I
(To:rborse)

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.

cbuse
12-Amethyst
(To:rborse)

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();
}

rborse
5-Regular Member
(To:cbuse)

Thanks a lot! It worked for me.

Top Tags