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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

How to add default suffix to entity name?

SaiSameera
13-Aquamarine

How to add default suffix to entity name?

Hi,

I want to give entity name as TreeThing_abc where _abc is the suffix. Whenever I want to give the name for any entity, _abc should come by default and then I'll add the prefix name based on the entity that I create. Is there any possibility to get default name for entity name.

 

thanks

sameera

ACCEPTED SOLUTION

Accepted Solutions

You just need to use CreateThing snipped and add the desired sufix:

var sufix = "_mySufix";

Resources["EntityServices"].CreateThing({

  name: "myCustomName"+sufix,

 description: "",

  thingTemplateName: "GenericThing",

  tags: undefined

})

View solution in original post

6 REPLIES 6

Not with the Composer, but you can create a custom service in order to create entities and in this service add the suffix by the rules you desire, it's how we do it.

SaiSameera
13-Aquamarine
(To:CarlesColl)

Thanks CarlesColl

Is there any snippet to add suffix for entity name.

 

Thanks

sameera

You just need to use CreateThing snipped and add the desired sufix:

var sufix = "_mySufix";

Resources["EntityServices"].CreateThing({

  name: "myCustomName"+sufix,

 description: "",

  thingTemplateName: "GenericThing",

  tags: undefined

})

SaiSameera
13-Aquamarine
(To:CarlesColl)

Hi CarlesColl,

I'm able to create a thing with the suffix. But I want to get the suffix whenever I click on the name to create a thing or ThingTemplate or any entity.

That's what I said on my first answer that can't be done through the Composer.

tcoufal
13-Aquamarine
(To:SaiSameera)

You can create a Mashup utilizing your custom services. Then you can assign this mashup as your home mashup in your HelperThing. And access it simply by clicking on HomeMashup in EntityInformation section. 

Announcements


Top Tags