Anyone having problem with sc_link onRecord with form application?

Hi,

I try to link some field in a grid. But the link will be conditional. Here’s the code I use in onRecord event


if({ITMSUSRSNAFLAG} == 'F'){
	sc_link(reset_pwd, 'form_ctrl_reset', glo_user_reset = {ITMSUSRSID},"Reset user password", "modal", 70, 210);
	sc_link(reject, 'form_ctrl_deactiv_usr', ITMSUSRSID = {ITMSUSRSID}; glo_user_reset = {ITMSUSRSID}, "Deactivate user", "modal", 80, 200 );
}

form_ctrl_reset is a control application.
form_ctr_deactiv_usr is a form application.

I have no problem with the control one. But with form, the modal shows no records found.
Is it not possible to create link with this macro for form application?

Thanks and best regards…

You need to pass the key to the form as a global variable (what you are doing anyways) and compare it to the db-field in the WHERE clause of your SQL statement.

Change your link to:
sc_link(reject, ‘form_ctrl_deactiv_usr’, glo_user_reset = {ITMSUSRSID}, “Deactivate user”, “modal”, 80, 200 ); //no need to pass it twice.

In the form you have to use the global variable in the WHERE clause:

ITMSUSRSID = [glo_user_reset]

I assume that ITMSUSRID is the primary key.

jsb

[QUOTE=jsbinca;40272]You need to pass the key to the form as a global variable (what you are doing anyways) and compare it to the db-field in the WHERE clause of your SQL statement.

Change your link to:
sc_link(reject, ‘form_ctrl_deactiv_usr’, glo_user_reset = {ITMSUSRSID}, “Deactivate user”, “modal”, 80, 200 ); //no need to pass it twice.

In the form you have to use the global variable in the WHERE clause:

ITMSUSRSID = [glo_user_reset]

I assume that ITMSUSRID is the primary key.

jsb[/QUOTE]

Ah, ya… I thought I didn’t have to fill in the WHERE clause, and just pass it on the sc_link.
Thank you, now it shows the right record.

But now I wonder if there is some way to close the modal form after update.
If we connect the link without sc_link (via Links toolbar), we can set the properties of “Close form after update”. But how do we do it with sc_link? Or is there any other way?
Because I tried to use sc_exit on the form afterUpdate, and it didn’t work.