How does one close a purchase order with a webservice call? (Sage X3 11)

Hi!

I've got an interface which can create and update purchase orders via webservice (using save and modify methods respectively), but when it comes to closing an order, it doesn't appear to be possible.

I cannot set the open quantity to zero, as it regards that as leaving a mandatory field blank, and I cannot set the order or order line closed flag to yes, because they are display only fields

On the screen, there is a "Close Order" button on the right hand side of the screen (under the New/Save/Create/Delete/Cancel section) but I don't know how to ask the webservice to call such a method.

Is there a way of invoking this from the POH object somehow via the webservice, or is there a script/subprogram that can be webservice enabled to carry out the PO close function?

Thanks!

Parents
  • 0

    Hi Screwtape:

    Try using the "actionObject" method.

    The first parameter is the context class.

    The second parameter is the object code.

    The third parameter is the code of the button or the menu in the object window (the "Close Order" code is "2").

    About the fourth parameter: I'm not sure. Probably, you will have to inform the purchase order number. I'm not sure how it works, I never have tried. 

    Try to do some tests. If I have time, I'll make my tests. I'll keep you informed.

    Thanks,

    Nacho Alférez

  • 0 in reply to Nacho_Alferez

    Hi Nacho! Thanks for your answer and sorry for not getting back sooner - I was on holiday when you replied. 

    This looked very hopeful. Unfortunately, when I try it, both with actionObject and actionObjectKeys (which lets me specify the PO number) methods I get a message:

    WPOHNUM Undefined Parameter

    WPOHNUM is apparently set by the script that TRTCLEPOH calls, from the context [F:POH]POHNUM, both specifying the order details in the objectXml parameter, and specifying it with keys in the actionObjectKeys method, results in the same message.

    I've tried specifying WPOHNUM as a field parameter but that doesn't work either, so I'm rather stuck again.

  • 0 in reply to Screwtape

    you can create a subprogram where you pass the PO number

    Call TRTPOHCLE (WPOHNUM, WMSGFLG, WRET) From TRTACHDIV1

    WPOHNUM: Purchase order number

    WMSGFLG: It is Integer value which indicates error message

    WRET: (Return Code) It Contains an integer value.

Reply Children
No Data