Setting Visible properties

Is it possible to set an id on a form from a codeunit ? i.e. Change the property of the “Chart of Accounts” to VISIBLE := False

No, it also wouldn’t make sense. The codeunit is not aware of the form. What if the form is not open while the codeuinit is being run? If you want to set form-properties, do it within the form. That’s the only logical and possible location. ------- With best regards from Switzerland Marcus Fabian

I would only be running the codeunit on the OpenForm trigger, but I wanted the codeunit to go away and look at values in a table. I have completed the task I am trying to achieve, but I would have liked to place the code in one central location.i.e. a codeunit

quote:


Originally posted by Dean Axon: I would only be running the codeunit on the OpenForm trigger, but I wanted the codeunit to go away and look at values in a table. I have completed the task I am trying to achieve, but I would have liked to place the code in one central location.i.e. a codeunit


Which you can do Dean Put the code in a function in the Codeunit returning a Boolean field On the OpenForm just call the codunit IF NOT MyCodeUnit.CheckPermission(USERID) THEN ERROR(‘Sorry you do not have permission to run this form’); Or Just IF NOT MyCodeUnit.CheckPermission(USERID) THEN ERROR(’’); Will Close the form without the user knowing David Cox MindSource (UK) Limited Navision Solutions Partner Email: david@mindsource.co.uk Web: www.mindsource.co.uk