Thursday, 18 July 2013

Increase a field value like workorder/jobplan taskid.

1. Create a seed name and seed interval in MAXVARS table.

For example : if you want as 10, 20, 30 40..etc
insert into MAXVARS (varname,varvalue,orgid,siteid,maxvarsid) values ('TESTSEED',10,NULL,'SITENAME',<MAXVARSID.NEXTVAL>);
insert into MAXVARS (varname,varvalue,orgid,siteid,maxvarsid) values ('TESTSEEDINTERVAL',10,NULL,'SITENAME',<MAXVARSID.NEXTVAL>);

For example : if you want as 5, 10, 15, 20..etc
insert into MAXVARS (varname,varvalue,orgid,siteid,maxvarsid) values ('TESTSEED',5,NULL,'SITENAME',<MAXVARSID.NEXTVAL>);
insert into MAXVARS (varname,varvalue,orgid,siteid,maxvarsid) values ('TESTSEEDINTERVAL',5,NULL,'SITENAME',<MAXVARSID.NEXTVAL>);

2. Write a mbo code to set value in 'TESTID' : <set default value of TESTID is 0>
Modify add() method of main MBO :

super.add();
int testID = this.getInt("TESTID");
int newTestID = CommonUtil.getNextTaskID(testID, "TESTSEED", "TESTSEEDINTERVAL", getOrgSiteForMaxvar("TESTSEED"));
this.setValue("TESTID",newTestID,MboConstants.NOACCESSCHECK);

Hope it will be usefull. :)


No comments:

Maximo SOAPUI error javax.xml.ws.WebServiceException

SOAPUI error while sending payload to below url (in cluster environment) http://localhost:9080/meaweb/services/MXASSET Error : <f...