Make certain subform entries read only

Make certain subform entries read only

Hi all

I need to make specific entries on a subform to be read only for portal users.

Ive added a field to my subform called 'read only' which is a picklist with the values of Yes and No. Ive set this field to be hidden as its only to be used in the function which make that specific entry to be read only. (I presume this is whats needed).

The function should fire when a new record is created in the parent module.

What would be the deluge script for this function please?

My current code is:

  1. recordDetails = zoho.crm.getRecordById("My_Module", My_Module_ID);
  2. subformEntries = recordDetails.get("My_Subform");
  3. for each  entry in subformEntries
  4. {
  5. rowMakeReadOnly = entry.get("Make read only");
  6. if(rowMakeReadOnly == "Yes")
  7. {
  8. // make this row of fields read only
  9. }
  10. }

Thanks