I have two fields in a FORM layout.
For example, P2_INVOICE_ID, P2_VENDOR_ID
I want it to be "Display Only" when the User first enters the screen. There is a button "add row". When the user clicks this button, I want to make the P2_INVOICE_ID editable and want to attach a LOV to the P2_Vendor_id.
How do I achieve this?
Vinish Kapoor
I assume P2_INVOICE_ID is a text field and change the type of P2_VENDOR_ID as LOV and set its property accordingly.
Then create a dynamic action on Page Load to disable these two fields.
Create one more dynamic action on the button Add Row to enable these fields.
vn
When I 'disable' these fields, It does not appear on the screen at all. 🙁
When Page opens, I want these two Fields as Display Only/Read Only.
When the Button is clicked, I want this to be editable.
Thanks and appreciate you responding
vn
Ok. Figured it out. Sharing it here, just in case:
Step 1: Create a function in the Page - Function and Global Variable declaration.
function setReadOnly_processed(){
var item_invNum = document.getElementById('P29_INVOICE_NUM');
var value_Status = apex.item( "P29_PROCESSED_FLAG" ).getValue() ;
console.log('Value Status ' +value_Status) ;
if (value_Status != 'WORKING'){
console.log(' Making it RO');
item_invNum.readOnly = true;
}
else {
console.log(' Making it editable');
item_invNum.readOnly = false;
}
}
In the On-click/DA of P29_invoice_num, call Javascript - setReadOnly_processed();