Buy Now
Sign in

Add a new record with CC6 via CF6 form (editing records works nicely)

doromi , June 07 at 12:08
Answered
D
doromi
Hi,​
​​
​I'm on my way to get all my nice CF4 and CC4 forms and connections upgraded to CF6 and CC6...​
​​
​My current job is to​
​1 - list the records of a table​
​2 - add an edit button to each row of the list to edit the chosen record with a CF6 form​
​3 - add a delete button to each row of the list to delete the chosen record ​
​4 - add a new record button on top of the list to add new records (preferrably with the same CF6 form)​
​​
​Dots 1 to 3 work like a charm now, for dot 2 I followed this thread​
​http://www.chronoengine.com/forums/posts/t105191/cannot-Save-record-edited-by-the-chronoforms-form-however-same-settings-for-CCv6-form-is-working​
​​
​(what maid dot 3 an easy job to be done).​
​​
​But I don't get it done to add a new record in CC6. I call the same CF6 form as I do for dot 2, I can enter my data but they don't get saved.​
​​
​My view to the CF6 form:​
​Event: save​
​Data provider: {data:}​
​Content:​
​{chronoform.section:chronoform_name/one}​
​{view:task_button_save}​
​​
​View "task_button_save"​
​Event: save​
​plus submit button activated​
​​
​​
​The save Event:​
​{fn:save_record}​
​​
​​
​My save function "save_record":​
​Model name: BPP​
​Data provider: {data:BPP}​
​​
​Data override on insert (may be THERE's something missing?)​
​created:{date:Y-m-d H:i:s}​
​user_id:{user:id}​
​​
​Update conditions​
​BPP.aid:{data:aid}​
​​
​​
​Any chance to show me where I go wrong?​
​​
​Thanks,​
​​
​regards​
​Doris
D
doromi
Found it.
To save an edited record I need the according Model name in the save function.
To save a new record I need a second save function without any Model name.
(Means a whole second setup with Event, View and Function)