Skip to main content
12-Amethyst
January 8, 2026
Solved

How to set a comment (chekin note) by SaveAs of a WTPart per API

  • January 8, 2026
  • 2 replies
  • 145 views

Version: Windchill 13.0

 

Use Case: In our customization, we use the SaveAsHelper class to duplicate some WTPart (and structure) and would like to "tag" the function used by setting a comment on the new WTPart, for example: "created by Copy Machine". Then it would be easier to track whether the SaveAs menu of Windchill was used or if the customization was used.


Description:

I cannot find a mean to set this comment/note on an pass it the the SaveAs function. 

I have tried setting "iterationInfo.note" as attribute in the SaveAsObjectInfo, but without success (nor error message).

 

 final HashMap<RevisionControlled, AbstractSaveAsObjectInfo> saveAsObjects = new HashMap<>();
 for (WTPart wtPart : partsToCopy) {
 final AutoNumberingHelper helper = new AutoNumberingHelper(containerRef);
 final String newPartNumber = helper.getNumber(wtPart.getTypeDefinitionReference());
 final Map<String, String> ibas = new HashMap<>();
 // checkin Comment I try to set, but this has no visible effect.
 ibas.put("iterationInfo.note", "created by Copy Line & Machines"); 
 final AbstractSaveAsObjectInfo info = new PartSaveAsObjectInfo(newPartNumber, wtPart.getName(), folder,((WTContainer) containerRef.getObject()).getOrganization(), wtPart.getView(), null, ibas);
 saveAsObjects.put(wtPart, info);
 }

 final SaveAsHelper saver = new SaveAsHelper(saveAsObjects, null);
 saver.checkConflicts();
 saver.invokeSaveAsPreActionEvent();
 final Map<RevisionControlled, RevisionControlled> saveAsResult = saver.saveAs();

  Does someone have an Idea how to set the comment on the new object? 

Best answer by rkassmeyer

I thought comments were part of the Check-In process, have you looked there?

2 replies

lmouchard12-AmethystAuthor
12-Amethyst
January 8, 2026

Let's have a try with the methods of EnterpriseService instead of SaveAsHelper... It allows to copy the object (but not save them), modify, them save them. 

lmouchard12-AmethystAuthor
12-Amethyst
January 8, 2026

followed https://www.ptc.com/en/support/article/CS59135?source=search, but there are still other fields to set (Domain?) for the SaveAs to work.

12-Amethyst
January 8, 2026

I thought comments were part of the Check-In process, have you looked there?

lmouchard12-AmethystAuthor
12-Amethyst
January 8, 2026

Hi, yes, the comment is usually filled by checkout/checkin.

I find it a pity to first create some objects using SaveAs, then force a checkout/checkin only to set a comment explaining why (or how in my case) the object was created... I guess it is the way to go. 🙄