Monday, December 11, 2017

GP Dexterity open PO Receiving Inquiry window

Recently I developed a window to ease invoice/shipment matching in AP. I thought it would be nice if I could give them a link to open the Receiving Inquiry window so they could view the entire transaction. You see I was just giving them a list of select fields.

Took me a bit of work but I figured this out. I first did a debug from the Purchase Order Documents Inquiry window, that opens the Receiving Inquiry window. I found the following lines.

Historical shipment transactions:
'OpenWindow() of form POP_Inquiry_Receivings_Entry', 0, "0022708", 2, 3, 1

Open shipment transactions:
 'OpenWindow() of form POP_Inquiry_Receivings_Entry', 0, "0053442", 2, 4, 1

The closed parenthesis means OpenWindow is a function in the form. 

Further I found this in the SDK:
------------------------------------------------------------------------
PURCHASING FORM FUNCTION:  OpenWindow
 of form POP_Inquiry_Receivings_Entry
------------------------------------------------------------------------
function returns         integer                  nStatus;
in                       'POP Receipt Number'     sRcptID;
in                       integer                  nMenu;
in                       integer                  nOrigin;
optional in              integer                  nCurrencyView=CURRENCYVIEW_ORIGINATING; 


I have no clue what nMenu is for.  Further research and testing is required.

To call this function and open the Inquiry window you would do something like this in Dexterity:

local long fnresult;
local integer posted;

clear table POP_Receipt;
'POP Receipt Number' of table POP_Receipt = receiptnumber;
get table POP_Receipt;

if err() = OKAY then
  set posted to 4; {work}
else
  set posted to 3; {history}
end if;


fnresult = OpenWindow(ReceiptNumber, 2, posted, CURRENCYVIEW_FUNCTIONAL) of form POP_Inquiry_Invoice_Entry;

There are other nOrigin values, I am sure.  If anyone figures those out or what nMenu is please add in comments.  I will update as I find those other values.

No comments:

Post a Comment