Automatic Saving of an Invoice in Property Management software not working, can you help?

Here is the code, it won’t actually ‘save’ the PDF and rename it. Something happened and needed help.

{
“Name”: “test”,
“CreationDate”: “2024-10-1”,
“Commands”: [
{
“Command”: “store”,
“Target”: “fast”,
“Value”: “!replayspeed”,
“Description”: “”
},
{
“Command”: “store”,
“Target”: “true”,
“Value”: “!errorIgnore”,
“Description”: “Reset error ignore flag”
},
{
“Command”: “selectWindow”,
“Target”: “title=Yardi Systems, Inc. - Payable Invoice”,
“Value”: “”,
“Description”: “Try to select the window by title”
},
{
“Command”: “if”,
“Target”: “${!LastCommandOK} = false”,
“Value”: “skipLabel”,
“Description”: “Check if the last command was successful”
},
{
“Command”: “label”,
“Target”: “skipLabel”,
“Value”: “”,
“Description”: “Fallback to select the first tab if the previous command failed”
},
{
“Command”: “store”,
“Target”: “true”,
“Value”: “!errorIgnore”,
“Description”: “Enable error ignore”
},
{
“Command”: “selectWindow”,
“Target”: “tab=0”,
“Value”: “”,
“Description”: “Fallback to select the first tab if the previous command failed”
},
{
“Command”: “selectWindow”,
“Target”: “title=GIPayable”,
“Value”: “”,
“Description”: “Fallback to select the first tab if the previous command failed”
},
{
“Command”: “store”,
“Target”: “false”,
“Value”: “!errorIgnore”,
“Description”: “Enable error ignore”
},
{
“Command”: “end”,
“Target”: “”,
“Value”: “!errorIgnore”,
“Description”: “Reset error ignore flag”
},
{
“Command”: “click”,
“Target”: “id=YsiTabStrip1_tab1”,
“Value”: “”,
“Targets”: [
“id=YsiTabStrip1_tab1”,
“xpath=//*[@id="YsiTabStrip1_tab1"]”,
“xpath=//span[@id=‘YsiTabStrip1_tab1’]”,
“xpath=//div/div/span[2]”,
“css=#YsiTabStrip1_tab1”
],
“Description”: “”
},
{
“Command”: “storeText”,
“Target”: “css=#lblPayeeName_Label”,
“Value”: “payee”,
“Description”: “Store Payee Name”
},
{
“Command”: “storeValue”,
“Target”: “id=InvoiceNumber_TextBox”,
“Value”: “invoice”,
“Description”: “Store Invoice Number”
},
{
“Command”: “storeValue”,
“Target”: “id=Amount_TextBox”,
“Value”: “amount”,
“Description”: “Store Amount”
},
{
“Command”: “echo”,
“Target”: “Extracted Payee Name = ${payee}”,
“Value”: “”,
“Description”: “Echo Filtered Payee Name”
},
{
“Command”: “executeScript_Sandbox”,
“Target”: “var p = ${payee}.substring(0, ${payee}.indexOf(‘,’)); p = p.replace(/Facilities Maintenance/g, ‘Maintenance’); p = p.replace(/Floors/g, ‘Flrs’); p = p.replace(/P & M/g, ‘P&M’); p = p.toLowerCase().replace(/\b([a-z])/g, function(match) { return match.toUpperCase(); }); p = p.replace(/Hd/g, ‘HD’); p = p.replace(/Sq/g, ‘SQ’); p = p.replace(/The/g, ‘’).trim(); p = p.replace(/Group/g, ‘’).trim(); p = p.replace(/Company/g, ‘’).trim(); p = p.replace(/Inc./g, ‘’).trim(); p = p.replace(/Inc/g, ‘’).trim(); p = p.replace(/'S/g, "'s").trim(); return p.replace(/Llc/g, ‘’);”,
“Value”: “payee_filtered”,
“Description”: “Filter Payee Name up to comma”
},
{
“Command”: “echo”,
“Target”: “Extracted Payee Name = ${payee_filtered}”,
“Value”: “”,
“Description”: “Echo Filtered Payee Name”
},
{
“Command”: “echo”,
“Target”: “Extracted Invoice Number = ${invoice}”,
“Value”: “”,
“Description”: “Echo Invoice Number”
},
{
“Command”: “echo”,
“Target”: “Extracted Amount = ${amount}”,
“Value”: “”,
“Description”: “Echo Amount”
},
{
“Command”: “executeScript_Sandbox”,
“Target”: "var f = ${payee_filtered} + ’ - ’ + ${invoice} + ’ - $’ + ${amount} + ‘.pdf’; return f.replace(/ /g, ’ '); ",
“Value”: “filename”,
“Description”: “Concatenate to form filename”
},
{
“Command”: “onDownload”,
“Target”: “${filename}”,
“Value”: “30000”,
“Description”: “Wait up to 30 seconds for the download to complete”
},
{
“Command”: “store”,
“Target”: “true”,
“Value”: “!errorIgnore”,
“Description”: “Reset error ignore flag”
},
{
“Command”: “click”,
“Target”: “name=btnExportPDF”,
“Value”: “”,
“Description”: “Attempt to click the export button”
},
{
“Command”: “if”,
“Target”: “${!LastCommandOK} == false”,
“Value”: “breakLabel”,
“Description”: “Go to label if the last command (click) timed out”
},
{
“Command”: “label”,
“Target”: “breakLabel”,
“Value”: “”,
“Description”: “Label for break”
},
{
“Command”: “end”,
“Target”: “”,
“Value”: “”,
“Description”: “Label for break”
},
{
“Command”: “selectWindow”,
“Target”: “TAB=CLOSE”,
“Value”: “”,
“Description”: “Close the current tab”
}
]
}

V9.3.0 has a known issue, it does not wait for downloads to complete. We will fix this asap. Meanwhile you could use Ui.Vision for Edge or Firefox, which are still at V9.2.9.

1 Like

Thank you for the response, look forward to hearing back on the resolution!