I have Header table and Lines table.
I have form from Header table with subform from Lines table.
Classic, wright.
The PK in Header table is DocNo.
The PK in Lines table is DocNo.,LineNo.
Form to subform link is DocNo.=FIELD(DocNo.)
How(and where and in what trigger) to auto fill subform DocNo. increment LineNo.
I used DocNo := GETFILTER(DocNo.) in OnNewRecord but I'm getting wierd results so.. :?:
Help.
Better to be critical then self-critical
0
Answers
PS.
I hope the fieldname is Document No. and not DocNo
Please follow the Navision guidlines....
SubForm:
Autosplitkey is ON
The DocNo doesn't get filled and the record is filltered out from subform.
When the code is in OnAfterGetRecord then the field is filled but the form is acting funny, filling all lines in subform and when I want to change something I get error that that LineNo allready exists.
PS.
DocNo is just for this posts.
It will be automatically Done.
Try Removing your codes.
Realy didn't know that, thx.
Header table PK = DocNo
Line table PK is DocNo, LineNo (must be integer type!)
Form with source table Header, and a form with source table line, don't think about subform yet. Set the Autosplitkey property of your line form to yes.
On your header form, create subform control and set the form id to the line form. In the formlink property you set the filter on Header.DocNo = FILTER(Line.DocNo).
This should take care of the auto numbering. There is no need for ANY coding at all.
RIS Plus, LLC
RIS Plus, LLC
But intentions were great. =D>
RIS Plus, LLC
The last field in the primary field must be an integer BigInteger, GUID or decimal field. If these conditions are met, you can set Autosplit key property to Yes.
Shilpa Reddy
Shilpa Reddy