public Protocols.ToolkitResultProtocol AcceptActionItem(System.String actionItemIDNum)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session );

            return new Protocols.ToolkitResultProtocol( toolkit.AcceptActionItem(actionItemIDNum) );
        }
        public Protocols.ToolkitResultProtocol AcceptActionItem(Protocols.Sales.AcceptActionItemSetupProtocol setupParam)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session );
            FChoice.Toolkits.Clarify.Sales.AcceptActionItemSetup setup;

            switch( setupParam.ConstructorCue )
            {
                case 0:
                    setup = new FChoice.Toolkits.Clarify.Sales.AcceptActionItemSetup(setupParam.ActionItemIDNum);
                    break;
                default:
                    throw new InvalidOperationException(string.Format("Constructor index '{0}' does not exist.", setupParam.ConstructorCue));
            }

            if( Global.IsPropertyDirty(1, setupParam.DirtyFieldFlags) )
            {
                setup.ActionItemIDNum = setupParam.ActionItemIDNum;
            }

            if( Global.IsPropertyDirty(2, setupParam.DirtyFieldFlags) )
            {
                setup.AcceptDate = setupParam.AcceptDate;
            }

            if( Global.IsPropertyDirty(4, setupParam.DirtyFieldFlags) )
            {
                setup.WipBin = setupParam.WipBin;
            }

            if( Global.IsPropertyDirty(8, setupParam.DirtyFieldFlags) )
            {
                setup.UserName = setupParam.UserName;
            }

            if( Global.IsPropertyDirty(16, setupParam.DirtyFieldFlags) )
            {
                setup.GenerateTimeBombs = setupParam.GenerateTimeBombs;
            }

            return new Protocols.ToolkitResultProtocol( toolkit.AcceptActionItem(setup) );
        }
        public Protocols.ToolkitResultProtocol ChangeActionItemCondition(System.String actionItemIDNum, System.String newcondition)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session );

            return new Protocols.ToolkitResultProtocol( toolkit.ChangeActionItemCondition(actionItemIDNum, newcondition) );
        }
        public Protocols.ToolkitResultProtocol AssignLead(Protocols.Sales.AssignLeadSetupProtocol setupParam)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session );
            FChoice.Toolkits.Clarify.Sales.AssignLeadSetup setup;

            switch( setupParam.ConstructorCue )
            {
                case 0:
                    setup = new FChoice.Toolkits.Clarify.Sales.AssignLeadSetup(setupParam.LeadObjid, setupParam.NewOwner);
                    break;
                default:
                    throw new InvalidOperationException(string.Format("Constructor index '{0}' does not exist.", setupParam.ConstructorCue));
            }

            if( Global.IsPropertyDirty(1, setupParam.DirtyFieldFlags) )
            {
                setup.LeadObjid = setupParam.LeadObjid;
            }

            if( Global.IsPropertyDirty(2, setupParam.DirtyFieldFlags) )
            {
                setup.NewOwner = setupParam.NewOwner;
            }

            if( Global.IsPropertyDirty(4, setupParam.DirtyFieldFlags) )
            {
                setup.AssignDate = setupParam.AssignDate;
            }

            if( Global.IsPropertyDirty(8, setupParam.DirtyFieldFlags) )
            {
                setup.GenerateTimeBombs = setupParam.GenerateTimeBombs;
            }

            return new Protocols.ToolkitResultProtocol( toolkit.AssignLead(setup) );
        }
        public Protocols.ToolkitResultProtocol CreateQuote(System.String quoteTitle)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session );

            return new Protocols.ToolkitResultProtocol( toolkit.CreateQuote(quoteTitle) );
        }
        public Protocols.ToolkitResultProtocol CreateLead(System.String state, System.String country, System.String timeZone, FChoice.Toolkits.Clarify.LeadSiteType siteType, System.String leadSource)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session );

            return new Protocols.ToolkitResultProtocol( toolkit.CreateLead(state, country, timeZone, siteType, leadSource) );
        }
        public Protocols.ToolkitResultProtocol CreateActionItem()
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session );

            return new Protocols.ToolkitResultProtocol( toolkit.CreateActionItem() );
        }
        public Protocols.ToolkitResultProtocol ChangeQuoteStatus(System.String quoteIDNum)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session );

            return new Protocols.ToolkitResultProtocol( toolkit.ChangeQuoteStatus(quoteIDNum) );
        }
        public Protocols.ToolkitResultProtocol LogLeadPhone(Protocols.Sales.LogLeadPhoneSetupProtocol setupParam)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session );
            FChoice.Toolkits.Clarify.Sales.LogLeadPhoneSetup setup;

            switch( setupParam.ConstructorCue )
            {
                case 0:
                    setup = new FChoice.Toolkits.Clarify.Sales.LogLeadPhoneSetup(setupParam.LeadObjid, setupParam.ContactFirstName, setupParam.ContactLastName, setupParam.ContactPhone, TimeSpan.FromSeconds(setupParam.Duration));
                    break;
                default:
                    throw new InvalidOperationException(string.Format("Constructor index '{0}' does not exist.", setupParam.ConstructorCue));
            }

            if( Global.IsPropertyDirty(1, setupParam.DirtyFieldFlags) )
            {
                setup.LeadObjid = setupParam.LeadObjid;
            }

            if( Global.IsPropertyDirty(2, setupParam.DirtyFieldFlags) )
            {
                setup.Notes = setupParam.Notes;
            }

            if( Global.IsPropertyDirty(4, setupParam.DirtyFieldFlags) )
            {
                setup.InternalUseOnlyNotes = setupParam.InternalUseOnlyNotes;
            }

            if( Global.IsPropertyDirty(8, setupParam.DirtyFieldFlags) )
            {
                setup.ContactFirstName = setupParam.ContactFirstName;
            }

            if( Global.IsPropertyDirty(16, setupParam.DirtyFieldFlags) )
            {
                setup.ContactLastName = setupParam.ContactLastName;
            }

            if( Global.IsPropertyDirty(32, setupParam.DirtyFieldFlags) )
            {
                setup.ContactPhone = setupParam.ContactPhone;
            }

            if( Global.IsPropertyDirty(64, setupParam.DirtyFieldFlags) )
            {
                setup.ActionType = setupParam.ActionType;
            }

            if( Global.IsPropertyDirty(128, setupParam.DirtyFieldFlags) )
            {
                setup.LogDate = setupParam.LogDate;
            }

            if( Global.IsPropertyDirty(256, setupParam.DirtyFieldFlags) )
            {
                setup.Duration = TimeSpan.FromSeconds(setupParam.Duration);
            }

            if( Global.IsPropertyDirty(512, setupParam.DirtyFieldFlags) )
            {
                setup.UserName = setupParam.UserName;
            }

            if( Global.IsPropertyDirty(1024, setupParam.DirtyFieldFlags) )
            {
                setup.GenerateTimeBombs = setupParam.GenerateTimeBombs;
            }

            return new Protocols.ToolkitResultProtocol( toolkit.LogLeadPhone(setup) );
        }
        public Protocols.ToolkitResultProtocol LogLeadPhone(System.Int32 leadObjid, System.String contactFirstName, System.String contactLastName, System.String contactPhone, System.Int32 duration)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session );

            return new Protocols.ToolkitResultProtocol( toolkit.LogLeadPhone(leadObjid, contactFirstName, contactLastName, contactPhone, TimeSpan.FromSeconds(duration)) );
        }
        public Protocols.ToolkitResultProtocol LogLeadNote(System.Int32 leadObjid)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session );

            return new Protocols.ToolkitResultProtocol( toolkit.LogLeadNote(leadObjid) );
        }
        public Protocols.ToolkitResultProtocol ForwardActionItem(System.String actionItemIDNum, System.String newQueue)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session );

            return new Protocols.ToolkitResultProtocol( toolkit.ForwardActionItem(actionItemIDNum, newQueue) );
        }
        public Protocols.ToolkitResultProtocol DispatchQuote(System.String quoteIDNum, System.String queue)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session );

            return new Protocols.ToolkitResultProtocol( toolkit.DispatchQuote(quoteIDNum, queue) );
        }
        public Protocols.ToolkitResultProtocol CreateQuoteLineItem(Protocols.Sales.CreateQuoteLineItemSetupProtocol setupParam)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session );
            FChoice.Toolkits.Clarify.Sales.CreateQuoteLineItemSetup setup;

            switch( setupParam.ConstructorCue )
            {
                case 0:
                    setup = new FChoice.Toolkits.Clarify.Sales.CreateQuoteLineItemSetup(setupParam.ContractIDNum, setupParam.PartNumber, setupParam.PartDomain, setupParam.PartRevision, setupParam.Quantity, setupParam.PriceSchedule, setupParam.ParentLineItemObjid);
                    break;
                case 1:
                    setup = new FChoice.Toolkits.Clarify.Sales.CreateQuoteLineItemSetup(setupParam.ContractIDNum, setupParam.PartNumber, setupParam.PartDomain, setupParam.PartRevision, setupParam.PriceSchedule, setupParam.SerialNumber, setupParam.ParentLineItemObjid);
                    break;
                default:
                    throw new InvalidOperationException(string.Format("Constructor index '{0}' does not exist.", setupParam.ConstructorCue));
            }

            if( Global.IsPropertyDirty(1, setupParam.DirtyFieldFlags) )
            {
                setup.ContractIDNum = setupParam.ContractIDNum;
            }

            if( Global.IsPropertyDirty(2, setupParam.DirtyFieldFlags) )
            {
                setup.UserName = setupParam.UserName;
            }

            if( Global.IsPropertyDirty(4, setupParam.DirtyFieldFlags) )
            {
                setup.CreateDate = setupParam.CreateDate;
            }

            if( Global.IsPropertyDirty(8, setupParam.DirtyFieldFlags) )
            {
                setup.StartDate = setupParam.StartDate;
            }

            if( Global.IsPropertyDirty(16, setupParam.DirtyFieldFlags) )
            {
                setup.EndDate = setupParam.EndDate;
            }

            if( Global.IsPropertyDirty(32, setupParam.DirtyFieldFlags) )
            {
                setup.PartNumber = setupParam.PartNumber;
            }

            if( Global.IsPropertyDirty(64, setupParam.DirtyFieldFlags) )
            {
                setup.PartDomain = setupParam.PartDomain;
            }

            if( Global.IsPropertyDirty(128, setupParam.DirtyFieldFlags) )
            {
                setup.PartRevision = setupParam.PartRevision;
            }

            if( Global.IsPropertyDirty(256, setupParam.DirtyFieldFlags) )
            {
                setup.Quantity = setupParam.Quantity;
            }

            if( Global.IsPropertyDirty(512, setupParam.DirtyFieldFlags) )
            {
                setup.PriceSchedule = setupParam.PriceSchedule;
            }

            if( Global.IsPropertyDirty(1024, setupParam.DirtyFieldFlags) )
            {
                setup.OverridePrice = setupParam.OverridePrice;
            }

            if( Global.IsPropertyDirty(2048, setupParam.DirtyFieldFlags) )
            {
                setup.UnitsUsed = setupParam.UnitsUsed;
            }

            if( Global.IsPropertyDirty(4096, setupParam.DirtyFieldFlags) )
            {
                setup.SerialNumber = setupParam.SerialNumber;
            }

            if( Global.IsPropertyDirty(8192, setupParam.DirtyFieldFlags) )
            {
                setup.IsTaxable = setupParam.IsTaxable;
            }

            if( Global.IsPropertyDirty(16384, setupParam.DirtyFieldFlags) )
            {
                setup.AutoInstall = setupParam.AutoInstall;
            }

            if( Global.IsPropertyDirty(32768, setupParam.DirtyFieldFlags) )
            {
                setup.Comments = setupParam.Comments;
            }

            if( Global.IsPropertyDirty(65536, setupParam.DirtyFieldFlags) )
            {
                setup.QuotedSiteIDNum = setupParam.QuotedSiteIDNum;
            }

            if( Global.IsPropertyDirty(131072, setupParam.DirtyFieldFlags) )
            {
                setup.ServicedAtSiteIDNum = setupParam.ServicedAtSiteIDNum;
            }

            if( Global.IsPropertyDirty(262144, setupParam.DirtyFieldFlags) )
            {
                setup.ParentLineItemObjid = setupParam.ParentLineItemObjid;
            }

            if( Global.IsPropertyDirty(524288, setupParam.DirtyFieldFlags) )
            {
                setup.POIDNum = setupParam.POIDNum;
            }

            if( Global.IsPropertyDirty(1048576, setupParam.DirtyFieldFlags) )
            {
                foreach(Protocols.AdditionalFieldProtocol field in setupParam.AdditionalFields){setup.AdditionalFields.Append( field.FieldName, field.FieldType, field.FieldValue);}
            }

            return new Protocols.ToolkitResultProtocol( toolkit.CreateQuoteLineItem(setup) );
        }
        public Protocols.ToolkitResultProtocol CreateQuoteLineItem(System.String contractIDNum, System.String partNumber, System.String partDomain, System.String partRevision, System.String priceSchedule, System.String serialNumber, System.Int32 parentLineItemObjid)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session );

            return new Protocols.ToolkitResultProtocol( toolkit.CreateQuoteLineItem(contractIDNum, partNumber, partDomain, partRevision, priceSchedule, serialNumber, parentLineItemObjid) );
        }
        public Protocols.ToolkitResultProtocol MoveQuote(System.String quoteIDNum, System.String newWipBin)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session );

            return new Protocols.ToolkitResultProtocol( toolkit.MoveQuote(quoteIDNum, newWipBin) );
        }
        public Protocols.ToolkitResultProtocol ChangeOpportunityStatus(Protocols.Sales.ChangeOpportunityStatusSetupProtocol setupParam)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session );
            FChoice.Toolkits.Clarify.Sales.ChangeOpportunityStatusSetup setup;

            switch( setupParam.ConstructorCue )
            {
                case 0:
                    setup = new FChoice.Toolkits.Clarify.Sales.ChangeOpportunityStatusSetup(setupParam.OpportunityIDNum);
                    break;
                default:
                    throw new InvalidOperationException(string.Format("Constructor index '{0}' does not exist.", setupParam.ConstructorCue));
            }

            if( Global.IsPropertyDirty(1, setupParam.DirtyFieldFlags) )
            {
                setup.OpportunityIDNum = setupParam.OpportunityIDNum;
            }

            if( Global.IsPropertyDirty(2, setupParam.DirtyFieldFlags) )
            {
                setup.NewStatus = setupParam.NewStatus;
            }

            if( Global.IsPropertyDirty(4, setupParam.DirtyFieldFlags) )
            {
                setup.ChangeDate = setupParam.ChangeDate;
            }

            if( Global.IsPropertyDirty(8, setupParam.DirtyFieldFlags) )
            {
                setup.Notes = setupParam.Notes;
            }

            if( Global.IsPropertyDirty(16, setupParam.DirtyFieldFlags) )
            {
                setup.UserName = setupParam.UserName;
            }

            if( Global.IsPropertyDirty(32, setupParam.DirtyFieldFlags) )
            {
                setup.GenerateTimeBombs = setupParam.GenerateTimeBombs;
            }

            return new Protocols.ToolkitResultProtocol( toolkit.ChangeOpportunityStatus(setup) );
        }
        public Protocols.ToolkitResultProtocol MoveQuote(Protocols.Sales.MoveQuoteSetupProtocol setupParam)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session );
            FChoice.Toolkits.Clarify.Sales.MoveQuoteSetup setup;

            switch( setupParam.ConstructorCue )
            {
                case 0:
                    setup = new FChoice.Toolkits.Clarify.Sales.MoveQuoteSetup(setupParam.QuoteIDNum, setupParam.NewWipBin);
                    break;
                default:
                    throw new InvalidOperationException(string.Format("Constructor index '{0}' does not exist.", setupParam.ConstructorCue));
            }

            if( Global.IsPropertyDirty(1, setupParam.DirtyFieldFlags) )
            {
                setup.QuoteIDNum = setupParam.QuoteIDNum;
            }

            if( Global.IsPropertyDirty(2, setupParam.DirtyFieldFlags) )
            {
                setup.NewWipBin = setupParam.NewWipBin;
            }

            return new Protocols.ToolkitResultProtocol( toolkit.MoveQuote(setup) );
        }
        public Protocols.ToolkitResultProtocol CloseOpportunity(System.String opportunityIDNum)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session );

            return new Protocols.ToolkitResultProtocol( toolkit.CloseOpportunity(opportunityIDNum) );
        }
        public Protocols.ToolkitResultProtocol UpdateOpportunity(Protocols.Sales.UpdateOpportunitySetupProtocol setupParam)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session );
            FChoice.Toolkits.Clarify.Sales.UpdateOpportunitySetup setup;

            switch( setupParam.ConstructorCue )
            {
                case 0:
                    setup = new FChoice.Toolkits.Clarify.Sales.UpdateOpportunitySetup(setupParam.OpportunityIDNum);
                    break;
                default:
                    throw new InvalidOperationException(string.Format("Constructor index '{0}' does not exist.", setupParam.ConstructorCue));
            }

            if( Global.IsPropertyDirty(1, setupParam.DirtyFieldFlags) )
            {
                setup.OpportunityIDNum = setupParam.OpportunityIDNum;
            }

            if( Global.IsPropertyDirty(2, setupParam.DirtyFieldFlags) )
            {
                setup.OpportunityName = setupParam.OpportunityName;
            }

            if( Global.IsPropertyDirty(4, setupParam.DirtyFieldFlags) )
            {
                setup.AccountIDNum = setupParam.AccountIDNum;
            }

            if( Global.IsPropertyDirty(8, setupParam.DirtyFieldFlags) )
            {
                setup.ContactFirstName = setupParam.ContactFirstName;
            }

            if( Global.IsPropertyDirty(16, setupParam.DirtyFieldFlags) )
            {
                setup.ContactLastName = setupParam.ContactLastName;
            }

            if( Global.IsPropertyDirty(32, setupParam.DirtyFieldFlags) )
            {
                setup.ContactPhone = setupParam.ContactPhone;
            }

            if( Global.IsPropertyDirty(64, setupParam.DirtyFieldFlags) )
            {
                setup.Territory = setupParam.Territory;
            }

            if( Global.IsPropertyDirty(128, setupParam.DirtyFieldFlags) )
            {
                setup.Amount = setupParam.Amount;
            }

            if( Global.IsPropertyDirty(256, setupParam.DirtyFieldFlags) )
            {
                setup.CloseDate = setupParam.CloseDate;
            }

            if( Global.IsPropertyDirty(512, setupParam.DirtyFieldFlags) )
            {
                setup.LeadSource = setupParam.LeadSource;
            }

            if( Global.IsPropertyDirty(1024, setupParam.DirtyFieldFlags) )
            {
                setup.Currency = setupParam.Currency;
            }

            if( Global.IsPropertyDirty(2048, setupParam.DirtyFieldFlags) )
            {
                setup.Probability = setupParam.Probability;
            }

            if( Global.IsPropertyDirty(4096, setupParam.DirtyFieldFlags) )
            {
                setup.Process = setupParam.Process;
            }

            if( Global.IsPropertyDirty(8192, setupParam.DirtyFieldFlags) )
            {
                setup.UpdateDate = setupParam.UpdateDate;
            }

            if( Global.IsPropertyDirty(16384, setupParam.DirtyFieldFlags) )
            {
                setup.UserName = setupParam.UserName;
            }

            if( Global.IsPropertyDirty(32768, setupParam.DirtyFieldFlags) )
            {
                setup.GenerateTimeBombs = setupParam.GenerateTimeBombs;
            }

            if( Global.IsPropertyDirty(65536, setupParam.DirtyFieldFlags) )
            {
                foreach(Protocols.AdditionalFieldProtocol field in setupParam.AdditionalFields){setup.AdditionalFields.Append( field.FieldName, field.FieldType, field.FieldValue);}
            }

            return new Protocols.ToolkitResultProtocol( toolkit.UpdateOpportunity(setup) );
        }
        public Protocols.ToolkitResultProtocol CreateActionItem(Protocols.Sales.CreateActionItemSetupProtocol setupParam)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session );
            FChoice.Toolkits.Clarify.Sales.CreateActionItemSetup setup;

            switch( setupParam.ConstructorCue )
            {
                case 0:
                    setup = new FChoice.Toolkits.Clarify.Sales.CreateActionItemSetup();
                    break;
                default:
                    throw new InvalidOperationException(string.Format("Constructor index '{0}' does not exist.", setupParam.ConstructorCue));
            }

            if( Global.IsPropertyDirty(1, setupParam.DirtyFieldFlags) )
            {
                setup.Title = setupParam.Title;
            }

            if( Global.IsPropertyDirty(2, setupParam.DirtyFieldFlags) )
            {
                setup.Notes = setupParam.Notes;
            }

            if( Global.IsPropertyDirty(4, setupParam.DirtyFieldFlags) )
            {
                setup.ContactFirstName = setupParam.ContactFirstName;
            }

            if( Global.IsPropertyDirty(8, setupParam.DirtyFieldFlags) )
            {
                setup.ContactLastName = setupParam.ContactLastName;
            }

            if( Global.IsPropertyDirty(16, setupParam.DirtyFieldFlags) )
            {
                setup.ContactPhone = setupParam.ContactPhone;
            }

            if( Global.IsPropertyDirty(32, setupParam.DirtyFieldFlags) )
            {
                setup.AccountName = setupParam.AccountName;
            }

            if( Global.IsPropertyDirty(64, setupParam.DirtyFieldFlags) )
            {
                setup.LeadFirstName = setupParam.LeadFirstName;
            }

            if( Global.IsPropertyDirty(128, setupParam.DirtyFieldFlags) )
            {
                setup.LeadLastName = setupParam.LeadLastName;
            }

            if( Global.IsPropertyDirty(256, setupParam.DirtyFieldFlags) )
            {
                setup.OpportunityIDNum = setupParam.OpportunityIDNum;
            }

            if( Global.IsPropertyDirty(512, setupParam.DirtyFieldFlags) )
            {
                setup.TaskType = setupParam.TaskType;
            }

            if( Global.IsPropertyDirty(1024, setupParam.DirtyFieldFlags) )
            {
                setup.Priority = setupParam.Priority;
            }

            if( Global.IsPropertyDirty(2048, setupParam.DirtyFieldFlags) )
            {
                setup.StartDate = setupParam.StartDate;
            }

            if( Global.IsPropertyDirty(4096, setupParam.DirtyFieldFlags) )
            {
                setup.DueDate = setupParam.DueDate;
            }

            if( Global.IsPropertyDirty(8192, setupParam.DirtyFieldFlags) )
            {
                setup.CompleteDate = setupParam.CompleteDate;
            }

            if( Global.IsPropertyDirty(16384, setupParam.DirtyFieldFlags) )
            {
                setup.Status = setupParam.Status;
            }

            if( Global.IsPropertyDirty(32768, setupParam.DirtyFieldFlags) )
            {
                setup.CreateDate = setupParam.CreateDate;
            }

            if( Global.IsPropertyDirty(65536, setupParam.DirtyFieldFlags) )
            {
                setup.UserName = setupParam.UserName;
            }

            if( Global.IsPropertyDirty(131072, setupParam.DirtyFieldFlags) )
            {
                setup.GenerateTimeBombs = setupParam.GenerateTimeBombs;
            }

            if( Global.IsPropertyDirty(262144, setupParam.DirtyFieldFlags) )
            {
                foreach(Protocols.AdditionalFieldProtocol field in setupParam.AdditionalFields){setup.AdditionalFields.Append( field.FieldName, field.FieldType, field.FieldValue);}
            }

            return new Protocols.ToolkitResultProtocol( toolkit.CreateActionItem(setup) );
        }
        public Protocols.ToolkitResultProtocol AssignLead(System.Int32 leadObjid, System.String newOwner)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session );

            return new Protocols.ToolkitResultProtocol( toolkit.AssignLead(leadObjid, newOwner) );
        }
        public Protocols.ToolkitResultProtocol CreateLead(Protocols.Sales.CreateLeadSetupProtocol setupParam)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session );
            FChoice.Toolkits.Clarify.Sales.CreateLeadSetup setup;

            switch( setupParam.ConstructorCue )
            {
                case 0:
                    setup = new FChoice.Toolkits.Clarify.Sales.CreateLeadSetup(setupParam.State, setupParam.Country, setupParam.TimeZone, setupParam.SiteType, setupParam.LeadSource);
                    break;
                default:
                    throw new InvalidOperationException(string.Format("Constructor index '{0}' does not exist.", setupParam.ConstructorCue));
            }

            if( Global.IsPropertyDirty(1, setupParam.DirtyFieldFlags) )
            {
                setup.LeadObjid = setupParam.LeadObjid;
            }

            if( Global.IsPropertyDirty(2, setupParam.DirtyFieldFlags) )
            {
                setup.ContactFirstName = setupParam.ContactFirstName;
            }

            if( Global.IsPropertyDirty(4, setupParam.DirtyFieldFlags) )
            {
                setup.ContactLastName = setupParam.ContactLastName;
            }

            if( Global.IsPropertyDirty(8, setupParam.DirtyFieldFlags) )
            {
                setup.ContactPhone = setupParam.ContactPhone;
            }

            if( Global.IsPropertyDirty(16, setupParam.DirtyFieldFlags) )
            {
                setup.Fax = setupParam.Fax;
            }

            if( Global.IsPropertyDirty(32, setupParam.DirtyFieldFlags) )
            {
                setup.Address = setupParam.Address;
            }

            if( Global.IsPropertyDirty(64, setupParam.DirtyFieldFlags) )
            {
                setup.Address2 = setupParam.Address2;
            }

            if( Global.IsPropertyDirty(128, setupParam.DirtyFieldFlags) )
            {
                setup.City = setupParam.City;
            }

            if( Global.IsPropertyDirty(256, setupParam.DirtyFieldFlags) )
            {
                setup.State = setupParam.State;
            }

            if( Global.IsPropertyDirty(512, setupParam.DirtyFieldFlags) )
            {
                setup.PostalCode = setupParam.PostalCode;
            }

            if( Global.IsPropertyDirty(1024, setupParam.DirtyFieldFlags) )
            {
                setup.Country = setupParam.Country;
            }

            if( Global.IsPropertyDirty(2048, setupParam.DirtyFieldFlags) )
            {
                setup.TimeZone = setupParam.TimeZone;
            }

            if( Global.IsPropertyDirty(4096, setupParam.DirtyFieldFlags) )
            {
                setup.Email = setupParam.Email;
            }

            if( Global.IsPropertyDirty(8192, setupParam.DirtyFieldFlags) )
            {
                setup.Title = setupParam.Title;
            }

            if( Global.IsPropertyDirty(16384, setupParam.DirtyFieldFlags) )
            {
                setup.CompanyName = setupParam.CompanyName;
            }

            if( Global.IsPropertyDirty(32768, setupParam.DirtyFieldFlags) )
            {
                setup.SiteName = setupParam.SiteName;
            }

            if( Global.IsPropertyDirty(65536, setupParam.DirtyFieldFlags) )
            {
                setup.SiteType = setupParam.SiteType;
            }

            if( Global.IsPropertyDirty(131072, setupParam.DirtyFieldFlags) )
            {
                setup.Rating = setupParam.Rating;
            }

            if( Global.IsPropertyDirty(262144, setupParam.DirtyFieldFlags) )
            {
                setup.ContactRole = setupParam.ContactRole;
            }

            if( Global.IsPropertyDirty(524288, setupParam.DirtyFieldFlags) )
            {
                setup.LeadSource = setupParam.LeadSource;
            }

            if( Global.IsPropertyDirty(1048576, setupParam.DirtyFieldFlags) )
            {
                setup.UserName = setupParam.UserName;
            }

            if( Global.IsPropertyDirty(2097152, setupParam.DirtyFieldFlags) )
            {
                setup.CreateDate = setupParam.CreateDate;
            }

            if( Global.IsPropertyDirty(4194304, setupParam.DirtyFieldFlags) )
            {
                setup.GenerateTimeBombs = setupParam.GenerateTimeBombs;
            }

            if( Global.IsPropertyDirty(8388608, setupParam.DirtyFieldFlags) )
            {
                foreach(Protocols.AdditionalFieldProtocol field in setupParam.AdditionalFields){setup.AdditionalFields.Append( field.FieldName, field.FieldType, field.FieldValue);}
            }

            return new Protocols.ToolkitResultProtocol( toolkit.CreateLead(setup) );
        }
        public Protocols.ToolkitResultProtocol CreateOpportunity(System.String opportunityName, System.String salesStage, System.Single probability)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session );

            return new Protocols.ToolkitResultProtocol( toolkit.CreateOpportunity(opportunityName, salesStage, probability) );
        }