Sage 100

 View Only
Expand all | Collapse all

Attempting to launch bill of materials inquiry from script - parameters

  • 1.  Attempting to launch bill of materials inquiry from script - parameters

    Posted 03-15-2023 19:05

    client has requested to have a button link in the sales order entry screen that will pull up the bill of materials inquiry for the item selected.

    I've done this before to launch item inquiry which requires a single parameter, but I'm having difficulties because bill of materials appears to want the revision number as well as the bill no.

    The object reference doesn't seem to tell me exactly what parameters I need (or maybe I'm looking in the wrong place?) but I assume it is the item code and the revision.

    The code below will without the revision parameter will launch BM Inquiry but then wants the revision number.

    If I try to add the revision number I get an error suggesting wrong number of parameters or incorrect parameters.

    Can anyone suggest the proper syntax to pass the item code and revision?

    retVal = oSession.InvokeProgram(oSession.LookupTask("BM_BillInquiry_ui"),SO_SalesOrderDetail_bus_ItemCode,SO_SalesOrderDetail_bus_Revision)



    ------------------------------
    Thomas Rogers (TomTarget)
    Target System Technology, Inc.
    ------------------------------


  • 2.  RE: Attempting to launch bill of materials inquiry from script - parameters

    Posted 03-15-2023 19:40

    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.
    ------------------------------



  • 3.  RE: Attempting to launch bill of materials inquiry from script - parameters

    Posted 03-16-2023 12:41

    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.
    ------------------------------



  • 4.  RE: Attempting to launch bill of materials inquiry from script - parameters

    Posted 03-16-2023 13:32

    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.
    ------------------------------



  • 5.  RE: Attempting to launch bill of materials inquiry from script - parameters

    Posted 03-16-2023 13:44

    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.
    ------------------------------



  • 6.  RE: Attempting to launch bill of materials inquiry from script - parameters

    Posted 03-16-2023 14:45

    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.
    ------------------------------



  • 7.  RE: Attempting to launch bill of materials inquiry from script - parameters

    Posted 03-16-2023 16:40

    I'm not a BOI person, so this may be a longshot, but I don't see that you have tried a colon.

    In providex, variables are sometimes separated by colons.

     

    "BillNo$:CurrentBillRevision$"

     

     

    Don't miss the 2023 Basic Crystal Reports for Sage 100 Online Training: View the details

    Don't miss the 2023 Intermediate Crystal Reports for Sage 100 Online Training: View the details

     

    David Overholt

    DWD Technology Group, Inc.

    9921 Dupont Circle Drive West, Suite 300 | Fort Wayne, IN 46825

    260.423.2414 main

    260.399.8655 Direct

    800.232.8913 toll free

    sagesupport@dwdtechgroup.com

    www.dwdtechgroup.com

     

     






  • 8.  RE: Attempting to launch bill of materials inquiry from script - parameters

    Posted 03-20-2023 13:54

    The colon was worth a shot but it thinks I'm trying to create a new BOM.  :(



    ------------------------------
    Thomas Rogers (TomTarget)
    Target System Technology, Inc.
    ------------------------------



  • 9.  RE: Attempting to launch bill of materials inquiry from script - parameters

    Posted 03-20-2023 13:58

    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.
    ------------------------------



  • 10.  RE: Attempting to launch bill of materials inquiry from script - parameters

    Posted 03-22-2023 12:48

    Good thought.  It still is claiming it needs the revision number.



    ------------------------------
    Thomas Rogers (TomTarget)
    Target System Technology, Inc.
    ------------------------------



  • 11.  RE: Attempting to launch bill of materials inquiry from script - parameters

    Posted 03-22-2023 13:02

    Ask on Sage City?  Someone from the development team might answer.



    ------------------------------
    Kevin Moyes
    Technical Systems Analyst
    Munjal White Consulting Co.
    ------------------------------



  • 12.  RE: Attempting to launch bill of materials inquiry from script - parameters
    Best Answer

    Posted 03-30-2023 11:31

    Thanks for the suggestion regarding Sage City.  The solution is as follows.

    Try:

    oBillInq = 0

    Set oBillInq = oSession.AsObject(oSession.GetObject("BM_BillInquiry_ui"))

    bill = "DSKTP-00100"
    rev = "000"
    billRev = bill & String(30-Len(bill), Chr(0)) & rev

    rVal = oBillInq.Process(billRev)



    ------------------------------
    Thomas Rogers (TomTarget)
    Target System Technology, Inc.
    ------------------------------



  • 13.  RE: Attempting to launch bill of materials inquiry from script - parameters

    Posted 03-22-2023 13:41

    I just added an order line with a bill item that had a revision of 000 and if you looked in the SO_SalesOrderDetail line and checked the Revision field, it was blank.



    ------------------------------
    Beth Bowers
    (269) 358-0989
    ------------------------------