Add with applyedit

3722
1
Jump to solution
03-13-2015 08:39 AM
EvelynHernandez
Occasional Contributor III

Hello,

Hoping someone can help me, im developing a widget that when the user clic on the map, add a new registry in a db. I have the following code but i dont know why it doesnt work propertly.

It goes to the onresult function and say its done, but when i go to the database, there is not any new row. Its like it didnt save anything of the data that i want to save on the db.

What am i doing wrong?

The parameters im passing are raw, cuz i wanna try the add, but idk why it doesnt save any new row.

My function is :

protected function GRABA_CENTRAL():void{

var nuevaCentral:* = new Object;

var fecha_star:String = CboMes2.selectedItem + CboYear2.selectedItem; 

nuevaCentral["EMPRESA_ID"]= 006;

nuevaCentral["PERIODO_STAR"]= fecha_star;

...

myPropLayer.url = ""; 

var newgrap2:Graphic = new Graphic(null,null,nuevaCentral);

myPropLayer.applyEdits([ newgrap2 ],null,null,false,new AsyncResponder(onResult2,onFault2));

function onResult2(info:Object, token:Object = null):void

{

Alert.show("Registro actualizado exitosamente" +info.toString());

}

function onFault2(info:Object, token:Object = null):void

{

Alert.show("Error al editar nuevo elemento "+info.toString());

}

}

Thanks for all ur help as always

Mensaje editado por: Evelyn Hernandez

0 Kudos
1 Solution

Accepted Solutions
EvelynHernandez
Occasional Contributor III

I solved my problem, putting the array like: array[0]

View solution in original post

0 Kudos
1 Reply
EvelynHernandez
Occasional Contributor III

I solved my problem, putting the array like: array[0]

0 Kudos