• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Flex 4 cannot insert new data to database via generated code by Apptacular

Explorer ,
Mar 05, 2011 Mar 05, 2011

Copy link to clipboard

Copied

Hi, I have a little problem with using Flex 4 with Coldfusion 9. I hope you can tell me what I have to fix.

I use Coldfusion 9, hosted on my development machine.

1. I created a table in MySQL database with 2 columns: `idPlayer` as integer and auto increment. 2nd column is `Name`.

2. I use a ColdFusion Builder extension, Apptacular, to generate solid CFC service for me. It generates `PlayerService.cfc` here.

3. Now I use Flash Builder 4's data wizard to generate data service class from `PlayerService.cfc`. I create a form on `update` method of that service.

4. Ok, now look at the generated code.

    // Please uncomment the below line if Data Management is enabled for Player and update is used as the create function.

    // var player:Player = new Player();

5. So I uncommented the code and run the form. After fill the data, and click update, the pop up appear like this:

    Unable to invoke CFC - Field 'idPlayer' doesn't have a default value

    For details, turn on Robust Exception Information in the ColdFusion Administrator

5-3-2554 17-12-58.jpg

So I don't know how Apptacular generate the code to work as ORM. But it should have some way or workaround to let the system act with idPlayer has no default value to insert other columns and generate idPlayer as auto-increment value (as I set in MySQL).

Could you help me solve this?

TOPICS
Flash integration

Views

1.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 06, 2011 Mar 06, 2011

Copy link to clipboard

Copied

LATEST

Hi, all

I found how to solve the problem now.

The problem is, MySQL table I created, the idPlayer column is not configure properly. Even I set this column as 'unique' and 'primary key', but I forgot to set its as 'auto increment'. That causes Apptacular to generate application code in wrong way. After I re-create my datbase, and use Apptacular to generate the code again. It works!

I hope my solution can help some of you out.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation