Thanks for the suggestion regarding Sage City. The solution is as follows.
Target System Technology, Inc.
Original Message:
Sent: 03-22-2023 13:01
From: Kevin Moyes
Subject: Attempting to launch bill of materials inquiry from script - parameters
Ask on Sage City? Someone from the development team might answer.
------------------------------
Kevin Moyes
Technical Systems Analyst
Munjal White Consulting Co.
------------------------------
Original Message:
Sent: 03-22-2023 12:48
From: Thomas Rogers
Subject: Attempting to launch bill of materials inquiry from script - parameters
Good thought. It still is claiming it needs the revision number.
------------------------------
Thomas Rogers (TomTarget)
Target System Technology, Inc.
Original Message:
Sent: 03-20-2023 13:58
From: Kevin Moyes
Subject: Attempting to launch bill of materials inquiry from script - parameters
Pad the ItemCode to 30 characters, not 15. Even if you don't have extended item codes enabled, the BillNo field is technically 30 characters in the data dictionary.
------------------------------
Kevin Moyes
Technical Systems Analyst
Munjal White Consulting Co.
Original Message:
Sent: 03-16-2023 14:44
From: Thomas Rogers
Subject: Attempting to launch bill of materials inquiry from script - parameters
That looks promising. I did exactly that originally but padded it with spaces on my first try.
Just tried it and it fires up the Bill inquiry but still claims it needs the revision number. The length of the parameter is 16 characters with the revision number..
passvalue=""
passvalue = SO_SalesOrderDetail_bus_ItemCode & string((15-len(SO_SalesOrderDetail_bus_ItemCode)),chr(0)) & SO_SalesOrderDetail_bus_Revision
retval = oSession.AsObject(oSession.UI).Messagebox("",passvalue & " " & len(passvalue))
retVal = oSession.InvokeProgram(oSession.LookupTask("BM_BillInquiry_ui"), passvalue)
Would sure be nice if the object reference would specify the parameters to invoke the UI.
------------------------------
Thomas Rogers (TomTarget)
Target System Technology, Inc.
Original Message:
Sent: 03-16-2023 13:44
From: Kevin Moyes
Subject: Attempting to launch bill of materials inquiry from script - parameters
This is how I pad for lookups... example for IM_ItemWarehouse:
sItemCode & String(30-Len(sItemCode),Chr(0)) & sWarehouseCode
------------------------------
Kevin Moyes
Technical Systems Analyst
Munjal White Consulting Co.
Original Message:
Sent: 03-16-2023 13:32
From: Thomas Rogers
Subject: Attempting to launch bill of materials inquiry from script - parameters
Have now tried a separators as follows with no luck.
padding with spaces between item number and revision (claims bill number is greater than 15 characters)
All of the following make it think we are creating a new bill.
semi colon
comma
null character 0
tab
------------------------------
Thomas Rogers (TomTarget)
Target System Technology, Inc.
Original Message:
Sent: 03-16-2023 12:41
From: Thomas Rogers
Subject: Attempting to launch bill of materials inquiry from script - parameters
Good thought however since the length of the item number can vary (unlike the division number in a customer record) there will need to be some sort of separator between the item number and the version number.
Assuming we are looking for item WIDGET and revision D
WIDGETD will try to (and did) create a new item WIDGETD. Since I was in inquiry mode it told me I didn't have rights to create it.
I would guess something like WIDGET;D would have to be sent but I'm not sure what the separator would be. Any idea?
------------------------------
Thomas Rogers (TomTarget)
Target System Technology, Inc.
Original Message:
Sent: 03-15-2023 19:39
From: Kevin Moyes
Subject: Attempting to launch bill of materials inquiry from script - parameters
I think you have to concatenate the key fields... here are my notes from something similar with Customer Inquiry:
This method "links" the opened UI panel to the source program, so if executed from an SO script, it will lock the SO until the opened window is closed… and it runs within the same oSession, so StorageVars do transmit (and the "oSession.StartProgram" is not what you'd expect).
oUICust = oSession.GetObject("AR_Customer_UI")
if oUICust <> 0 then
Set oUICust = oSession.AsObject(oUICust)
else
retVal = oSession.AsObject(oSession.UI).MessageBox("","Access to AR_Customer_UI is required for the ... script to work.")
exit sub
end if
retVal = oUICust.Process(sDiv & sCustNo)
This method opens an unlinked instance of the program (with new oSession… so StorageVars don't transmit).
retVal = oSession.InvokeProgram("AR_Customer_UI", sDiv &sCustNo)
------------------------------
Kevin Moyes
Technical Systems Analyst
Munjal White Consulting Co.