We are trying to create an Email Send Definition from a landing page. Ampscript is calling out to get a Send Classification object that will be a part of the Email Send Definition:
SET @send_class_create = CreateObject("SendClassification")
SetObjectProperty(we set Send Classification properties here)
set @sendClass = InvokeCreate(@send_class_create,@statusMsg, @errorCode)
We now have a send classification object created. We will now use that object to define the Send Classification within the Email Send Definition object:
SET @cr = CreateObject("EmailSendDefinition")
SendClassification property requires a data type of SendClassification object according to the documentation.
If we try and run this code on a landing page the page returns an error:
Object of type 'System.String' cannot be converted to type 'ExactTarget.Integration.WSDL.SendClassification'.
The function expression is invalid. See inner exception for detail.
Script: SetObjectProperty(@cr, "SendClassification", @sendClass)
The system seems to be casting the SendClassification object into a string object. I am specifically defining the object as the required type so I am not sure why the system is turning the object into a string object.