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

ObjectKeyAssignment@PersonWantsOrg is not populated at time the request is approved (event: Granted)

Hello,

I have a custom process to be fired by the event Granted from PersonWantsOrg. The process need to do something else with the value of "ObjectKeyAssignment" when the request is approved in ITShop. However the "ObjectKeyAssignment" had no value populated yet at time the custom process was fired by the event "Granted".

Is there a way I may capture the value of "ObjectKeyAssignment" in the request approval when the event Granted occurs? Or other workarounds? It is v7.0.2.

Thank you!

  • Hi,

    ObjectKeyAssignment is only filled if you are requesting something using an assignment resource. Maybe that's the reason why the property is not filled. What did you try to request?

  • Hi Markus,

    It is an assignment resource which is created through the Wizard "Create assignment resource" of a Business Role. Below is the code I attempt getting the value but values("CP01") has no value at time the request is granted in ITShop.

    Dim uidOrg As String = VI_GetValueObject("PersonInOrg","XObjectKey",$ObjectKeyAssignment$,"UID_Org")

    values("CP01") = VI_GetValueOfObject("Org", "UID_Org", uidOrg, "CustomProperty01")

  • There is typo to VI_GetValueObject("PersonInOrg","XObjectKey",$ObjectKeyAssignment$,"UID_Org"). It is VI_GetValueOfObject("PersonInOrg","XObjectKey",$ObjectKeyAssignment$,"UID_Org")

  • I did some testing in my version and PersonWantsOrg.ObjectKeyAssignment was always filled in my 7.0.2 environment.

    The reason for not getting the CustomProperty01 value of your requested Org Membership is, that the Membership does not exist at the time the GRANTED event is fired. Means, your code to get the UID_Org is not working because your are using the non-existing membership to get the UID_Org,

    Instead use the following code to fetch the CustomProperty01 from the Org you are requesting the membership for:

    Dim dboKeyOrg As DbObjectKey = New DbObjectKey($FK(ObjectKeyOrdered),QERAssign.ObjectKeyAssignTarget$)

    values("CP01") = Session.GetSingleValue(of String)(dboKeyOrg,"CustomProperty01")

    You will find some more sample about how-to use the object layer in the script samples on the product delivery in the folder "Modules\QBM\dvd\AddOn\SDK\ScriptSamples".

  • That worked like charm. Many thanks! Markus