public void Provision(ClientContext ctx, ProvisioningTemplate template, ProvisioningTemplateApplyingInformation applyingInformation, TokenParser tokenParser, PnPMonitoredScope scope, string configurationData) { logger.Info("Entering the SiteFields provider"); try { // ---------------------------------------------- // Deserializes the configuration data // ---------------------------------------------- FieldsConfig configData = DeployerUtility.DeserializeProviderConfig <FieldsConfig>(configurationData); // ---------------------------------------------- // Loads the site collection and root web // ---------------------------------------------- using (SPSite site = new SPSite(ctx.Url)) { using (SPWeb web = site.OpenWeb()) { // ---------------------------------------------- // Loops through the <Fields> nodes // ---------------------------------------------- foreach (FieldConfig fieldConfig in configData.Fields) { SPField field = web.Fields.GetFieldByInternalName(fieldConfig.Name); // ---------------------------------------------- // Configures the field's title resource // ---------------------------------------------- field.ConfigureFieldTitleResource(fieldConfig.TitleResources); } } } } catch (Exception e) { throw new Exception(String.Format(ERROR_GENERAL, e.Message), e.InnerException); } }