If you need to insert some values into realted table which is connected through Line No., you can do it like Dimension management on sales line. You can select Dimension in Shortcut dimension 1 on the line when you do not know the line no. It is saved in temporary table in the Dim. management codeunit, and in OnInsert the temporary record is saved into permanent table...
You best use DelayedInsert=Yes.
In the field where you need to know the Line No, in the OnAfterValidate-trigger of the field in the form, you have to put "Currform.SAVERECORD". This function will insert or modify (the function knows what it has the do) the record and you have "Line No.".
Negative is that all the code you need has to be put in the form, because the table-onvalidate triggers first.
Regards,Alain Krikilion No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I need to know "Line No." when I validate(in table) other field in the same record (which already not exist because i don't leave the record)
I solve this temporary with:
DelayedInsert:=No;
OnOpen
MyVar:=1;
OnTimer
If MyVar=1 THEN
"No.".Activate;
MyVar:=0;
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
In the field where you need to know the Line No, in the OnAfterValidate-trigger of the field in the form, you have to put "Currform.SAVERECORD". This function will insert or modify (the function knows what it has the do) the record and you have "Line No.".
Negative is that all the code you need has to be put in the form, because the table-onvalidate triggers first.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!