Form-invisible

on purchase line ,on one field i have lookup to budget form .But for some users i want to make all the fields invisible expcet one field on the budget form

is it possible?

Any help with the code?

You can write code OnOpenForm, but still user will be able to go to View → Show Column and view the field, to avoid this you can write code at OnAfterGetRecord, but writing there is not optimized, to avoid this you can use on list view form without the field, and this will utilize one object.

You can write code on the onaftergetrecord of the budget form. But if you want to limit the view on the form from purchase line only , then you have to pass variable to the form so that it only activate the code on the form when it is accessed from purchase line.