• Welcome to the upgraded JDELIST forum and thank you for your patience.
    Please restrict discussions and issues regarding the new forum software to the Off Topic forum. We will be monitoring that forum for issues.
    If you have trouble logging in, please reset your password using the forgotten password form: https://www.jdelist.com/community/index.php?lost-password/
    If you are unable to successfully reset your password, please contact us: Click here!
    We hope that you enjoy the upgraded forum.
  • Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

JDE AIS invoke form exit

I am new to JDE as well as JDE AIS.

I am trying to execute the form P4314_W4314A to P4314_W4314B which this action can be done through clicking the form exit and the drop down menu Receipt to Match in JDE.
I can get the AIS control id for the form exit button, but I could not get the AIS control id for the form exit drop down menu. (I got the AIS control id by using item help in JDE).
Below was the code so far.
Code:
def VoucherMatching(i, main_path, res_path):
    tokenUrl = 'http://192.168.1.34:8090/jderest/tokenrequest'
    appstackUrl = 'http://192.168.1.34:8090/jderest/appstack'
    
    tokenData = {"username" : "train11", "password" : "train11", "environment" : "JDV920", "role" : "*ALL"}
    
    t = requests.post(tokenUrl, json = tokenData)
    
    sessionToken = t.json()['userInfo']['token']
    
   form = {
            "endpoint": "appstack",
            "token": sessionToken,
            "formName": "P4314_W4314A",
            "allowCache": True,
            "action": "open",
            "aliasNaming": True,
            "outputType": "VERSION2",
            "formRequest": {
                "formActions": [
                     {
                    "command": "SetControlValue",
                    "value": PurchaseOrderNumber,
                    "controlID": "488"
                    },
                    
                    
                    {
                    "command": "SetControlValue",
                    "value": SupplierNumber,
                    "controlID": "630"
                    },
                    
                    {
                    "command": "SetControlValue",
                    "value": InvoiceNumber,
                    "controlID": "54"
                    },
                    
                    {
                    "command": "SetControlValue",
                    "value": CompanyNumber,
                    "controlID": "78"
                    },
                    
                    {
                    "command": "SetControlValue",
                    "value": TotalAmount,
                    "controlID": "56"
                    },
                    
                    {
                    "command": "SetControlValue",
                    "value": InvoiceDate,
                    "controlID": "58"
                    },
                    
                    {
                    "command": "SetControlValue",
                    "value": GLDate,
                    "controlID": "60"
                    },
                    
                    {
                    "command": "SetControlValue",
                    "value": Currency,
                    "controlID": "86"
                    },
                    
                    #Invoke Form -> Receipt to Match
                    #{
                    #"command": "DoAction",
                    #"controlID": "617"
                    #},
                    
                    ],
                "formName": "P4314_W4314A",
                "version": "ZJDE0001",
                "formServiceAction": "R",
                "bypassFormServiceEREvent": True,
            },
            "stackId": 0,
            "stateId": 0
        }
        

        response = requests.post(appstackUrl, json = form)
        RID = r1["rid"]
        StackID = r1["stackId"]
        StateID = r1["stateId"]
       
    
    form2 = {
        "endpoint": "appstack",
        "token": sessionToken,
        "allowCache": True,
        "action": "execute",
        "aliasNaming": True,
        "outputType": "VERSION2",
        "actionRequest": {
            "formActions": [
               {
               "command": "SetControlValue",
                    "value": 30,
                    "controlID": "35"
                    },
                
                #search
                {
                "command": "DoAction",
                "controlID": "127"
                },
                
                #select all rows
                {
                    "command": "SelectRow",
                    "controlID": "1"
                },  
               
                #click ok
                {
                "command": "DoAction",
                "controlID": "12"
                },
                
                {
                "command": "DoAction",
                "controlID": "12"
                }

                ],
        "formOID": "W4314B",
        },
    "stackId": StackID,
    "stateId": StateID,
    "rid": RID
    }
    
    response2 = requests.post(appstackUrl, json = form2)
    RID = r2["rid"]
    StackID = r2["stackId"]
    StateID = r2["stateId"]
    
    #Return back to the form P4314_W4314A
    form3 = {
        "endpoint": "appstack",
        "token": sessionToken,
        "allowCache": True,
        "action": "execute",
        "aliasNaming": True,
        "outputType": "VERSION2",
        "actionRequest": {
            "formActions": [
                
                {
                "command": "DoAction",
                "controlID": "4"
                },
                
                {
                "command": "DoAction",
                "controlID": "4"
                }
                ],
        "formOID": "W4314A",
        },
    "stackId": StackID,
    "stateId": StateID,
    "rid": RID
    }
Any help will be appreciated.
 
You can get that in Object Management Workbench (OMW). Start the Form Design Aid tool for P4314, and make sure your View settings have "Application Tree View" and Property Browser" checked. Click on
the control in the tree view, and the Control ID is one of the properties in the property browser pane. Another resource is the wonderful PatWel tool "ObjectBrowser". In your case, the "Receipts To Match" control ID = 614.
 
Top