示例#1
0
        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);
            }
        }
示例#2
0
        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);
            }
        }