Hello,
I have some small code crisis... ;-)
I need help with this problem:
I have form with table box connected to some table (record). Now, I need simulate F3 key (form is for some barcode reader which have no F3 button easy accesible). WHat is objective? After clicking on some button, new line is inserted on the end of the table box but this line is not inserted into table (is marked with *). I can't find any function, which insert new line in the table box through C/AL. I need to call OnNewRecord trigger on form etc...
Or simulate Mouse Click on new line in some field...
Thanks for any help.
Kamil Sacek
MVP - Dynamics NAV
My
BLOGNAVERTICA a.s.0
Comments
if whatever you are scanning is the same length you can set your MAXLENGTH of the field to whatever it is. Once the MAXLENGTH is reached it will pop the next line.
I hope that made sence? :roll:
http://www.BiloBeauty.com
http://www.autismspeaks.org
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
LineNo: integer
SalesLine : rec 37
CLEAR(SalesLine);
SalesLine.SETRANGE("Document Type","Document Type");
SalesLine.SETRANGE("Document No.","No.");
if SalesLine.FIND('+') THEN BEGIN
LineNo:= SalesLine."Line No."+10000;
END ELSE BEGIN
LineNo:=10000;
END;
CLEAR(SalesLine);
SalesLine.VALIDATE("Document No.","No.");
SalesLine.VALIDATE("Document Type","Document Type");
SalesLine.VALIDATE("Line No.","LineNo");
SalesLine.INSERT(TRUE);
Navision Developer/Consultant
Delta Elektronik Ltd.
Budapest
Hungary
miklos.hollender@delta.hu
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
you could also add several buttons as:
NEW: Calls MyRec.INIT
SAVE: save new/changed rec. and refreshes table-box.
DELETE: deletes current rec.
When selecting a rec in table box you display values of current rec also in tab control.
this tab control could be also on separate (new) window (that has no table behind) that opens only when pressing NEW button or MODIFY button...
I know it's not Navision standard, but...
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
http://www.mbsonline.org/forum/topic.asp?TOPIC_ID=12350
Just for other's that might find this thread:
On a tabular form I declared global automation for 'Windows Script Host Object Model'.WshShell.
Then used it on button: and it inserted a new line with * in front. (Of course calling CREATE(wshShell) should happen before calling SendKeys)
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
thanks RoberMo :-)
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
These online community things are great!
8)
Anybody any idea?
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
http://support.microsoft.com/default.as ... -us;210197
Do you need to sleep before/after the SendKeys (especially if the SendKeys is triggered with a keyboard shortcut)?
http://support.microsoft.com/default.as ... -us;138624
No sleep needed.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯