Skip to main content

Hi,


I tried to execute the SAVE method in the SmartObject, but I am getting the following exception.


"SmartObject instance property 'MethodToExecute' must be set to the method name of this instance"


For your reference, please find the code snippet.


SourceCode.SmartObjects.Client.SmartObject smartObject = serverName.GetSmartObject(strSmartObjectName);  
smartObject.MethodToExecute = "GetList";
smartObject.Propertiesi"GUID"].Value = "123-789-41klh-hfgvbf5687g";
smartObject.Propertiesi"Title"].Value = "Title";
smartObject.Propertiesi"Amount"].Value = "100000";
smartObject.Propertiesi"Product"].Value = "Product";
// call the method
SourceCode.SmartObjects.Client.SmartObjectList oSmOList = serverName.ExecuteList(smartObject);


When I try to execute the .ExecuteMethod i am getting the exception.


Please help me to resolve this issue.

Thanks in advance.

I wonder if its because you're calling a list method to try and update an item.  Normally to update an item it wouldn't be through a GetList but an Update or Save method.  It would then be serverName.ExecuteScalar(smartObject).


 


Reply