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

Change part number by code

VasiliyRepecki
12-Amethyst

Change part number by code

Hi

Can anybody provide java code example for part (WTPart) number change?

Thanks.

ACCEPTED SOLUTION

Accepted Solutions
KD
12-Amethyst
12-Amethyst
(To:VasiliyRepecki)

Hi,

Try this,

I am not sure which of them will work.

WTPartMaster wpm = (WTPartMaster) part.getMaster();

WTPartMasterIdentity masterIdentity = (WTPartMasterIdentity) wpm.getIdentificationObject();

masterIdentity.setNumber("new number");

masterIdentity.setName("new name");

IdentityHelper.service.changeIdentity(wpm, masterIdentity);

WTPartMaster master = part.getMaster();

<Use the setter methods to change values >

<save the master using PersistenceHelper>

PersistenceHelper.manager.save(master);

WTPartHelper.service.changeWTPartMasterIdentity(part.getMaster(), name, number, localWTOrganization);

Thanks and Regards,

Kaushik

View solution in original post

1 REPLY 1
KD
12-Amethyst
12-Amethyst
(To:VasiliyRepecki)

Hi,

Try this,

I am not sure which of them will work.

WTPartMaster wpm = (WTPartMaster) part.getMaster();

WTPartMasterIdentity masterIdentity = (WTPartMasterIdentity) wpm.getIdentificationObject();

masterIdentity.setNumber("new number");

masterIdentity.setName("new name");

IdentityHelper.service.changeIdentity(wpm, masterIdentity);

WTPartMaster master = part.getMaster();

<Use the setter methods to change values >

<save the master using PersistenceHelper>

PersistenceHelper.manager.save(master);

WTPartHelper.service.changeWTPartMasterIdentity(part.getMaster(), name, number, localWTOrganization);

Thanks and Regards,

Kaushik

Announcements


Top Tags