Skip to main content
10-Marble
May 22, 2023
Solved

Creating a Save-as-History link

  • May 22, 2023
  • 1 reply
  • 2862 views

How to create a Save-as-History link between two WTDocuments in windchill12.1?

Which api should I use to create a link between two WTDocuments?

 

 

 

Best answer by Naga_2000

Hi @HelesicPetr 

 

That report issue not allowing to finish the migration. Anyway, it was replaced by ConfigurableLinks and its working fine.

 

Thanks

 

1 reply

HelesicPetr
22-Sapphire II
22-Sapphire II
May 23, 2023

Hello @Naga_2000 

You need to know the type of object you want to create.

In this case MadeFromLink

 

create the link set the objects and preferences then save the link

 

MadeFromLink saveAsRow = new MadeFromLink();
saveAsRow.setOriginal(originalDocument);
saveAsRow.setCopy(newObjectDocument);

PersistenceHelper.manager.store((Persistable) saveAsRow);

 

hope this can help. 

 

PetrH

Naga_200010-MarbleAuthor
10-Marble
May 24, 2023

Hi @HelesicPetr 

 

This API is unsupported in latest version. In Eclipse or any IDE, it will show that API. But when you check in the javadoc for the version 12.1.2.0, the API MadeFromLink is not available in that javadoc.

 

Thanks,

Naga

HelesicPetr
22-Sapphire II
22-Sapphire II
May 24, 2023

Hi @Naga_2000 

 

Where is problem? do you want to create history link? 

Use it. 

The object MadeFromLink is also table in database, where the information is stored and I do not believe that PTC would change the table to an another one in a new release to store same history information just in new table. .

 

If you can't find API to create history link in the JavaDoc then you can not create history link by supported API.  

 

PS> supported API means that the API will not be changed in the future and customers can use it without any future compatibility issue.

But PTC can use any API in the application even though it is not supported by javaDoc

 

PetrH.