Hi All… Can we call Funtion Keys (like F1,F2…) through programatically. Thanks in advance vikas
Nope, tell us what do you want to do. Often these keys call some codeunits so you can run the codeunits instead of emulating a key push
We want to delete a record in the sales order line on change of some status in a particular field. When doing this it is giving some error (“Line does not exist”). So we thought of calling function key F4, instead of deleting the record (Rec.delete). Help please
If you get an error like “Line does not exist” it is probably because you are either GET’ting an inexistent Sales Line or because you have filtered and tried to FIND an also inexistent Sales Line. The problem should be in the code where you search for the lines to delete, not on how you try to delete the lines.
The previsous guy is right. It is not documented, but I’m almost sure that F4 runs Record.DELETE, so if you can not delete it programmatically you would not succeed with F4 too
If u can’t run Record.DELETE F4 would not work. But anyway here u r, some code that lets u automate a keyboard ket. //----- CREATE(WHS); WHS.SendKeys(’{F3}’); CLEAR(WHS); //— WHS is een automation variable subtype: Windows Script Host Object Model and Classes: WshShell
For Alt-F1, try… WHS.SendKeys(’%{F1}’); Good luck
Here’s a link to msdn where you can see more of this http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsmthsendkeys.asp