Hi i have this code below which was meant to setrange on a table and show a single record wit the the editable property of the form set No, but i am able to get the record but the editable remains true. if i am not setranginmg then all the records are shown with ediatble false. but the problem comes when i setrange. CLEAR(DocumentTypeForm); DocumentTypeForm.LOOKUPMODE(TRUE); DocumentTypeForm.EDITABLE(FALSE); DocumentType.RESET; DocumentType.SETRANGE(Code,DocTypeHeader.JOB); IF FORM.RUNMODAL(27002410, DocumentType) = ACTION :: LookupOK THEN BEGIN DocumentTypeForm.GETRECORD(DocumentType); Text := DocumentType.Code; EXIT(TRUE); END; thanx kumar
Hi, you `ve declared a variable DocumenttypeForm and set some properties. Then you are trying to run another instance of this form with other values in properties. short version: Try If DocumenttypeForm.RUNMODAL(Documenttype) = … cu, Olaf
Hi Olaf it doesnt work as u have suggested…we have to setrecord to the form as shown below table1.setrange(); form1.setrecord(table1); form1.settableview(table1) if form1.runmodal = action:: any how thanks kumar Edited by - mvgs on 2002 Jan 31 03:25:19
Well… you just need to take care of doing a clear on the form (or it will just open once from that form without leaving it…) and the settableview after filtering on the variable. After that, the runmodal… but the setrecord is not really needed. (Something i cannot understand is how you were before getting the right record you choose if you were making the getrecord on the non-shown form). Then for getting the selected record remember to use getrecord: CLEAR(DocumentTypeForm); DocumentTypeForm.LOOKUPMODE(TRUE); DocumentTypeForm.EDITABLE(FALSE); DocumentType.RESET; DocumentType.SETRANGE(Code,DocTypeHeader.JOB); DocumentTypeForm.SETTABLEVIEW(DocumentType); IF (DocumenttypeForm.RUNMODAL = ACTION::LookupOk) THEN BEGIN Documenttypeform.GETRECORD(Documenttype); … END; Alfonso Pertierra (Spain)apertierra@teleline.es