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

How to create "Prolongate" request for PWO from script?

I'm trying to create "Prolongate" request for PWO via script.

It should be as simple as 

Dim obj As ISingleDbObject = Connection.CreateSingle("PersonWantsOrg", <UID_PersonWantsOrg>)
Dim res As Object = obj.Custom.CallMethod("Prolongate", DateAdd("d", 123, Now.Date()) )

but it does not work. Exception is not thrown, but "res" variable is null and renewal process is not created.

I tried to run this script from Designer, Object Browser, process. No luck.

If I run "Prolongate" method for the same PWO in Object Browser,  new renewal process is created.

We are using 8.0

  • You should use the following code (based on the script samples11 Call database object methods.vb from the SDK that comes with OneIM). The key is to save the object after calling the method.

    Dim dbPersonWantsOrg As IEntity

    ' Load the PersonWantsOrg object
    dbPersonWantsOrg = Session.Source.Get("PersonWantsOrg", "uidPersonWantsOrg")

    Try

    ' Call customizer method Prolongate
    dbPersonWantsOrg.CallMethod("Prolongate", DateAdd("d", 123, Now.Date()))

    ' Save to execute the method
    dbPersonWantsOrg.Save(Session)

    Catch ex As Exception
    ' Error handling
    VID_Write2Log("C:\Test.log", ViException.ErrorString(ex))

    End Try

  • Thanks,

    it is working now.

    I was sure that I was missing something like this and even tried to call CommitTransaction , but for some reason I did not think about calling .save() method