set field as read-only after record is created

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
User avatar
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 347
Joined: 2018-03-04 09:30
Location: David

set field as read-only after record is created

Post by D Oliveira » 2018-03-22 00:00

how to set the 'Work Order ID' field to read-only after first the record is created?

R Tammam
Veteran Member
Posts: 113
Joined: 2017-08-26 15:35

Re: set field as read-only after record is created

Post by R Tammam » 2018-03-27 06:17

Hello D Oliveira,
here's an idea of what you can do ,

1- in before update hook function , you should retrieve the value you want it to be read only,
and after update reset it with the retrieved value , so you will guarantee that this value won't be changed

R Tammam
Veteran Member
Posts: 113
Joined: 2017-08-26 15:35

Re: set field as read-only after record is created

Post by R Tammam » 2018-03-27 06:23

2- in tablename-dv.js
check if selectedID has a value which means that is not a new record
add $j("yourelement").prop({ readOnly: true });

i hope this idea would help you
Regards ,
Reham

R Tammam
Veteran Member
Posts: 113
Joined: 2017-08-26 15:35

Re: set field as read-only after record is created

Post by R Tammam » 2018-03-27 16:43

Hello D Oliveira,
sorry for the first point , it's not true
i have another correct one ,
in the before update function there's a data array with the new values and the record id
1- check if the record id is that one you want it to be read only and if so
2- you will use the record id to retrieve old values
3- will will set the data array values(new values) with retrieved values (old values) that you want it to be readonly

Post Reply