Hi
I am trying to save data into 2 tables on submit. The first save data function saves an asset into tblAsset with auto increment field for the asset_id.
I want to add a record into another table using this new asset_id.
In the save action, after the save to tblAsset I have added a read function to read data back in from tblAsset with Model of Asset, order by created/asc Type, first matching record to try and get the latest asset to be added
After the read function I have another save action but this time to the second table and I have set Model name to Asset, data provider {data:Asset} write action:Insert, Data overide on insert:asset_id:{data:Asset.asset_id}
When I try to save in the second table however, the asset_id is not being saved. Is this because {data: #} only reads data on the form? If so how would I reference the data from my read function?
Or is there a better approach to use?
Thanks
Mikki
I am trying to save data into 2 tables on submit. The first save data function saves an asset into tblAsset with auto increment field for the asset_id.
I want to add a record into another table using this new asset_id.
In the save action, after the save to tblAsset I have added a read function to read data back in from tblAsset with Model of Asset, order by created/asc Type, first matching record to try and get the latest asset to be added
After the read function I have another save action but this time to the second table and I have set Model name to Asset, data provider {data:Asset} write action:Insert, Data overide on insert:asset_id:{data:Asset.asset_id}
When I try to save in the second table however, the asset_id is not being saved. Is this because {data: #} only reads data on the form? If so how would I reference the data from my read function?
Or is there a better approach to use?
Thanks
Mikki