Highlighted

Saving many entities at the same time with LCDS

Avatar

Avatar

imran_issufo

Avatar

imran_issufo

imran_issufo

08-02-2011

Hi,

i am new in Adobe Lifecycle Data Service,

i am using adobe flash builder with and doing model-driven development with LiveCycle Data Services ES,

I have i dificult about saving two entites at the same time, for example i need to save in data base a invoice and invoice items on a SAVE click

the model plugin created for me separated forms for each one ... one for INVOICE and another for INVOICE ITEM...i created my own where i introduce invoice details like customer name, etc,

and i dinamically create items and insert in a editable datagrid where i introduce the quantities for each item.

My dataservice for both entities are set to autocomit FALSE

My question is ... how do i save the invoice entity first and relate this invoice with items at the SAVE button click?.

When i do separaltly(first register the invoice, after one by one register the items) it works fine...

regards,

Imraan

Replies

Highlighted

Avatar

Avatar

Ashish_Vashisht

Avatar

Ashish_Vashisht

Ashish_Vashisht

09-02-2011

Try creating a relationship between the two entities in the Fiber model. Add a property to Invoice called items, set the type to InvoiceItem and then mark as true the this is a collection checkbox. This should allow you to save the Invoice along with its items...

Highlighted

Avatar

Avatar

imran_issufo

Avatar

imran_issufo

imran_issufo

10-02-2011

Hello Ashish Vashisht,

thank you very much!!!!!

That resolved my problem, i need to add also a parameter cascadeCommit = true to the commit method.

One again... thankx