[Pas2js] TJSIDBObjectStore.add() not working with a recordtype variable.....

Pedro Pablo Oviedo Vera verakuba13 at gmail.com
Fri Sep 20 16:54:26 CEST 2019


Hello people!,
Im facing this problem:

var
  fTransPeliculas: TJSIDBTransaction;
  fTransAlmacen  : TJSIDBObjectStore;
  fSolicitud     : TJSIDBRequest;
begin

  (......)

  fTransPeliculas   :=  gMyDB.transaction(['peliculas'],'readwrite');
  fTransAlmacen     :=  fTransPeliculas.objectStore('peliculas');

  gInfo.clave       :=  gedtClave.value;
  gInfo.anno        :=  gedtFecha.value;
  gInfo.texto       :=  gedtTexto.value;

  fSolicitud        := fTransAlmacen.add(gInfo,'clave');

 but from browser consola I recieve the message:
       DataError: Data provided to an operation does not meet requirements.

but when use this alternative....
  asm
     fSolicitud =
fTransAlmacen.add({id:$mod.gInfo.clave,nombre:$mod.gInfo.texto,fecha:$mod.gInfo.anno});
  end;

everything works!!!!
perhaps fSolicitud        := fTransAlmacen.add(gInfo,'clave'); is
incorrepts ...then how it will be OK?

Thanks
pp

-- 

MSc. Ing. Pedro Pablo Oviedo Vera
Dirección Técnica y Desarrollo
Empresa de Proyectos e Ingeniería del
Ministerio de la Agricultura.ENPA.
Boyeros y Conill, Piso 10 Edif MINAG
Telef. 884 7197
SIP:23000116
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/pas2js/attachments/20190920/235204e2/attachment.html>


More information about the Pas2js mailing list