# how to make a field non editable in pages without using editable  property i.e by code

**URL:** <https://www.dynamicsuser.net/t/how-to-make-a-field-non-editable-in-pages-without-using-editable-property-i-e-by-code/60566>\
**Category:** Developers Forum\
**Created:** [April 29, 2016, 7:54am UTC](https://www.dynamicsuser.net/t/how-to-make-a-field-non-editable-in-pages-without-using-editable-property-i-e-by-code/60566 "2016-04-29T07:54:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ABG47](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@ABG47](https://www.dynamicsuser.net/u/ABG47)\
**Post date:** [April 29, 2016, 7:54am UTC](https://www.dynamicsuser.net/t/how-to-make-a-field-non-editable-in-pages-without-using-editable-property-i-e-by-code/60566/1 "2016-04-29T07:54:28Z")

</div>

In puchase order page i want to make vendor oder no. & vendor shipment no. non editable without using properties.

To be more precise when i select a particular vendor from buy from vendor no then only i will be able to edit vendor order & vendor shipment no. otherwise the field will be non editable.

---

<div class="post-metadata">

**Author:** ![postsaurav](https://avatars.discourse-cdn.com/v4/letter/p/ba8739/32.png) [@postsaurav](https://www.dynamicsuser.net/u/postsaurav)\
**Post date:** [April 29, 2016, 8:02am UTC](https://www.dynamicsuser.net/t/how-to-make-a-field-non-editable-in-pages-without-using-editable-property-i-e-by-code/60566/2 "2016-04-29T08:02:27Z")

</div>

Hi,

The Editable Property of the Field in page can be set/reset using a boolean variable.

1. Create a Boolean variables in the C/AL Global variables. (Variable Name - FieldEditable)
2. Assign that variable in Vendor Order and Vendor Shipment No. Field, Editable Property.
3. In OnOpen Page set the FieldEditable = FALSE.
4. In OnAfterGetRecord = If “Vendor No.” \<\> ‘’ THEN FieldEditable = TRUE.
5. In OnValidate of Vendor No. = If “Vendor No.” \<\> ‘’ THEN FieldEditable = TRUE

Hope it helps.
