Ng Yan Yan
Member
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.
Any help will be appreciated.
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.