How to Create Part to Document link while creating part if I have entered document number in part .It will automatically link that document to part.

How to Create Part to Document link while creating part if I have entered document number in part attribute it may be text area attribute. It will automatically link that document to part.

Asked on January 30, 2020 in Windchill PLM.
Add Comment
1 Answer(s)

Hello Prasad

 

There are couple of ways you can do it

  • With the help of a custom form processor for create/update part form processor, which you can extend and override postprocess method which gets called after part is created, where you can have logic like this to create link between part and document

DescribeBy link between WTPart and WTDocument.

if ( !(checkInOutTaskLogic.isWorkingCopy(wtpart)) ){

workingcopyPart =(WTPart)WorkInProgressHelper.service.checkout((WTPart)wtpart,WorkInProgressHelper.service.getCheckoutFolder(),null).getWorkingCopy();

}

WTPartDescribeLink describeLink=WTPartDescribeLink.newWTPartDescribeLink(workingcopyPart,docObj);

describeLink = (WTPartDescribeLink)PersistenceHelper.manager.save(describeLink);

  • same API as above you can manage to add the logic in event listener services for POST_STORE event on Part and get the the document number from its attribute and create link
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.