Make lookup field readonly after insert

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
ltlow
Posts: 15
Joined: 2021-07-29 09:37

Make lookup field readonly after insert

Post by ltlow » 2021-08-26 04:49

I have a table name quotation and have a lookup field name code. I want to make this lookup field(code) readonly after insert the record, so I try to add this code to my quotation-dv.js but it didn't work.

if($j('[name=SelectedID]').val().length) {
$j(function(){
$j('#code-container').select2('readonly', true);
})
}

Strange thing is when I try this code in my chrome console, it does work. But there is another problem, user still can use the + button to add new record to code lookup field and it auto change the value to the newly add record. Is any way to hide/make this button readonly also?
Attachments
Capture.PNG
Capture.PNG (8.6 KiB) Viewed 1098 times

Post Reply