Hello, I make some change on customer card. On this form, I add a subform to display comment. It’s ok. You can add comment at the end of the list But, when you go to a customer with a big lot of comment, you see always the first comment of the list. I want to automatically see last entered comment. I try some possiblity : - Table placement of subform : It’s good for first customer displayed at open, but not when you go to another customer - Find(’+’) in a procedure ‘refresh’ called from parent form with onaftergetcurrrecord => some time, navision would rename a record - on subform, I try to set a tableview with descending order => some problem with autosplitkey Do you have a good idea?? Thx
try something like currform.subform.find(’+’) in the OnAfterGetRecord or OnAfterGetCurrRecord-Trigger
In the SubForm controls “SubFormView” property, you could choose Order=Descending. The down side is multi-line comments will have to be read “up” the screen instead of down.
Try the following: in Form 124 - OnAfterGetCurrRecord: Define local var CommentLine as Record “Comment Line”
IF NOT CurrForm.ACTIVE THEN BEGIN CommentLine.SETRANGE("Table Name","Table Name"); CommentLine.SETRANGE("No.","No."); IF CommentLine.FIND('+') THEN Rec := CommentLine; END; Remember that this form works for vendors and other tables as well. You might want to distinguish that with an IF-Statement on “Table No.”. The CurrForm.Active is necessary because otherwise you won’t be able to navigate in the form.
Sorry, just saw, that you work on a subform, not on form 124. Then my suggestion might be a start-off, but more modifications probably are necessary. Happy try!
Hi all Maybe select the option “last” in the SourceTablePlacement in the properties for the subform
Solution from Beaver works good Thx