Making certain fields: Cheque No. and Cheque Date non editable thru coding

Hi Team,

Please help about how to make certain fields are not editable field when I selected a dropdown list of Cash and E-Payment?

The picture of the page and code below:

CapturePV01.PNG

In the Global Variable, I have ChequeEditable As Boolean and PayMode As Record Pay Mode ( Table Name)

In added ChequeEditable to the field properties Editable but it is not working. What I want is when I choose Cheque from the dropdown, it should these fields Cheque No and Cheque Date?

Thanks

ONInit()
ChequeEditable := FALSE;


OnOpenPage()
IF PayMode.Code = 'CHEQUE' THEN 
  ChequeEditable := TRUE
ELSE
  ChequeEditable := FALSE;
  
  
OnAfterGetRecord()
IF PayMode.Code = 'CHEQUE' THEN 
  ChequeEditable := TRUE
ELSE
  ChequeEditable := FALSE;

Do you have some code that updates the variables when validating a new Pay Mode? Does it work when opening a page where the Pay Mode is set to CHEQUE?

Hi,

Would pls go through this below link,

It might be helpful,

www.cloudfronts.com/…/

You need to set CheckEditable to Cheque No. & Cheque date fields enable property

No, I don’t and Its not working. Thanks

I have set it under the editable properties of those fields.

I have done that approach. It only applicable to Option datatype not table dropdown.

Instead of OnAfterGetRecord then try to use OnAfterGetCurrRecord.