I have old plugins used to create some records on some conditions.
whenever I add new code or create new plugin or Custom step in C# it just run with no error and don't work on the form.
QueryExpression query = new QueryExpression(); query.EntityName = "inn_commissionsettings"; var CommissionSettings = service.RetrieveMultiple(query); tracingService.Trace("Retrieved the Commission Settings"); if (CommissionSettings != null) { foreach (var CommissionSetting in CommissionSettings.Entities) { tracingService.Trace("entered the loop"); Entity ContractCommission = new Entity("inn_contractcommission"); ContractCommission["inn_contract"] = new EntityReference(this.CurrentEntity.Get(executionContext).LogicalName, this.CurrentEntity.Get(executionContext).Id); tracingService.Trace("inn_contract done"); ContractCommission["inn_commissionsetting"] = new EntityReference(CommissionSetting.LogicalName, CommissionSetting.Id); tracingService.Trace("inn_commissionsetting done"); ContractCommission["inn_commissiontype"] = CommissionSetting.GetAttributeValue<OptionSetValue>("inn_type"); tracingService.Trace("inn_commissiontype done"); var currentEntity = service.Retrieve(this.CurrentEntity.Get(executionContext).LogicalName, this.CurrentEntity.Get(executionContext).Id, new ColumnSet(true)); ContractCommission["inn_unit"] = currentEntity.GetAttributeValue<EntityReference>("inn_unit"); tracingService.Trace("inn_unit done"); try { service.Create(ContractCommission); } catch(Exception ex) { throw new InvalidPluginExecutionException("error " + ex); }