hclleapforum

Open full view…

Keypress to run code?

jonathanmorseusb
Mon, 09 Sep 2019 17:38:45 GMT

Wondering if anyone has tried to use keypress actions to run code? I have many custom dashboards where the user selects the table row and then has to scroll up or down to find the button to click to open the record. I am wondering why I couldn’t just use a listener to run my code when a user has selected a row and presses the correct key? I did a mock up but it is not working. I am a bit outside of my skill set on this one. Anyone have suggestion? On ALT keypress: //code in yellow is what I already have when folks select the row. It sets the correct values to that when they click the button (see green code) the url string can be called to open in a new window. item.setActive(false); if(item.getSelection() !== null) { form.getPage('P_NewPage1').F_SingleLine22.setValue(item.getSelection() .F_SingleLine17.getValue()); form.getPage('P_NewPage1').F_Button2.setVisible(true); } object.altKey = function() {open} onLoad: windows.myfunction = open (); { //Code in green is what runs now on my button click. See note above yellow. var URL1 = 'https://myserveredacted/forms /secure/org/app/appid/launch/index.html?form=formID&id='; var RecID = BO.F_SingleLine22.getValue(); var A = '<iframe name="Edit existing Service Call" src="'; var end = '" width="1150" height="1600" frameborder="0" scrolling="auto" class="frame-area"><body onload="self.scrollTo(0,0)"><body onload="top.scrollTo(0,0)"></iframe>'; form.getPage('P_NewPage2').F_HTMLArea1.setContent(A+URL1+RecID+end); form.selectPage("P_NewPage2"); form.getPage('P_NewPage1').F_Button2.setVisible(false); BO.F_SingleLine24.setValue(""); BO.F_DropDown1.setValue(""); BO.F_DropDown2.setValue(""); }