This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - How can i code addijng a new item by another item data

fxjpost - Friday, December 23, 2011 10:56 PM:

hi

Dear all friends

     How can i  code addijng  a new item by  another item data ?

ex:

when i  save itema to database   At the same time  it can  add a new itemb save to database. 



fxjpost - Monday, December 26, 2011 1:41 AM:

for ex:

string cux_code=this.getProperty("cux_code");
string cux_des=this.getProperty("cux_des");
Item cux_formObj=this.newItem("cux_form","add");
cux_formObj.setProperty("cux_field1",cux_code);
cux_formObj.setProperty("cux_field2",cux_des);
Item retobj=cux_formObj.apply();
return this;

 



justinlee - Monday, December 26, 2011 4:49 AM:

for ex:

string cux_code=this.getProperty("cux_code");
string cux_des=this.getProperty("cux_des");
Item cux_formObj=this.newItem("cux_form","add");
cux_formObj.setProperty("cux_field1",cux_code);
cux_formObj.setProperty("cux_field2",cux_des);
Item retobj=cux_formObj.apply();
return this;

 

Hi Xinju,

you must use Innovator Inno = this.getInnovator(); Then you can create new Item Object and set some property as code bellow.

Item _newItemX = Inno.newItem("myItem","add");

_newItemX.setProperty("fields1","my content1");

_newItemX.setProperty("fields2","my content2");

_newItemX.setProperty("fields3","my content3");

_newItemX = _newItemX.apply();

P/s: Sorry my English,

Lee!