I’ve a problem, when I try to run a form. A form can be executed by the following properties: PushAction = RunObject RunObject = Form Customer Card RunFormLink = No.=CONST(10000) - the customer card is executed and there’s a filter, which shows only customer 10000. Hereby it’s not possible to use PageUp or PageDown to shift between other records in the customer table - I would like the same functionality when I use code to execute the form. I’ve tried: FormCustomer.SETTABLEVIEW(Rec); FormCustomer.SETRECORD(Rec); FormCustomer.RUN; The correct customer is shown, but in this way it’s possible to shift between records by PageDown and PageUp. What can I do to prevent this. Best regards Jan Kristensen
Rec.SETRECFILTER;
FORM.RUN(FORM::"Customer Card",Rec);
/Soren
By the way most Navision Card forms have a line of code in the OnAfterGetRec to remove a filter placed from the calling object i.e. SETRANGE(“No.”); Bill Benefiel Manager of Information Systems Overhead Door Company billb@ohdindy.com (317) 842-7444 ext 117
This will do: Rec.FILTERGROUP(2); Rec.SETRECFILTER; Rec.FILTERGROUP(0); FORM.RUN(FORM::“Customer Card”,Rec); Does anybody know the purpose of SETRANGE(“No.”) in the OnAfterGetRecord trigger? Reijer.
For the very purpose the listed above. Let’s say I have a customer I want to view on a Card form but, once there the user needs to move around all customers. That is the reason Navision includes it there. Bill Benefiel Manager of Information Systems Overhead Door Company billb@ohdindy.com (317) 842-7444 ext 117
Yes indeed, but where in standard Navision is the form opened with a filter on “No.” that can be removed? I cannot find it anywhere. Did our Danish friends only included this line so Navision will act better if a developer or user does something stupid or is there another reason?
Actually I thought the reason was to stop the error message of “Record already exists”. Try this: Remove the line of code:
OnAfterGetRecord()
// SETRANGE("No.");
then set a filter on Item No. Press F3 you will see that it is annoying to then get anywhere. _________________________ David Singleton Navision Consultant since 1991 dmks22@home.com___________
I have seen the light! When you have a filter on “No.”, lets say ‘A*’, and you add an article starting with a B the records disappears immediately. I nearly thought that Navision put in some code that has more disadvantages than benefits. How could I questioned them. Reijer.