Import into the BM_ComponentReportSelection.M4T!!!!

SOLVED

Is there any way to populate the BM_ComponentReportSelection.M4T  without manually keying it in the Gross Requirements Report?   It is not an available table to import into for Bill of Materials. https://solitaire.onl/ https://9apps.ooo/ https://bluestacks.vip/

Parents
  • +1
    verified answer

    You could use a script to get a handle to the BM_ReportBillSelection_bus object and write the records into the table.

    The primary key consists of the BillNo+Revision+BillOption1+BillOption2+BillOption3+BillOption4+BillOption5+BillOption6+BillO
    ption7+BillOption8+BillOption9.

    You can either use SetKey with every part of the key (except the last part) padded to the full length of the field or use SetKeyValue for each field individually followed by a SetKey.

    Then use SetValue on the other fields in the table like QuantityRequired, BillFormat, ComponentWarehouseCode, etc.

    Finally use Write to write the record to the table.

    This link has more details on the rest of the fields in the table.

    http://help-sage100.na.sage.com/2019/FLOR/#File_Layouts/Bill_of_Materials/BM_ComponentReportSelection.htm

  • 0 in reply to David Speck

      I am wondering if you ever got this to work. After a successful login I tried the following snippet which is not working. Everything up to the first SetKeyValue works. All the SetKeyValue's fail (retVal=0) then the SetKey returns a null (retVal = ).

    Set oScript = CreateObject("ProvideX.Script"
    oScript.Init(MASInitPath)
    Set oSS = oScript.NewObject("SY_Session")
    
    retVal = oSS.nSetDate("B/M",ModuleDate)
    retVal = oSS.nSetModule("B/M")
    
    retVal = oSS.nSetProgram(oSS.nLookupTask("BM_ComponentReqrmntReport_ui"))
    Set oBusCompReqRpt = oScript.NewObject("BM_ReportBillSelection_bus",oSS)
    
    retVal = oBusCompReqRpt.nSetKeyValue("BillNo$", sBillNo) 
    retVal = oBusCompReqRpt.nSetKeyValue("Revision$", "000")
    retVal = oBusCompReqRpt.nSetKeyValue("BillOption1$", "")
    retVal = oBusCompReqRpt.nSetKeyValue("BillOption2$", "")
    retVal = oBusCompReqRpt.nSetKeyValue("BillOption3$", "")
    retVal = oBusCompReqRpt.nSetKeyValue("BillOption4$", "")
    retVal = oBusCompReqRpt.nSetKeyValue("BillOption5$", "")
    retVal = oBusCompReqRpt.nSetKeyValue("BillOption6$", "")
    retVal = oBusCompReqRpt.nSetKeyValue("BillOption7$", "")
    retVal = oBusCompReqRpt.nSetKeyValue("BillOption8$", "")
    retVal = oBusCompReqRpt.nSetKey()

Reply
  • 0 in reply to David Speck

      I am wondering if you ever got this to work. After a successful login I tried the following snippet which is not working. Everything up to the first SetKeyValue works. All the SetKeyValue's fail (retVal=0) then the SetKey returns a null (retVal = ).

    Set oScript = CreateObject("ProvideX.Script"
    oScript.Init(MASInitPath)
    Set oSS = oScript.NewObject("SY_Session")
    
    retVal = oSS.nSetDate("B/M",ModuleDate)
    retVal = oSS.nSetModule("B/M")
    
    retVal = oSS.nSetProgram(oSS.nLookupTask("BM_ComponentReqrmntReport_ui"))
    Set oBusCompReqRpt = oScript.NewObject("BM_ReportBillSelection_bus",oSS)
    
    retVal = oBusCompReqRpt.nSetKeyValue("BillNo$", sBillNo) 
    retVal = oBusCompReqRpt.nSetKeyValue("Revision$", "000")
    retVal = oBusCompReqRpt.nSetKeyValue("BillOption1$", "")
    retVal = oBusCompReqRpt.nSetKeyValue("BillOption2$", "")
    retVal = oBusCompReqRpt.nSetKeyValue("BillOption3$", "")
    retVal = oBusCompReqRpt.nSetKeyValue("BillOption4$", "")
    retVal = oBusCompReqRpt.nSetKeyValue("BillOption5$", "")
    retVal = oBusCompReqRpt.nSetKeyValue("BillOption6$", "")
    retVal = oBusCompReqRpt.nSetKeyValue("BillOption7$", "")
    retVal = oBusCompReqRpt.nSetKeyValue("BillOption8$", "")
    retVal = oBusCompReqRpt.nSetKey()

Children