Maximo Open Forum

 View Only
  • 1.  Missing Attribute error on simple Automation Script

    Posted 2 days ago

    Hello all,

    We have a customer with a simple request. Set the default Vendor to the same Vendor on all Inventory Items. Essentially they're looking to hit reset on their Default Vendors.

    I have a fairly simple script (distilled down currently for troubleshooting purposes):

    from psdi.server import MXServer
     
    newVendor = 'NEW'
     
    server = MXServer.getMXServer()
    userInfo = server.getUserInfo('MAXADMIN')
     
    inventorySet = server.getMboSet("INVENTORY", userInfo)
    inventorySet.setWhere("vendor!='" + newVendor + "' and status='ACTIVE' and internal=0")
    inventorySet.reset()
     
    inventoryItem = inventorySet.moveFirst()
    inventoryItem.setValue('VENDOR', newVendor)
     
    inventorySet.save()
    inventorySet.close()
    inventorySet.cleanup()
    The bizarre thing is that I'm getting the following error: BMXAA4176E - Attribute TAXEXEMPT does not exist. Gather the logs from the <HOME> directory and determine the process or app referencing the invalid attribute. This error is presenting at the inventorySet.save() step. I've also tried adding access modifiers here, but that made no difference.

    I'm trying to think through where this error could be coming from...other areas where custom logic is potentially being inserted in the transaction. So far I've ruled out Automation Scripts, Conditions, Security Restrictions, Crossover Domains, and Publish Channels.

    #Administration

    ------------------------------
    Tim Ferrill
    Solutions Consultant
    Intelligent Technology Solutions
    tferrill@webuildits.com
    www.webuildits.com
    @tferrill/@webuildits
    ------------------------------


  • 2.  RE: Missing Attribute error on simple Automation Script

    Posted 2 days ago

    Tax exempt is almost guaranteed the inventory vendor (INVVENDOR) table. When you set the vendor attribute on INVENTORY it will create the necessary INVVENDOR record on save. 

    What I can't explain though is why you're getting the error exactly. It's possible there's different logic in your version (or an issue with one of the industry solutions) but I would check the ITEMORGINFO data for the item. When the owner object is INVENTORY it tries to grab the taxexempt flag from the ITEMORGINFO. Only when ITEMORGINFO doesn't exist it then tries to pull from the owner, in this case inventory, which doesn't have a taxexempt attribute. My guess is for some reason it didn't find the ITEMORGINFO and led to the error. 



    ------------------------------
    Steven Shull
    Naviam
    ------------------------------



  • 3.  RE: Missing Attribute error on simple Automation Script

    Posted 2 days ago

    Steven,

    Exactly. I checked INVVENDOR for that attribute (both in Maximo and the DB) at least three times.

    It looks like you're right about ITEMORGINFO. First couple of Items I checked don't have any records there.

    I added some logic to try to add it on the fly, but now I'm getting another nonsensical error: BMXAA4191E - The value 1009 is not valid for Service. Specify a valid value for Service.

    That value auto increments...but doesn't correspond to anything in ITEMORGINFO...or MAXSEQUENCE for that matter.



    ------------------------------
    Tim Ferrill
    Solutions Consultant
    Intelligent Technology Solutions
    tferrill@webuildits.com
    www.webuildits.com
    @tferrill/@webuildits
    ------------------------------



  • 4.  RE: Missing Attribute error on simple Automation Script

    Posted 2 days ago

    Ok, think I'm getting somewhere.

    ITEMNUM on ITEMORGINFO is titled Service, and it looks like somebody set that field to default to &AUTOKEY&, which makes no sense to me.

    Removed that &AUTOKEY& value and handled a couple other things and I'm in business.

    Thanks for the assist!



    ------------------------------
    Tim Ferrill
    Solutions Consultant
    Intelligent Technology Solutions
    tferrill@webuildits.com
    www.webuildits.com
    @tferrill/@webuildits
    ------------------------------



  • 5.  RE: Missing Attribute error on simple Automation Script

    Posted 2 days ago

    Hi Tim!

    How is this script being launched?  The thing that stands out to me is that you're fetching the INVENTORY MboSet via MXServer.  I have been told that it's generally better practice to use mbo.getMboSet() to fetch sets, because cleanup happens automatically.  An ancillary benefit is that the fetched set "knows where it belongs" in the hierarchy of objects.  Fetching INVENTORY "out of the blue" means that it is disconnected from parent and child sets, and so maybe there is some validation code looking for the TAXEXEMPT at the VENDOR level or other related set?...



    ------------------------------
    Jade Warren
    Great River Energy
    ------------------------------



  • 6.  RE: Missing Attribute error on simple Automation Script

    Posted 2 days ago

    Jade,

    I'm familiar with the concept. I'm executing this manually from the Automation Scripts app.

    The intent is for this to be a one-time data fix. Once I can get the basic script working error-free I'll be executing it against a larger set of records.



    ------------------------------
    Tim Ferrill
    Solutions Consultant
    Intelligent Technology Solutions
    tferrill@webuildits.com
    www.webuildits.com
    @tferrill/@webuildits
    ------------------------------