You can link to forms, but you can’t condition it.
Best bet I think is to use onRecord event, make your condition and use sc_link macro
sc_link(Column, Application, Parameters, "Hint", "Target", Height, Width) [TABLE="class: macros_desc_table"]
[TR]
[TD] This macro dynamically creates or modifies links between grid applications and other applications.
[B]Column[/B]: Grid column field name to generate the link.
[B]Application[/B]: Application name to establish the link.
[B]Parameters[/B]: Parameters required by the called application.
Must be informed "=" (attribution sign) . More than one parameter must be separated by ";" (semicolon).
[B]Hint[/B]: Observation or tip displayed when the mouse cursor passes over the link.
[B]Target[/B] : Where the application will function call and may be:
[TABLE="border: 0"]
[TR]
[TD="width: 15%, align: left"][B]Target[/B][/TD]
[TD="align: left"][B]Descri??o[/B][/TD]
[/TR]
[TR]
[TD="class: corpo1, align: left"]"_self"[/TD]
[TD="class: corpo1, align: left"]For carrying on the same page (overrides the query);[/TD]
[/TR]
[TR]
[TD="class: corpo1, align: left"]"_blank"[/TD]
[TD="class: corpo1, align: left"]To run on another page (pop-up);[/TD]
[/TR]
[TR]
[TD="class: corpo1, align: left"]"iframeT"[/TD]
[TD="class: corpo1, align: left"]To run in an iframe above the Grid (top);[/TD]
[/TR]
[TR]
[TD="class: corpo1, align: left"]"iframeL"[/TD]
[TD="class: corpo1, align: left"]To run in an iframe, the left of the Grid (Left);[/TD]
[/TR]
[TR]
[TD="class: corpo1, align: left"]"iframeR"[/TD]
[TD="class: corpo1, align: left"]To run in an iframe, the left of the Grid (Left);[/TD]
[/TR]
[TR]
[TD="class: corpo1, align: left"]"iframeB"[/TD]
[TD="class: corpo1, align: left"]To run in an iframe below the Grid (Bot);[/TD]
[/TR]
[TR]
[TD="class: corpo1, align: left"]"modal"[/TD]
[TD="class: corpo1, align: left"]Opens a new window and blocks any interaction in the main window;[/TD]
[/TR]
[/TABLE]
In the case of modal target, there are two optional parameters *:
[B]*Height:[/B] Set the height of the modal window (default 440);
[B]*Width:[/B] Set the width of the modal window (default 630);
[B]Note:[/B] If omitted, will be assigned the value "_self".
[B]Ex. 1:[/B] [B]Creates a link to the costumer.php application, on the [/B][B]Id field, passing the [/B][B]global variable [global_costumer] as and the [/B][B]product field (local variable) {Id} to the [/B][B]costumer.php application:[/B]
sc_link(Id, costumer.php, product=[global_costumer]; Id={Id}, "Client Data", "_blank");
[B]Ex. 2:[/B] [B]Creating a dynamic link to another application depeding on the field valor {costumer_type} and opening it in a modal.[/B]
if ({costumer_type} == "F") {
sc_link (costumer_type, type_f.php, product=[global_costumer]; Id={Id}," Personal Data ", "modal", 500, 700);
}
else{
sc_link (costumer_type, type_a.php, product=[global_costumer]; Id={Id}," Company Data ", "iframeR");
}
[B]Ex. 3:[/B] [B]Creating a link to an URL: in this case, "paramater and target" have no effect. It will be executed redirecting to a informed URL.[/B]
sc_link (my_field, http://www.scriptcase.com, ,"hint of the link");
[/TD]
[/TR]
[/TABLE]
[B]Macro Scope[/B]
[TABLE="class: macros_desc_scope_table, cellpadding: 0, cellspacing: 0"]
[TR]
[TD]Grid application[/TD]
[TD]ReportPDF application[/TD]
[/TR]
[TR]
[TD="width: 120px, bgcolor: #f7f4f4"]onRecord[/TD]
[TD="width: 120px, bgcolor: #f7f4f4"]onRecord[/TD]
[/TR]
[/TABLE]