I haven't worked a lot with the data wizards but one thing I notice is when you set a form to create a record it will produce a very standard template that uses a valueobject of 'name'. Now on the assumption that you have a new record you wish to enter, the first step is not to try and edit any automatically generated primary keys
i.e. a mysql table
ID = int (autoincrement) primary key
Surname = varchar(25)
Name = varchar(25)
DOB = date;
the form template would offer all these fields for updating/creating) - so delete the ID option as you don't want to touch that
Next with the value object once its populated it would possibly update the existing record rather than create a new one so when you enter your create option reseting the value object would be a good idea - names = new Names(); this gives you a clear object for the create record process.
Last thing, if you are displaying the records in a grid you would refetch the records in an eventlistener for the createrecord function.
If you would like a test case for this let me know and i'll put something together.
Thanks for your feedback
Can you tell me which server are you using at your back-end?
Did you use Flash Builder wizards to generate the server code or you tried to use your own code?
Also are you using the BETA2 version of Flash Builder?
Hi, thanks for reply.
I´m using the Wizard mode to generate all PHP back-end classes.
Thaks man! Solved the problem! Yeah, its an Flex little bug... but easy to solve too ! Thanks a lot!
In future builds, the generated code for createItem would have Insert clauses and have the primary property as part of the clause (if they are auto ids) so that the default experience will be working, that is callResponder CREATE will work everytime. Most dbs support not having the id property as part of the clause when it is an auto id.
But it is always better to reset all the values in the valueObject and refill them with appropriate values, before it is sent to the server.