Example #1
0
        protected override void Execute(CodeActivityContext context)
        {
            // Create a Lead class and populate it with the input arguments
            Lead l = new Lead();

            l.ContactName  = ContactName.Get(context);
            l.ContactPhone = ContactPhone.Get(context);
            l.Interests    = Interests.Get(context);
            l.Comments     = Notes.Get(context);
            l.WorkflowID   = context.WorkflowInstanceId;
            l.Status       = "Open";

            // Add this to the work queue to be persisted later
            PersistLead persist = context.GetExtension <PersistLead>();

            persist.AddLead(l, "Insert");

            // Store the request in the OutArgument
            Lead.Set(context, l);

            // Add a custom track record
            CustomTrackingRecord userRecord = new CustomTrackingRecord("New Lead")
            {
                Data =
                {
                    { "Name",  l.ContactName  },
                    { "Phone", l.ContactPhone }
                }
            };

            // Emit the custom tracking record
            context.Track(userRecord);
        }
Example #2
0
        protected override void Execute(CodeActivityContext context)
        {
            Lead l = Lead.Get(context);

            l.AssignedTo = AssignedTo.Get(context);
            l.Status     = "Assigned";

            PersistLead persist = context.GetExtension <PersistLead>();

            persist.AddLead(l, "Update");

            // Store the request in the OutArgument
            Lead.Set(context, l);
        }