Skip to main content
8-Gravel
May 6, 2024
Solved

Custom attributes Folder via API

  • May 6, 2024
  • 2 replies
  • 1962 views

Version: Windchill 13.0

 

Use Case: We want to add some custom attributes to folders that we will need to modify during in certain cases.


Description:

Hello everyone,
I wanted to know if there is a way to make it possible to modify custom attributes for folders via API cause I'm having problem with a customization since I'm able to access only to the default "Description" attribute.
Thank you in advance

Best answer by HelesicPetr

Hi @AK_10639313 

Additional info.

Sometimes It is very useful to check the JavaDoc documentation to understand what the service can do.

HelesicPetr_1-1715328958811.png

HelesicPetr_0-1715328920273.png

PetrH

2 replies

HelesicPetr
22-Sapphire II
22-Sapphire II
May 6, 2024

Hi @AK_10639313 

Try the persistable adapter and PersistenceHelper

 

 

PersistableAdapter folderObj = new PersistableAdapter(persist, null, null, null);
folderObj.load("IBANAME", "name");
folderObj.set("IBANAME", "my value");
Object obj = folderObj.apply();
PersistenceHelper.manager.store(obj);

 

example also mentioned in https://www.ptc.com/en/support/article/CS149150?

 

replaced old api with new one> https://www.ptc.com/en/support/article/CS138252

 

PetrH

8-Gravel
May 10, 2024

Sorry for the late reply and thank you a lot for sharing a possible solution,
I tried to do as you said but it didn't apply the changes on the attributes of the folder.

HelesicPetr
22-Sapphire II
22-Sapphire II
May 10, 2024

Hi @AK_10639313 

You need to find a reason, why the change has not been stored(saved)

PetrH

Community Moderator
May 10, 2024

Hello @AK_10639313

 

It looks like you have a response from a community member. If it helped you solve your question please mark the reply as the Accepted Solution. 

Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,
Community Moderation Team.