0

I am trying to get all the columns names using API. below is the code I am trying ,i need to iterate through the API object to get the Name of columns. But I am getting an error "ExactTarget.ExactTargetClient.APIObject object does not contain public definition of getenumerator" with this..

RetrieveRequest request = new RetrieveRequest();
            request.ObjectType = "DataExtensionField";
            request.Properties =
            new string[]
                {
                   "Name"
                };
            SimpleFilterPart sfp1 = new SimpleFilterPart();
            String[] sfp1Values = { Start.Text };
            sfp1.Property = "DataExtension.CustomerKey";
            sfp1.SimpleOperator = SimpleOperators.equals ;
            sfp1.Value = sfp1Values;              
            request.Filter = sfp1;
            do
             {

            status = client.Retrieve(request, out requestID, out Results);                  
                 foreach (ExactTarget.ExactTargetClient.APIObject deo in Results)
                 { foreach (ExactTarget.ExactTargetClient.DataExtensionField prop in  deo)
                     { string name = prop.Name;                                                  

                    }

                 }

How should I solve this? Is there any other way to do it.. Thanks in Advance.

-1

You should be able to use the describe object to get all of the fieldnames.

https://www.salesforce.com/developer/docs/api/Content/sforce_api_calls_describesobject.htm

|improve this answer|||||
  • ..Thanks. DO I need to use any other "Reference" to access DescribeSObject it give me error for the directive reference. – CodeDiva Feb 6 '15 at 18:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.