Adding both amend and delete options

Below is an extract from a Menu File, and is an example of a page containing query results:

{
"title":"Authorised",
"action":"query",
"queryreference":"AU - Annual Leave Last 12 Months",
"role":"AU",
"message_no_data_content":"No authorised requests.",
"message_no_data_title":"Authorised"
}

We need to add two buttons to the page, one enabling users to select a record to amend, and the other to remove a record.

We need to define these buttons along with the forms that will appear on each button click.

To do this we add the following properties:

{
"title":"Authorised",
"action":"query",
"queryreference":"AU - Annual Leave Last 12 Months",
"role":"AU",
"message_no_data_content":"No authorised requests.",
"message_no_data_title":"Authorised",
"has_btnDelete":"Delete",
"btnDelete_reference":"btnDelete",
"has_btnAmend":"Amend",
"btnAmend_reference":"btnAmend"
}

“btnAmend” and “btnDelete” are the unique references for these buttons which we will use later on, but these can be anything so long as this reference is not used anywhere else in the Menu File.

We also need to enable users to select records for which they will amend/remove, so we need to add the following property. We have also included “next_action”:”MENU” which means we are referencing a form that is defined somewhere else in the menu file:

{
"title":"Authorised",
"action":"query",
"queryreference":"AU - Annual Leave Last 12 Months",
"role":"AU",
"message_no_data_content":"No authorised requests.",
"message_no_data_title":"Authorised",
"has_btnDelete":"Delete",
"btnDelete_reference":"btnDelete",
"has_btnAmend":"Amend",
"btnAmend_reference":"btnAmend",
"select_mode":"Multiple",
"next_action":"MENU"
}

We now need to include the form definitions of the forms that are referenced by our new buttons:

{
"title":"Authorised",
"action":"query",
"queryreference":"AU - Annual Leave Last 12 Months",
"role":"AU",
"message_no_data_content":"No authorised requests.",
"message_no_data_title":"Authorised",
"select_mode":"Multiple",
"next_action":"MENU",
"has_btnDelete":"Delete",
"btnDelete_reference":"btnDelete",
"has_btnAmend":"Amend",
"btnAmend_reference":"btnAmend"
},
{
"menureference":"btnDelete",
"is_hidden":"yes",
"title":"Delete Holiday",
"action":"form",
"form_ref":"AUDALREQ",
"submit_button_text":"Delete",
"FieldsToExtract":[
{
"DELETE_ME":"Yes"
}
] },
{
"menureference":"btnAmend",
"is_hidden":"yes",
"title":"Amend Holiday",
"action":"form",
"form_ref":"AUAALREQ",
"submit_button_text":"Submit"
}

You will notice one form definition (“btnDelete”) contains “FieldsToExtract”:[{“DELETE_ME”:”Yes”}] which means that the selected record will be removed on submission of the form, which is why we needed to define two separate forms (btnAmend & btnDelete).