private Property SetRetrieveMultipleProperties(Property prop, CRMRetrieveMultiple task)
        {
            if (task != null)
            {
                switch (prop.Name.ToLower())
                {
                case "linkfromentityname":
                    prop.Value = task.LinkFromEntityName;
                    break;

                case "linkfromfromattributename":
                    prop.Value = task.LinkFromAttributeName;
                    break;

                case "linktoattributename":
                    prop.Value = task.LinkToAttributeName;
                    break;

                case "linktoentityname":
                    prop.Value = task.LinkToEntityName;
                    break;

                case "conditionattributename":
                    prop.Value = task.ConditionAttributeName;
                    break;

                case "conditionoperator":
                    prop.Value = task.ConditionOperator;
                    break;

                case "conditionvalue":
                    prop.Value = task.ConditionValue;
                    break;

                case "returnattributes":
                    prop.Value = task.ReturnAttributes;
                    break;
                }
            }

            return(prop);
        }
        private void RetrieveMultiple(ref ServiceObject so)
        {
            SourceCode.SmartObjects.Services.ServiceSDK.Objects.Method meth = so.Methods[0];
            //K2CRMHelper helper = new K2CRMHelper();
            WizardFunctions     helper   = new WizardFunctions();
            CRMRetrieveMultiple multiple = new CRMRetrieveMultiple();

            multiple.Config = crmconfig;

            try
            {
                multiple.LinkFromEntityName     = NotNull(so.Properties["LinkFromEntityName"].Value);
                multiple.LinkFromAttributeName  = NotNull(so.Properties["LinkFromAttributeName"].Value);
                multiple.LinkToEntityName       = NotNull(so.Properties["LinkToEntityName"].Value);
                multiple.LinkToAttributeName    = NotNull(so.Properties["LinkToAttributeName"].Value);
                multiple.ConditionAttributeName = NotNull(so.Properties["ConditionAttributeName"].Value);
                multiple.ConditionOperator      = NotNull(so.Properties["ConditionOperator"].Value);
                multiple.ConditionValue         = NotNull(so.Properties["ConditionValue"].Value);
                multiple.ReturnAttributes       = NotNull(so.Properties["ReturnAttributes"].Value);

                RestResponse <CRMRetrieveMultiple> response = helper.RetrieveMultiple(multiple, config);

                so.Properties.InitResultTable();

                foreach (CRMRetrieveMultipleReturn ret in response.Data.Results)
                {
                    for (int c = 0; c < meth.ReturnProperties.Count; c += 1)
                    {
                        Property prop = so.Properties[meth.ReturnProperties[c]];
                        prop = SetRetrieveMultipleProperties(prop, response);
                        prop = SetRetrieveMultipleReturnProperties(prop, ret);
                    }
                    so.Properties.BindPropertiesToResultTable();
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
    public CRMRetrieveMultiple CRMRetrieveMultiple(CRMRetrieveMultiple crmRetrieveMultiple)
    {
        CRMFunctions function = new CRMFunctions(crmRetrieveMultiple.Config);

        return(function.CRMRetrieveMultiple(crmRetrieveMultiple));
    }