View-only forms

I have card type form whose source table is ‘Group’. The table has records. When the form is opened, the user should not be able to add or delete records from the table. But he should be able to view the records by using the navigation buttons or by entering the Group No. which is the primary key. If I set the source for the textbox the primary key of the table(Group No.) I have problem when user enters the Group NO. It says ‘Record Already Exists’. So I used a global var.(GroupNo) as the source for textbox and in the onValidate trigger I added: Rec.GET(GroupNo); This works except that when I use the navigatin buttons, the details on the form are refreshed but the textbox for Group No. still remains the same. If I say: GroupNo := “No.”; currForm.UPDATE(FALSE); in the OnFindRecord trigger of form it gives error when running form that the frequency of function call is too high. Please help! Pari Somasundaram.

Change it back to the “normal” field, and just make the field non-editable. This will cause Navision to do a search when you type in the field. /Soren

If users aren’t supposed to change any of the data (you only mentioned not adding and not deleting), you could set the whole form to Edit = No, rather than just the key field. Dave Studebaker das@libertyforever.com Liberty Grove Software A Navision Services Partner

Hi Paris, try it with GroupNo := “No.”; in the OnAfterGetRecord-Trigger. This should work. Greeting, Frank

quote:


Originally posted by paris: I have card type form whose source table is ‘Group’. The table has records. When the form is opened, the user should not be able to add or delete records from the table. But he should be able to view the records by using the navigation buttons or by entering the Group No. which is the primary key. If I set the source for the textbox the primary key of the table(Group No.) I have problem when user enters the Group NO. It says ‘Record Already Exists’. So I used a global var.(GroupNo) as the source for textbox and in the onValidate trigger I added: Rec.GET(GroupNo); This works except that when I use the navigatin buttons, the details on the form are refreshed but the textbox for Group No. still remains the same. If I say: GroupNo := “No.”; currForm.UPDATE(FALSE); in the OnFindRecord trigger of form it gives error when running form that the frequency of function call is too high. Please help! Pari Somasundaram.


If the users are not suppossed to modify in any way the records, use the Editable property of the form and turn it to false. If users are not allowed to delete records, set the property deleteallowed on the form to false. If the users are not allowed to insert records, set the property Insertallowed on the form to false. If the users are not allowed to modify records, set Modifyallowed on the form to false. Regards Alfonso Pertierra (Spain)apertierra@teleline.es