Announcement

Collapse
No announcement yet.

sc_redir passing and receiving parameter

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

  • sc_redir passing and receiving parameter

    How do I passing parameter from "Form A" to "Form B", And after selecting a field from "Form B", return the value back to "Form A" using sc_redir (or other commands). Similar to "Retrieve data from grid" but need to be called from with php code.

    1) In "Form A", after on_blur event of a field, I like to call "Form B"
    2) In "Form B", I like to have "Select" button in front of each row.
    3) After clicking "Select" button in "Form B", I like the value of first field in that row to be returned and use in 2nd field of "Form A"
    4) Similar to "Retrieve data from grid" but "Retrieve data from grid", I have to click an icon on the side of that field. I like the app to automatically call "Form B" after pressing Enter without clicking an icon.

    Please help.

  • #2
    Originally posted by capecode View Post
    How do I passing parameter from "Form A" to "Form B", And after selecting a field from "Form B", return the value back to "Form A" using sc_redir (or other commands). Similar to "Retrieve data from grid" but need to be called from with php code.

    1) In "Form A", after on_blur event of a field, I like to call "Form B"
    2) In "Form B", I like to have "Select" button in front of each row.
    3) After clicking "Select" button in "Form B", I like the value of first field in that row to be returned and use in 2nd field of "Form A"
    4) Similar to "Retrieve data from grid" but "Retrieve data from grid", I have to click an icon on the side of that field. I like the app to automatically call "Form B" after pressing Enter without clicking an icon.

    Please help.
    1.If you call another application using sc_redir then passing variables will be done inside this routine. Suppose you need to pass a field:

    sc_redir(myapp.php,myglobal={myfield},'_parent').

    The variable put in the sc_redir will become a global variable in your called application.

    2.In grids you can add an image as a custom field and apply a link to that to get a 'custom icon'.

    3.That depends on your link, but you can only return one variable.

    4. Don't understand that question. But if you need to apply something on enter you need to add custom javascript. In general this will not be easy to do in SC afaik.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      Aducom, what he sais is a Capture link but by code
      /Giuseppe

      Professional Scriptcase Services
      Some Customers opinions

      Comment


      • #4
        Originally posted by Giu View Post
        Aducom, what he sais is a Capture link but by code
        That would be hard to make. Only way I can think of is an application link.
        Albert Drent
        aducom software netherlands
        scriptcase partner, reseller, support and (turn-key) development
        www.scriptcase.eu / www.scriptcase.nl

        Comment


        • #5
          Yes, I meant Capture Link but called from php code.
          Would it be possible to implement it?

          Aducom, when you say an application link, please explain a little bit more. I will need the value from "Grid B" to be passed back to "Form A" too.

          Thanks.

          Comment


          • #6
            In general you use global variables to pass variables from one app to another, even if you have a return value. If you do it using sc_redir you need to pass them as parameters in this macro. Otherwise you can just use the bracket variables.
            Albert Drent
            aducom software netherlands
            scriptcase partner, reseller, support and (turn-key) development
            www.scriptcase.eu / www.scriptcase.nl

            Comment


            • #7
              Thanks Aducom for your advise. I tried passing parameters from sc_redir but I am unable to get "Grid B" to show "Select" button in front of each row (as in capture field link). Any ideas?

              Comment


              • #8
                Further update to my post, this is what I have tried

                1) From "Form A", I used sc_redir ("Grid B", [glo_var], modal)
                2) "Grid B" shows up and I add OnClick Event to the first field of "Grid B". In OnClick Event, I tried to assign [glo_var] = {GridB_Field1}. But apparently, this does not work (cannot assign value, don't know why).
                3) Again on Grid B, I change OnClick Event to call php method "AssignValue" and in Php method, I created "AssignValue" and put [glo_var] = {GridB_Field1}. This still doesn't work.
                4) Agian, I added an application link to "Field1" of "Grid B" and point it back to "Form A". After click Field 1 on Grid B, the app return back to "Form A" but I cannot get the value of "Field1 - Grid B" back.

                Any ideas or suggestion on how to assign value of "Field1" of "Grid B" back to "Form A"?

                Comment


                • #9
                  The only way afaik I know of to get a button in a grid is by adding it as a image field manually to the grid. But other point will be that you need to add custom php code to the event and you will only be able to create a link to the original application. I'm thinking of other solutions like applying a hyperlink to it calling a blank application, but I'm affraid I don't have a straight and good answer.
                  Albert Drent
                  aducom software netherlands
                  scriptcase partner, reseller, support and (turn-key) development
                  www.scriptcase.eu / www.scriptcase.nl

                  Comment


                  • #10
                    Originally posted by capecode View Post
                    Any ideas or suggestion on how to assign value of "Field1" of "Grid B" back to "Form A"?
                    Look at sc_master_value() ...
                    Best regards: - Reinhard -

                    I use ScriptCase 8 Enterprise Edition, Version 8.(latest)

                    Comment


                    • #11
                      Originally posted by RHS View Post
                      Look at sc_master_value() ...
                      Indeed! tnx. Rheinhart, overlooked that one.
                      Albert Drent
                      aducom software netherlands
                      scriptcase partner, reseller, support and (turn-key) development
                      www.scriptcase.eu / www.scriptcase.nl

                      Comment


                      • #12
                        Thanks. I'll give it a try.

                        Comment


                        • #13
                          Just an update. I just couldn't seem to find a way to return the value back even with sc_master_value(). I don't know what I did wrong but the code flow seems to stop in a php method where sc_master_value is present. When comment out sc_master_value, the code flows all the way.

                          Comment


                          • #14
                            Maybe don't works if it's not a master/detail relationship
                            /Giuseppe

                            Professional Scriptcase Services
                            Some Customers opinions

                            Comment


                            • #15
                              I saw all above and think it's not sc_master_value's thing.

                              If it's not a master/slave, the sc_master_value cannot work, and the capture link will not work if you want to fetch more than one result(such as you return a string separated with";", and resolve the string by yourself.).

                              I want to refresh the data of FormA after calling FormB, and to make it use for Scriptcase, save the FormB/GridB's result to tmp table.

                              And call like this cannot work either:

                              btnCall's OnClick:
                              sc_redir(gridb, modal);
                              {lblInfo} = Value fetched from table;

                              It's seems when sc_redir is called, the after code cannot execute.

                              Comment

                              Working...
                              X