0

I have read and tried unsuccessfully the solutions in the two other posts regarding this subject, which appear to be focused on PHP. Create Sendable Data Extension using FuelSDK and Fuel SDK + PHP + Sendable Data Extension

Is it possible to create a sendable data extension via the c# fuel sdk? When I supply the .SendableDataExtensionField, I get an XML serialization error.

ET_DataExtension postDataExtension = new ET_DataExtension(); 
postDataExtension.AuthStub = myclient; 
postDataExtension.CustomerKey = NameOfTestDataExtension;
postDataExtension.IsSendableSpecified = true; 
postDataExtension.IsSendable = true; 
postDataExtension.SendableDataExtensionField = new DataExtensionField() { Name = "EmailAddress" };
ET_DataExtensionColumn colEmail = new ET_DataExtensionColumn() { Name = "EmailAddress", FieldType = DataExtensionFieldType.Text, IsPrimaryKey = true, MaxLength = 100, IsRequired = true };
ET_DataExtensionColumn col1 = new ET_DataExtensionColumn() { Name = "Last Name", FieldType = DataExtensionFieldType.Text }; 
ET_DataExtensionColumn col2 = new ET_DataExtensionColumn() { Name = "First Name", FieldType = DataExtensionFieldType.Text }; 
postDataExtension.Columns = new ET_DataExtensionColumn[] { colEmail, col1, col2 };

"The type FuelSDK.ET_DataExtensionColumn was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically."

I get a similar error about Attribute when I specify the SendableSubscriberField attribute.

Any input/direction/resources much appreciated. I've spent the last 2 days in the sdk documentation without success.

1 Answer 1

3

I know this question is old; but I ran into the same issue and thought it might prove helpful for others.

Your setting the SendableDataExtensionField to what is likely a raw FuelSDK.SendableSubscriberField. You can set this to the ET_DataExtensionColumn instance for your email address instead (i.e. colEmail in the example above.)

Similarly; for the SendableSubscriberField you should use an ET_ProfileAttribute with the name set to either "Email Address" or "Subscriber Key" based on your salesforce configuration.

Good luck!

2
  • can you please elaborate on this for me? I am having the same issue... :(
    – Mark
    Commented Feb 15, 2016 at 5:29
  • This is the correct answer: Code: IsSendable = true, IsSendableSpecified = true, SendableDataExtensionField = emailColumn, SendableSubscriberField = new FuelSDK.ET_ProfileAttribute{ Name = "Subscriber Key" },
    – KenL
    Commented Apr 18, 2016 at 15:33

You must log in to answer this question.

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