appmaker - Move record from one data model to another with a button -
i have 2 data models, 1 called requested_allocations , called approved_allocations.
i want add 'approve' button each row of table displaying requested_allocations records. when user clicks button, record added approved_allocations , removed requested_allocations.
i have set both data models , have added 'approve' button requested_allocations table. imagine need add onclick event button, i'm not sure do. guidance great!
it doable creating new record approved_allocations
model, copying fields requested_allocations
, removing source record... inefficient/complex.
i recommend remove 1 of models , add 'status' field remaining one. you'll able query approved/requested records filters:
// querying requested allocations app.datasources.allocations.query.filters.status._equals = 'requested';
and change allocation status single line of code:
// approve button click (assuming shared datasource row) widget.datasource.item.status = 'approved';
you can find tons of similar code in travel approval , document approval templates.
Comments
Post a Comment