function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mark CrooksMark Crooks 

AIR Toolkit creating offline records - ArgumentError: Error #2004: One of the parameters is invalid.

Hi,

I'm creating an AIR app using the SalesForce AIR Toolkit following this tutorial.
https://developer.salesforce.com/page/Taking_Salesforce_Data_Offline_Using_Adobe_AIR

I have everything that I need working other than being able to create a new entry to the database when offline.
This is the code I use to create the new entry:
private function addContact(evt:MouseEvent):void 
{            
acc = new SObject('Customer__c');            
acc.Name = nameTxt.text;
acc.Percent__c = int(percentTxt.text);           
airConnection.create([acc], new AsyncResponder(addSuccess));
}
When online the entry is added successfully but when offline I get the following error:
​ArgumentError: Error #2004: One of the parameters is invalid.
Which relates to passing an SObject to the serializeObject function within AirConnection.as
public function serializeObject(someObject:Object):ByteArray
{
var objectBytes:ByteArray = new ByteArray();
objectBytes.writeObject(someObject);
return objectBytes;
}

The error occurs on this line:
objectBytes.writeObject(someObject);

I also found an issue posted on code.google which relates to the same issue but despite creating a svn checkout and updating my files to r31 I still get the same error:
https://code.google.com/p/force-flex/issues/detail?id=3

Would anyone have any suggestiosn on how I can resolve this last hurdle?

Many thanks, Mark