EventDay / Infusionsoft.net

A C# Wrapper around the Infusionsoft.com API
15 stars 22 forks source link

Referral Custom Field #38

Closed jhallam3 closed 8 years ago

jhallam3 commented 8 years ago

below is my code. The custom field isnt coming back with anything. Ive added in the correct _APIField.

This works fine on Tables.Job and Tables.Customer ERROR is "Server returned a fault exception: [10] [NoFieldFound]No field found: Referral._DatabaseLandlordID" Please can you help me get this to work ?
try {

            var client = customer.Connect();
            var job = client.DataService.Query<InfusionSoft.Tables.Referral>(new DataPage(1000, 0), b => b.Add(v => v.Id, partnerID), project => project.IncludeCustomField(_CustomField));
            //   var result = client.DataService.Query<Job>(new DataPage(1000, 0), action => action.Add(x => x.Set(v => v.)), projection => projection.IncludeCustomField(_CustomField));

            return job.ElementAt(0).CustomFields[_CustomField].ToString();
        }
        catch (Exception ex2)
        {
            return null;
        }
jhallam3 commented 8 years ago

Hi, A way round this is ... var data = client.DataService.Load(partnerID, project => project.IncludeNamed("_Test"));