Using sc_make_link() to execute PHP in a blank application

I have placed a button doing the following in onRecord event:

$link = sc_make_link(generate_voucher, receipt_id={receipt_id});
{gen_v} = '<button class="scButton_default" type="button" name="generate_receipt" onclick="' . $link . '">Generate Voucher</button>';

When I click the button I get:

Uncaught SyntaxError: Invalid regular expression flags

What I want to do is to execute a PHP script in a blank application generate_voucher when the button is clicked.

Also, how to reference the {receipt_id} in the blank application onExecute script?

If possible, can I place the script inside the onRecord and call it when the button is clicked instead of using a blank application?

How about a Control, with a blank Label Field and then put a PHP Button in the toolbar?

1 Like

You are absolutely right in normal conditions. That is what I am doing at the moment.

I just wanted to get the clutter out of the toolbar and activate/deactivate buttons independently for two operations being done on the receipts/payments vouchers. It is a research approach so far. It would be nice to perform actions on individual records using buttons in the grid columns.

Thanks for the suggestion. Appreciate it.

Have you tried one of the Editable Grid Forms? They have run buttons on the rows.

1 Like

I will try that! I didn’t know of that feature in editable grids.

Thanks.