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 Answer 1

-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

1
  • ..Thanks. DO I need to use any other "Reference" to access DescribeSObject it give me error for the directive reference.
    – CodeDiva
    Feb 6, 2015 at 18:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .