I love the new form generation stuff in FB and I've created a form from a create autogenerated service.
When the user fills in the form I call the method I assign it to a token in a call responder
createtbMysteryShopperResultsResult2.token = tbMysteryShopperResultsService.createtbMysteryShopperResults(tbMyster yShopperRe sults2);
The service just a void one
However if the users fills the form again and called the same service I get an error:
Item with id 'tbMysteryShopperResultsRPCDataManager:#:0' already exists. Error on destination 'tbMysteryShopperResultsRPCDataManager'
The primary key column is auto incremented in the ms sql database so I do not understand this error?
Any advice would be great, this problem has been bugging me for days now
A lot of the code generated stuff I don't understand so I don't know where to look for errors
Could u give us details about your workflow. What type of data service did you import? Was it a web service? What kind of server?
You could look into the generated source of the function and use a breakpoint to check if the error is at the client side or not.
Sorry for the late response, but I think I've found a workaround, I encounter exactly the same trouble in my application, very rare trouble but more often when the application runs on touch screen. I think It's like the user double-click on the button firing the action of create item twice, in my case it should not arised because i remove the button on click but ... sometimes it seems it should :-/ By default the RemoteObject wrapps in the DataService is in multiple mode , see concurrency in RemoteObject source :
[Inspectable(enumeration="multiple,single,last", defaultValue="multiple", category="General")]
* Value that indicates how to handle multiple calls to the same service. The default
* value is multiple. The following values are permitted:
* <li>multiple - Existing requests are not cancelled, and the developer is
* responsible for ensuring the consistency of returned data by carefully
* managing the event stream. This is the default.</li>
* <li>single - Making only one request at a time is allowed on the method; additional requests made
* while a request is outstanding are immediately faulted on the client and are not sent to the server.</li>
* <li>last - Making a request causes the client to ignore a result or fault for any current outstanding request.
* Only the result or fault for the most recent request will be dispatched on the client.
* This may simplify event handling in the client application, but care should be taken to only use
* this mode when results or faults for requests may be safely ignored.</li>
Then I add a test in my code and the problem seems to disappear :
if ( createPersonResult.token == null )
createPersonResult.token = personService.createPerson(person);