Thanks jsbinca,
I settled for the code below, but the form does not display the correct record when I click in the link.
I lodged a support ticket, but thought I would post it here as well -
I have a grid that contains a number of rows. Each row belongs to one of two “groups” Cash Transactions and Journals. Each is identified by a numeric field.
I need to be able to edit each row in the grid, but depending on it’s type I need to call a different application. So, one application for cash transactions and one for journal entries. Having one link for all rows is not appropriate.
So in the “On Record” event I have the following code -
//set up the links for cash v jrnls
if ({tr_type} == -1){
{loc_tran_type} = ‘Journal’;
sc_link({loc_edit},form_journals.php,{tr_id}={tr_id},‘Edit Journal Entry’);
}else{
{loc_tran_type} = ‘Cash’;
sc_link({loc_edit},form_transactions.php,{tr_id}={tr_id},‘Edit Cash Transaction’);
}
{loc_edit} is a html image field that shows the pencil icon that is used in other grid applications.
{tr_id} is the id field, but I am not sure how to pass that value to the form procedure. I do not want to set a global variable as this may well affect other grids from accessing the form. Do you know how best to achieve this?
If I leave that field out of the macro, it does not display the correct record in the form.
Thanks
Tony