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

addItem method not found

New Here ,
Apr 11, 2011 Apr 11, 2011

Hello,

I have this code

--------

user = entityload("Users", session.userid);

item = entitynew("Items");

item.setTitolo("Fables");

item.setDescrizione("Great Book");

entitysave(item);

dump(item); // addItem method existing in the dump trace

user.addItem(item);

entitysave(user);

--------
Server returns "The additem method was not found".
In another page I have this code:
---------
ormreload();
user = entitynew("users");
user.setNome("Fred");
town = entitynew("towns");
town.setComune("Turin");
entitysave(town);
item = entitynew("items");
item.setTitolo("Really great book");
entitysave(item);
user.setTown(town);
user.addItem(item); // this works perfectly
entitySave(user);
--------------
Anyone can shed some light on this?
Thanks so much
TOPICS
Getting started
521
Translate
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
New Here ,
Apr 11, 2011 Apr 11, 2011
LATEST

Well I think I got it: in the second case, the object is a single record. 

Translate
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