title: Maximo 7.6 APPR POs via Integration
body: <p>We have an integration where in PO will be created in an external application and then will be interfaced to Maximo.
  POs which are aproved only will be inbound to Maximo , however Maximo doesnt allow addition of POLINES in APPR status ,so via integration , we are receiving the PO in WAPPR status.
  We have to approve the PO instantly so that any successive PO updates / Receipt transactions process to Maximo.
  I'm aware that an escalation can do the task of approving POs, however I would like the status change to happen instantly.</p>
  
  <p>I have tried following options
  1)Create a workflow to approve PO and set it to auto initiate. This doesnt work as workflow set to auto-initiate doesnt get triggered for objects created through integration</p>
  
  <p>2)Tried setting up automation script to initiate workflow</p>
  
  <pre><code>from psdi.mbo import MboConstants
  from psdi.server import MXServer
  print("**************Script to Approve Inbound POs *******");
  stat=mbo.getString("STATUS")
  if ( stat != ''):
    print ( " Status is not null ");
    print ( stat);
    if ( stat=='WAPPR'):
      print ("Status is WAPPR");
      MXServer.getMXServer().lookup("WORKFLOW").initiateWorkflow("[my WF]",mbo);
      print(" Workflow has been initiated and PO will be approved");
  </code></pre>
  
  <p>my WF contains an Action , which performs Change Status to set status as APPR.
  This creates an entry in the POSTATUS table, however new Status reads as WAPPR instead of APPR</p>
  
  <p>3)Automation script to set value for Status</p>
  
  <pre><code>from psdi.mbo import MboConstants
  from psdi.server import MXServer
  print("**************Script to Approve POs Inbound *******");
  stat=mbo.getString("STATUS")
  if ( stat != ''):
     print ( " Status is not null ");
     print ( stat);
     if ( stat=='WAPPR'):
       print ("Status is WAPPR");
       mbo.setValue("STATUS","APPR",MboConstants.NOVALIDATION );
       print(" Status approved");
  </code></pre>
  
  <p>This was set up with Object Launch point , Object as PO and on Save operation , After commit.</p>
  
  <p>This also dint work.</p>
  
  <p>Please let me know whether there are any other options</p>