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

PWO FillOrder raises error in v7.1.1 (call only internally)

Hi all

I used a script in v6 to add Orders which are directly assigned, therewith no approver is needed.

This was done by:

   Dim Bag As New PropertyBag()
   Bag.PutValue("UID_PersonOrdered", UID_Person)
   Bag.PutValue("UID_PersonInserted", UID_Person)
   Bag.PutValue("UID_Org", UID_OrgPr)
   Bag.PutValue("OrderReason", OrderReason)
   Bag.PutValue("OrderState", "Assigned")
   Bag.PutValue("ValidUntil", ValidUntil)

   Dim dbPWO As ISingleDbObject = Connection.CreateSingle("PersonWantsOrg")
   dbPWO.Custom.CallMethod("FillOrder", Bag)

Now in v7.1.1 I receive the error when calling FillOrder:

[2133323] This method can only be called internally.
at QER.Customizer.PersonWantsOrg.FillOrder(ISession session, IEntity entity, PropertyBag propBag, CancellationToken ct)

How can I create an order with the orderstate=Assigned in v7? One Forumentry here refers to the same Problem but the solution was to create an Order which has to be approved, which does not work in my case. Is there a new method I should use?

By the way, I received the error while the Job was processed by the JobQueue, not in designer. (As far as I know, when Debugging in the designer, this method does not work, but when called from the Service, it should)

Thanks for your help,

Kind regards,
Rolf

 

Parents
  • Hi Rolf,

    did you get it working? I tried to call the FillOrder method with version 7 without success too. At the end I used the CreateITShopOrder method.
    You first have to load your direct assignment (if there is no direct assignment you have to create it) and then call the CreateITShopOrder method. This method creates an auto-approved order (status assigned) for the assignment and removes the direct assignment.
    Here is some sample code (in this case for ESet assignment)

    Dim dbPersonHasEset As ISingleDbObject = Connection.CreateSingle("PersonHasEset")
    dbPersonHasEset.PutValue("UID_ESet", sUID_ESet)
    dbPersonHasEset.PutValue("UID_Person", sUID_Person)
    dbPersonHasEset.Load()
    dbPersonHasEset.Custom.CallMethod("CreateITShopOrder", "CCC_CreateITShopOrderAttributes")
    dbPersonHasEset.Save

    You have to create the referenced CCC_CreateITShopOrderAttributes function to define attributes like OrderReason, UID_PersonOrdered..

    Hope that helps.

    Regards
    Chris
Reply
  • Hi Rolf,

    did you get it working? I tried to call the FillOrder method with version 7 without success too. At the end I used the CreateITShopOrder method.
    You first have to load your direct assignment (if there is no direct assignment you have to create it) and then call the CreateITShopOrder method. This method creates an auto-approved order (status assigned) for the assignment and removes the direct assignment.
    Here is some sample code (in this case for ESet assignment)

    Dim dbPersonHasEset As ISingleDbObject = Connection.CreateSingle("PersonHasEset")
    dbPersonHasEset.PutValue("UID_ESet", sUID_ESet)
    dbPersonHasEset.PutValue("UID_Person", sUID_Person)
    dbPersonHasEset.Load()
    dbPersonHasEset.Custom.CallMethod("CreateITShopOrder", "CCC_CreateITShopOrderAttributes")
    dbPersonHasEset.Save

    You have to create the referenced CCC_CreateITShopOrderAttributes function to define attributes like OrderReason, UID_PersonOrdered..

    Hope that helps.

    Regards
    Chris
Children
No Data