Deploying a Field Customizer
A Field Customizer is scoped at the field in a site. Similar to the previous sections, we will use scripts to add a Field Customizer to a field.
PnP PowerShell
The command needed for adding a Field Customizer to a field is as follows:
Set-PnPField - https://pnp.github.io/powershell/cmdlets/Set-PnPField.html
We need to specify the internal name of the field and the list where we want the customization. The following command will do this:
Set-PnPField -Identity packtProductStockLevel -List Products -Values @{ClientSideComponentId=[GUID]"2824bbec-56b9-4d95-acd3-3ac0e961e5cb"} With that, the Field Customizer gets associated with the Stock Level field.
CLI for Microsoft 365
The command to run would be as follows:
spo field set - https://pnp.github.io/cli-microsoft365/cmd/spo/field/field-set
In our case, the command would be similar to the following:
m365 spo field set --webUrl https://yourtenant.sharepoint.com/sites/Packt...