Scripting

  • 1.  Hello all!I'm trying to write a script that will

    Posted 08-06-2015 14:27
    Hello all! I'm trying to write a script that will update the Bill of Materials Description 1 when the description in the inventory Item Maintenance is changed, but when I save the data in IM module I get an error saying I don't have correct permissions. If I click info I get error #13: File access mode is invalid. Is there another (better) way to write to BM module from CI_Item table? retval = """" strDesc = """" strItemCode = """" oBMobj = """" strBillDesc = """" strBillNo= """" dbg=oscript.debugprint(""DBG-Scripting Started"") 'Get Desc retVal = oBusObj.GetValue(""ItemCode$"", strItemCode) retVal = oBusObj.GetValue(""ItemCodeDesc$"", strDesc) dbg=oscript.debugprint(strDesc) 'Get BOM Head obj oBMobj = oSession.GetObject(""BM_Bill_bus"") If oBMobj <> 0 THen Set oBMobj = oSession.AsObject(oBMobj) Else 'Do Nothing End If retVal = oBMobj.SetKeyValue(""BillNo$"", strItemCode) retVal = oBMobj.SetKeyValue(""Revision$"", 000) retVal = oBMobj.Find() dbg=oscript.debugprint(retVal) retVal = oBMobj.GetValue(""BillNo$"", strBillNo) retVal = oBMobj.GetValue(""BillDesc1$"", strBillDesc) dbg=oscript.debugprint(retVal &"" BillNo: "" & strBillNo & "" Bill Desc: "" & strBillDesc) retVal = oBMobj.SetValue(""BillDesc1$"", strDesc) retVal = oBMobj.Write() retVal = oBMobj.GetValue(""BillDesc1$"", strBillDesc) dbg=oscript.debugprint(retVal &"" BillNo: "" & strBillNo & "" Bill Desc: "" & strBillDesc) Any help is greatly appreciated! TIA!


  • 2.  RE: Hello all!I'm trying to write a script that will

    Posted 08-06-2015 14:29
    Nothing script-related but does the user have access to Bill of Materials Maintenance?


  • 3.  RE: Hello all!I'm trying to write a script that will

    Posted 08-06-2015 14:30
    Also - version 2015 does this automatically - am assuming the customer can't upgrade?


  • 4.  RE: Hello all!I'm trying to write a script that will

    Posted 08-06-2015 14:30
    Yes, it's in my test system with only one user and that users has admin rights. :(


  • 5.  RE: Hello all!I'm trying to write a script that will

    Posted 08-06-2015 14:35
    They actually are running 2015, where is this setting??


  • 6.  RE: Hello all!I'm trying to write a script that will

    Posted 08-06-2015 14:38
    Bill of Material Options, right side - Sync Bill Description and Item Description


  • 7.  RE: Hello all!I'm trying to write a script that will

    Posted 08-06-2015 15:08
    Unfortunately, this doesn't work if there's an extended description, so I'm back to square one. :(


  • 8.  RE: Hello all!I'm trying to write a script that will

    Posted 08-06-2015 15:15
    BUMMER!


  • 9.  RE: Hello all!I'm trying to write a script that will

    Posted 08-06-2015 16:05
    Hey Boise - this line here: retVal = oBMobj.Find() Change that to: retVal = oBMobj.SetKey() If it works one thing to be aware of is if someone is sitting in that bill in B/M Maint you'll get some kind of ""record in use"" error (because they have done the same SetKey)


  • 10.  RE: Hello all!I'm trying to write a script that will

    Posted 08-07-2015 06:31
    You're my hero! <3 Thanks so much Alnoor!


  • 11.  RE: Hello all!I'm trying to write a script that will

    Posted 08-07-2015 12:42
      |   view attached
    Sam, In 2015 this is an option in Bill of Materials Options:

    Attachment(s)

    docx
    BOM_OPTIONS.docx   35 KB 1 version


  • 12.  RE: Hello all!I'm trying to write a script that will

    Posted 08-07-2015 13:45
    Good thought Anne but apparently doesn't work for extended descriptions [sigh]