0

I have created a site column of type Single link of text, and i hide it from the New & Edit forms (and i am only populating its value inside a workflow) using this PnP script:-

$customfield.SetShowInEditForm($false)
$Context.ExecuteQuery()
$customfield.SetShowInNewForm($false)
$Context.ExecuteQuery()
$customfield.UpdateAndPushChanges($false)
$Context.ExecuteQuery()

but still the field will be editable when using the list's Quick Edit. Now in the classic UI, i use to create JSLINK and link it with the field which will cause the filed to be in Read-Only inside the quick edit grid. here is the JSLINK i use to have:-

function () {
    var overrideContext = {};
    overrideContext.Templates = overrideContext.Templates || {};
    overrideContext.Templates.OnPreRender = function(ctx) {
        var statusField = ctx.ListSchema.Field.filter(function(f) {
            return f.Name === 'ItemNumber';
        });
        if (statusField.length>0) {
            statusField[0].AllowGridEditing = false;
        }
    }
    SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideContext);
})();

but seems this approach will not work inside the modern UI. so can anyone advice on this? Can I take benefit from the column formatting capability?

0

Hi SharePoint TestDev,

You may have a try following methods:

1, Settings of the hidden field:

enter image description here

2, Another field is a calculated column

enter image description here

Only display calculated column in the list view and update hidden field in the workflow, then the value will map to calculated column and the user is not able to edit the calculated column in quick edit mode.

BR

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.