private void AgreementUpdate(LocalPluginContext context) { var svc = context.OrganizationService; var agreement = new Agreement(svc, context.PluginExecutionContext.InputParameters["Target"] as Entity); var preAgreement = new Agreement(svc, context.PreImage); if (agreement.StatusCode != null && (AgreementStage)agreement.StatusCode.Value == AgreementStage.SubmittedForApproval) { agreement.AssignAgreement(svc, agreement, preAgreement); } else if (agreement.EstimatedAnnualRevenue != null) { var statusCode = preAgreement.StatusCode; agreement.AssignAgreement(svc, agreement, preAgreement); } }
private void AgreementCreate(LocalPluginContext context) { var svc = context.OrganizationService; var agreement = new Agreement(svc, context.PluginExecutionContext.InputParameters["Target"] as Entity); if (agreement.StatusCode != null && (AgreementStage)agreement.StatusCode.Value == AgreementStage.SubmittedForApproval) { agreement.AssignAgreement(svc, agreement, agreement); } }