This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Move forward a request (personWantsorg) throught the approval workflow by script

Hi all,

I'm in a migration step from old system to 1IM where I have all requestd with their approval workflow in the old system.

I'd like to update the status of the request created with the approval workflow step where they are in the old system ( I have custom precessing status) is it possible? How can I achieve this with script?

  • Hi Mik,

    you can create a personwantsorg objects based on your details in existing system but you cannot mimic the approval steps in the new personwantsorg , you can just create pwo's with assigned status through background scripts. this ensures that the existing users with the access will not lose their access when its migrated to D1IM. while creating the pwos you need to provide the corresponding groups - products  (object key ordered) .

    thanks

    Gnana

  •  you can refer the below link to how to do it

  • I execute the floow script from job server, it doesn't return any error but nothing happen. no Personwatsorg is created.

    Public Sub CCC_Import_Request
    Dim pBag As New PropertyBag

    pBag.PutValue("UID_Org", "87818304-b6b8-4d8b-898a-881ed18003cf") 'uid_accproduct
    pBag.PutValue("UID_PersonOrdered", "cbf1bf27-09a8-48cc-a2b6-175d934025b3") 'uid_person
    pBag.PutValue("OrderState", "Assigned")
    Dim dbPwO As ISingleDbObject = Connection.CreateSingle("PersonWantsOrg")
    dbPwO.Custom.CallMethod("FillOrder", pBag)
    End Sub

    I miss something?

    I put in UID_ORG the uid of accproduct connected to UNSGROUPB i want to order is it correct?

  • I try this script too

    Dim pBag As New PropertyBag
    ' assign all required fields
    pBag.PutValue("ObjectKeyOrdered", "<Key><T>UNSGroupB</T><P>87818304-b6b8-4d8b-898a-881ed18003cf</P></Key>")
    pBag.PutValue("UID_PersonInserted", "cbf1bf27-09a8-48cc-a2b6-175d934025b3")
    pBag.PutValue("UID_PersonOrdered", "cbf1bf27-09a8-48cc-a2b6-175d934025b3")
    pBag.PutValue("OrderState", "OrderProduct")
    'Dim dbPwO As ISingleDbObject = Connection.CreateSingle("PersonWantsOrg")
    RaiseMessage(MsgSeverity.Info, "Before")
    dbPwO.Custom.CallMethod("FillOrder", pBag)
    RaiseMessage(MsgSeverity.Info, "pwo id generated " + dbPwo.GetValue("uid_personwantsorg").ToString)
    dbPwO.Save
    End Sub

    I get the UID in the log but when I looking for it in the personwantsorg table I can't find it

    then i try to save the object dbpwo and I get the following error:

    PersonWantsOrg: The following fields are compulsory and need to be filled: Product
    I need to insert a request for a unsgroupB object published in IT SHOP