Announcement

Collapse
No announcement yet.

Anyone having problem with sc_link onRecord with form application?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

    Code:
    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..

  • #2
    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

    Comment


    • #3
      Originally posted by jsbinca View Post
      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
      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.

      Comment

      Working...
      X