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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Is it possible to set/update the modified by attribute on the object with out iterating using api?

NP_10570407
8-Gravel

Is it possible to set/update the modified by attribute on the object with out iterating using api?

SessionHelper.manager.setPrincipal(strModifier);
		
		System.out.println("Current session user :- " + SessionHelper.manager.getPrincipal().getName());
		
		
		//check out part
		epmDocument = (EPMDocument) WorkInProgressHelper.service.checkout(epmDocument,WorkInProgressHelper.service.getCheckoutFolder(),"").getWorkingCopy();
		
		WTUser modifer = OrganizationServicesHelper.manager.getAuthenticatedUser(strModifier);
		VersionControlHelper.setIterationModifier((Iterated)epmDocument, WTPrincipalReference.newWTPrincipalReference(modifer));
        
		//check in part
		WorkInProgressHelper.service.checkin(epmDocument ,"checkedin");

So A.1 is before the change of "modified by" and A.2 is after the "modified by".

I changed the modified by using api by  doing checked in+ checked out simultaneously.

Above is a snippet of the code i used:

 

 

3 REPLIES 3

WorkInProgressHelper will certainly iterate. Have you tried just using PersistenceHelper, making the modification and saving? 

can you give the syntax according to persistanceHelper?

https://www.ptc.com/en/support/article/CS197332?source=search

This is a bit out of date but should get you started. 

Top Tags