Hello to you all !
My problem is the following. I want to do a workaround for autoimporting FOB-s in Navision using a codeunit with WShell.SendKeys. All good 'till now. So I am able to open the Object Designer by the combination of Shift+F12. After that, any other combination of Keys with the WShell.SendKeys focuses on the Main page of Navision and not on the Object Designer. I need to change the focus of the SendKeys on the Object Designer so that I may be able to do a filter and import the FOB. I don't know if you get me right. I'm not an expert in Navision and I would very appreciate any idea or help. ¡Thank you so much! This is the code I use in the codeunit:
"
//VarRetVal:=0;
//VarRetVal:=SHELL('C:\Program Files (x86)\Microsoft Dynamics NAV\60\Classic\finsql.exe');
WaitForKeys := TRUE;
CLEAR(WShell);
IF ISCLEAR(WShell) THEN
IF NOT CREATE(WShell) THEN EXIT;
//WShell.AppActivate(VarRetVal);
WShell.Popup('Hasta aqui llega Gabi');
WShell.SendKeys('+{F12}',WaitForKeys); // Object Designer
WShell.Popup('After opening the Object Designer it doesn't go forward as I explained before');
//VarRetVal:=VARIABLEACTIVE(WShell.AppActivate());
//WShell.AppActivate(VarRetVal);
FOR I:=0 TO 10 DO BEGIN
SLEEP(250);
I+=1;
END;
CLEAR(WShell2);
IF ISCLEAR(WShell2) THEN
IF NOT CREATE(WShell2) THEN EXIT;
WShell2.SendKeys('%{a}',WaitForKeys);
//WShell.SendKeys('%{a}',WaitForKeys); // Object Designer
//WShell.SendKeys('+^{F7}',WaitForKeys); // clear filters
//WShell.SendKeys('{LEFT 12}',WaitForKeys);
//WShell.SendKeys('{RIGHT 7}',WaitForKeys);
//WShell.SendKeys('{F7}{n}',WaitForKeys);
//WShell.AppActivate(VarRetVal);
//FOR I:=0 TO 10 DO BEGIN
// SLEEP(100);
// I+=1;
//END;
//WShell.SendKeys('{n}{ENTER}');
//FOR I:=0 TO 10 DO BEGIN
// SLEEP(100);
// I+=1;
//END;
//WShell.SendKeys('^{a}');
//EXIT(TRUE);
"
*This post is locked for comments
I have the same question (0)