Hi Gaurav,
Prashant's response is technically correct, but is a little sloppy. He probably was just trying to answer quickly.
You should should not just assume that the user and person Id are the same when it is easy to get the person Id from the Mbo's UserInfo class. You also should not use raw numbers for option flags, but should import the MboConstants class and use them from there. The value of 11L is probably NOVALIDATION_AND_NOACTION plus NOACCESSCHECK, which is a little weird and probably just a copy / paste error. I have gone ahead and assumed that he meant to ignore read only and retained the NOACCESSCHECK option flag.
Jython below:
from psdi.mbo import MboConstants
mbo.setValue("ACTSTART", mbo.getDate("TARGSTARTDATE"), MboConstants.NOACCESSCHECK);
mbo.setValue("OWNER", mbo.getUserInfo().getPersonId() , MboConstants.NOACCESSCHECK);
Here is a blog post on using MboConstants for your reference. https://www.sharptree.io/blog/2022/2022-01-03-mbo-constants/
------------------------------
Jason VenHuizen
Sharptree
------------------------------
Original Message:
Sent: 05-19-2023 01:51
From: Gaurav Sharma
Subject: Automation scripts.
Can you tell me the automation script for opying target start date to actual start date and also populate owner with current user id after approval of workorder. Step by step
#EverythingMaximo
------------------------------
Gaurav Sharma
------------------------------