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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Change revision by code

VasiliyRepecki
12-Amethyst

Change revision by code

Hi.

How can i change WTPart revision by code?

I need something lika that:

from A.* to B.1;

from B.* to C.1;

from C.* to D.1

and so on.

* - any number.

Thanks.

ACCEPTED SOLUTION

Accepted Solutions

Following code works on 9.1 M40

Versioned reviseObj(final Versioned versioned){

Versioned newVersioned = null;

try {

newVersioned = wt.vc.VersionControlHelper.service.newVersion(versioned);

wt.fc.PersistenceHelper.manager.store(newVersioned);

} catch (WTPropertyVetoException e) {

e.printStackTrace();

} catch (WTException e) {

e.printStackTrace();

}

return newVersioned;

}

View solution in original post

2 REPLIES 2
sad
12-Amethyst
12-Amethyst
(To:VasiliyRepecki)

Hi,

I have tried version changes directly in database using the SQL script given below:

SQL script for changing WTPart Version from A.2 to B.1

update WTPART set VERSIONIDA2VERSIONINFO='B', VERSIONSORTIDA2VERSIONINFO='0000011', ITERATIONIDA2ITERATIONINFO='1' where ida2a2 in (select P.IDA2A2 from WTPART P, WTPARTMASTER M where P.IDA3MASTERREFERENCE=M.IDA2A2 and P.VERSIONIDA2VERSIONINFO='A' and P.ITERATIONIDA2ITERATIONINFO='2' and M.WTPARTNUMBER='12345');

You can also try the above method, if the number of records is limited.

Following code works on 9.1 M40

Versioned reviseObj(final Versioned versioned){

Versioned newVersioned = null;

try {

newVersioned = wt.vc.VersionControlHelper.service.newVersion(versioned);

wt.fc.PersistenceHelper.manager.store(newVersioned);

} catch (WTPropertyVetoException e) {

e.printStackTrace();

} catch (WTException e) {

e.printStackTrace();

}

return newVersioned;

}

Announcements


Top Tags