Automation script is needed On Maximo , How Pass GLDEBITACCT field from PRLINE to CONTRACTLINE after action copy PR lines to Contract
from psdi.mbo import MboSet
from psdi.mbo import MboConstants
from psdi.server import MXServer;
from java.sql import Statement;
from java.sql import PreparedStatement;
from java.sql import Connection;
from java.sql import ResultSet;
from psdi.mbo import Mbo;
import time;
CONTRACTNUM = mbo.getString("CONTRACTNUM");
CONTRACTLINENUM = mbo.getString("CONTRACTLINENUM");
mxserver = MXServer.getMXServer();
userInfo = mxserver.getSystemUserInfo();
currentSet = mxserver.getMboSet("PRLINE",userInfo);
currentMbo = currentSet.getMbo(0);
con = currentMbo.getMboServer().getDBConnection(userInfo.getConnectionKey());
schema = currentMbo.getMboServer().getSchemaOwner();
q= " SELECT PRLINE.GLDEBITACCT FROM PRLINE WHERE PRLINE.CONTRACTNUM ='"+ CONTRACTNUM +"' AND PRLINE.CONTRACTLINENUM ='"+ CONTRACTLINENUM +"' ";
s= con.createStatement();
rs1 = s.executeQuery(q);
while(rs1.next()):
result = rs1.getString('test');
s.close();
mbo.setValue("CONTRACTLINE.GLDEBITACCT",result ,MboConstants.NOACCESSCHECK | MboConstants.NOVALIDATION)