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

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.

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.