Maximo Open Forum

 View Only
  • 1.  Issue current item automation script problem

    Posted 06-03-2022 11:19
    Hello,
    How can we write the value in the field I added in the material output operation to the field in the matusetrans table?

    owner= mbo.getOwner()

    if owner and owner.getRecordMboName()=="INVENTORY":
    issueitemMbo=owner.getMboSet("ISSUECURRENTITEM").getMbo(0)
    if issueitemMbo:
    mbo.setValue("MATUSETRANSFIELD", issueitemMbo.getString("ISSUECURRENTITEMFIELD"))


    We did the following steps. But the code is not working

    1) Add your fields to ISSUECURRENTITEM object using Database configuration

    2) Go to application designer and open Inventory (INVENTOR) application.

    3) Click 'Edit Dialogs' from the toolbar

    4) Open Dialog - ISSUE (Label:Issue Current Item)

    5) Add the field you configured in the database to the dialog as you like.



    #Customizations

    ------------------------------
    Aliriza Canakci
    Is Merkezleri Yönetim ve İşletim A.S
    ------------------------------


  • 2.  RE: Issue current item automation script problem

    Posted 06-06-2022 03:16
    How we can solve this problem ? No response has been received for 2 days. Can you help us on this issue?

    ------------------------------
    Aliriza Canakci
    Is Merkezleri Yönetim ve İşletim A.S
    ------------------------------



  • 3.  RE: Issue current item automation script problem

    Posted 06-06-2022 08:16
    What launch point are you using for this script? Object, action, etc.

    Are you expecting the field to be set after clicking "OK" on the dialog (so when the item is issued)? What happens instead - is there an error or does the field just not get set?

    ------------------------------
    Danielle Newhouse
    ------------------------------



  • 4.  RE: Issue current item automation script problem

    Posted 06-06-2022 08:42
    Hello ,
    Thank you for your support Danielle.

    We have set the script as an object. We have added a field to the Dialog screen. I want the value entered in this field to be written to the ITIN1 field in the matusetrans table.The Issuecurrentitem table is a temporary table. We choose the matusetrans table as the launch point object. After saving, we want the operation to take place.

    ------------------------------
    Aliriza Canakci
    Is Merkezleri Yönetim ve İşletim A.S
    ------------------------------



  • 5.  RE: Issue current item automation script problem

    Posted 06-06-2022 11:00
    1. Make a non-persistent attribute ( let's say newAttribute) in ISSUECURRENTITEM object.
    2. Display it in the dialog using application desinger.
    3. Make an object launch point: MATUSETRANS, Action: Add before Save, with the below code. 
    owner= mbo.getOwner()
    if owner and owner.getRecordMboName()=="INVENTORY": 
        issueitemMbo=owner.getMboSet("ISSUECURRENTITEM").getMbo(0) 
    if issueitemMbo: 
        mbo.setValue("ITIN1", issueitemMbo.getString("newAttribute"))


    ------------------------------
    Abdul Qadeer
    MACC
    ------------------------------



  • 6.  RE: Issue current item automation script problem

    Posted 06-07-2022 02:55
    Hello,
    Thank you for your support Abdul.

    The code we wrote is the same. But it does not wrote the value in the ITIN1 field. The value appears to be null. We did not write the Object Event Condition while creating the launch point. Do we need to write Object Event Condition? I will check the logs.

    The code does not give an error? So why doesn't it work?




    ------------------------------
    Aliriza Canakci
    Is Merkezleri Yönetim ve İşletim A.S
    ------------------------------



  • 7.  RE: Issue current item automation script problem

    Posted 06-07-2022 08:42
    non perstent won't handle save because non persistent isn't saved itself (because it is non persistent. 
    Can you hook it to an event on a button?

    ------------------------------
    Jeff Kish
    interloc solutions
    ------------------------------



  • 8.  RE: Issue current item automation script problem

    Posted 06-07-2022 09:17
    Also, I'd be careful about using ITIN1 as your destination. I'm pretty sure some legacy coding is still in place, that has behind-the-scenes data crossovers from

    ITEM.IN19 --> PRLINE.RLIN1 --> POLINE.PLIN1 --> MATUSETRANS.ITIN1
    and
    INVOICELINE.INVOICELIN1 --> INVOICECOST.ICT1 --> MATUSETRANS.ITIN1

    and was used in the Oracle Financials integration adapter.

    ------------------------------
    Travis Herron
    Pensacola Christian College
    ------------------------------



  • 9.  RE: Issue current item automation script problem

    Posted 06-08-2022 06:04
    Thank you very much to everyone for their support.
    I solved the problem. I was able to wrote the value in the field I added to the ISSUECURRENTITEM table to the MATUSETRANS table.
    As the Object Launch Point, it is necessary to create and run the automation script before saving it. Also, I have shown the quantity class as a class in the SALE field.
    Launch Point:  You must Before Save 

    The working code is below.

    owner= mbo.getOwner()

    if owner and owner.getRecordMboName()=="INVENTORY":
    issueitemMbo=owner.getMboSet("ISSUECURRENTITEM").getMbo(0)
    if issueitemMbo:
    mbo.setValue("ITIN1",issueitemMbo.getDouble("SALE"))
    mbo.save()
    logger = service.getLogger("maximo.mxdev")
    #logger = MXLoggerFactory.getLogger("maximo.mxdev")

    logger.info("RUNNING STEP")

    ------------------------------
    Aliriza Canakci
    Is Merkezleri Yönetim ve İşletim A.S
    ------------------------------



  • 10.  RE: Issue current item automation script problem

    Posted 06-08-2022 08:46
    Great. Yes Add before save event.

    ------------------------------
    Abdul Qadeer
    KUAST, KSA
    ------------------------------