Make the fields read only on Time sheet Portal

poorva1
Giga Guru

Hi all,

 

We are using the Time sheet portal for the agents. 

The time is getting automatically entered for their tasks as I am using the time worked field on the form. So once they save the form they are working on, the time is getting auto saved in the time card.

 

The client wants to restrict the users from overwriting this value from the time sheet portal.

 

I am seeking some ideas on how I can achieve this. 

poorva1_0-1764291651698.png

 

So, if its

Core tasks - Agents should not be able to edit the time ( as it's getting auto populated from time worked field )

Others - Agents should be able to edit. 

 

@SanjivMeher - I saw few of your great answers on community on this topic and just checking if you can assist for this scenario.

 

Thanks,

Poorva

1 REPLY 1

lauri457
Giga Sage

On the Time Card Grid widget /sp_widget.do?sys_id=191df3b393332200ea933007f67ffbab: edit row 179 on the server script so that record.canEdit is falsy when you don't the double click edit to work.

//record.canEdit = gr.canWrite();
record.canEdit = (function () {
	return gr.getValue("something") === "somethingorother";
})();

This of course only works for this particular widget and not for example the form modal that you can open from the same page. If you want to restrict edits elsewhere maybe look into the acls for time_cards.