Example #1
0
        private void OpportunityCreate(LocalPluginContext context)
        {
            var svc         = context.OrganizationService;
            var opportunity = new Opportunity(svc, context.PluginExecutionContext.InputParameters["Target"] as Entity);

            //var preOpportunity = new Opportunity(svc, context.PreImage);

            opportunity.AssignOpportunity(svc, opportunity, opportunity);
        }
Example #2
0
        private void OpportunityUpdate(LocalPluginContext context)
        {
            var svc            = context.OrganizationService;
            var opportunity    = new Opportunity(svc, context.PluginExecutionContext.InputParameters["Target"] as Entity);
            var preOpportunity = new Opportunity(svc, context.PreImage);

            if (opportunity.ThirdLevelLob != null || opportunity.SecondLevelTerritory != null || opportunity.EstimatedAnnualRevenue != null)
            {
                opportunity.AssignOpportunity(svc, opportunity, preOpportunity);
            }
        }