Announcement

Collapse
No announcement yet.

Use of a link in a php script

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

  • Use of a link in a php script

    In a form I made a link (simply in the menu "links")
    How can I use this link in a php script?
    (In other words how can I "run" the self made link in a php-script?)

    Regards, Bert

  • #2
    By sc_redir where the link fields are put into the parameter list. sc_redir('yourapp.php', your parms,' _something');
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      Yes, but with sc_dir the application from which I start this action closes and there is no way back.
      Is there something like: call 'yourapp.php"
      The strange thing is that with SC you can make a link (application or capture) but there is nothing in the manual and else what explains what you can do with it.
      Ok the links are generated when i.e. you make a buton with the option link. But that something else.
      Pure make a link with "New link" and then...??
      Last edited by ctmservice; 07-04-2015, 04:33 AM.

      Comment


      • #4
        I dont understand. You can sc_redir to a form for example, and pressing "back" button form will come back to grid who called this form
        /Giuseppe

        Professional Scriptcase Services
        Some Customers opinions

        Comment


        • #5
          Besides that I like to know more of the options with making a link and use it.
          Time to start for SC to write a decent manual and a book for tips and tricks.....

          Have you tried to start the sc_dir from an form to an other form?
          Your starting form is closed and there is no way back....sorry
          So tell me an other "trick" to manage this.
          Last edited by ctmservice; 07-04-2015, 06:55 AM.

          Comment


          • #6
            Originally posted by ctmservice View Post
            Besides that I like to know more of the options with making a link and use it.
            Time to start for SC to write a decent manual and a book for tips and tricks.....
            Links in applications are a concept inside SC. There are not designed to call it by code. Application Link, Capture link, are binded to fields and buttons as is. If you create a button, and want to call this button by code, then inspect the DOM and use click() method on it.

            Have you tried to start the sc_dir from an form to an other form?
            Of course, I have a FormMaster/GridDetail form where I use a button to redir to detail form and come back to my form when done. I don't do anything special.

            Your starting form is closed and there is no way back.... sorry
            So tell me an other "trick" to manage this.
            Sorry, but still without understand. What do you mean with "is closed"? Obivously, if you redir you change from one page to other, if you don't want to first page to disappear, then with "_blank" open on new page or modal if you prefer.
            /Giuseppe

            Professional Scriptcase Services
            Some Customers opinions

            Comment


            • #7
              Originally posted by Giu View Post
              Links in applications are a concept inside SC. There are not designed to call it by code. Application Link, Capture link, are binded to fields and buttons as is. If you create a button, and want to call this button by code, then inspect the DOM and use click() method on it.



              Of course, I have a FormMaster/GridDetail form where I use a button to redir to detail form and come back to my form when done. I don't do anything special.



              Sorry, but still without understand. What do you mean with "is closed"? Obivously, if you redir you change from one page to other, if you don't want to first page to disappear, then with "_blank" open on new page or modal if you prefer.
              Bert, sc_redir moves control to another application, it's like calling another url. That's why you can't go back. I use sc_redir often with a return address in it. I.e. I have some forms to select a patient, doctor, hospital. Then in the oninit I chekc if the required data is there. If not I set the current application name as return address and then do a sc_redir to the form to select the required data. Then I use the return address to return to the previous application. It requires some hand work as this is not default behaviour of the standard exit buttons. But that doesn't mean that you can't do it...
              Albert Drent
              aducom software netherlands
              scriptcase partner, reseller, support and (turn-key) development
              www.scriptcase.eu / www.scriptcase.nl

              Comment


              • #8
                Hi Albert,

                Yes, You need some handword to come back with sc_redir. It is not as Giu says. But my chalance is more complex as only come back. I want to stay de first form open (window tab) so that you can switch between one and another. The 2 open forms should should always keep the relation. In the moment I do this with an global variable. Make a button with a link (follow the instructions and choose for new window). So far so good.
                Works fine. But now the next step. Open in the starting grid a second form (in my case customer) and do the same. Now you get a problem.
                Because of the global variable which makes the link, it mixes the relation between the in the mean time 4 open forms. It can happen that the second form is saved with data of the other customer.
                (I have two customers open with each customer has a second form with info). When I want to clear this I have to do something with the global variable.
                I have two options to solve this. Avoid the global variable between the 2 forms (this gives trouble because the global can be used in an other form) and set up something with a "session-table" or take-over the global variable directly after opening the second form and make a local variable of it so that the form always has the right relationkey when saving.
                For the first solution (writing a variable in a session table) I have to make a script in a button. But there came the question. How to do it. The action should start after pushing the button.
                So one line for writing the record id in the table and one line for open the second form. Where I started with a button and a link (which works fine except when you open a other customer form the grid and with this a second (fourth) form). In that case I have to programm php behind the button and not using a link. So I want the use a link which I can make, the same as when making a link via the button.
                There the question came up: how can i "execute" a link in a php.

                Wooh I hope you can follow my thoughts.....

                In the meantime I am going th experiment with takeover the global and make a local of it.

                Comment


                • #9
                  It is not as Giu says
                  Because I didnt understood what you try to do. Now i know, but don't have more ideas right now
                  /Giuseppe

                  Professional Scriptcase Services
                  Some Customers opinions

                  Comment


                  • #10
                    Ok Gentlemen,

                    I think I solved the issue:
                    When I open the second form then in the event "on applicationinit" there is an one time session record insert in a separate table ( i call it sessiontable) with the value of the passing global id (= unique customer id) of the first form.
                    In the event "onload" I pickup this latest record in the session table and use the found id for filling in the right place in the second form.
                    The sollution works ok. I think it is not suitable when many user do the same. I have to test. But in this case with a few users it is ok.
                    When there comes a new first form openend and the user opens the second form, there is a new record in the sessiontable and in this way unique.
                    So now I can swith between all the forms in the windows tab....very nice. Of course I give a name in the tab with the lay-out header and a variable.

                    This all came up from a customer who gets many telephone calls and do not want to start the conversation with filling in the first form and start with the second form and come back later to fill in name, street etc in the first form.
                    And it can happen that a second call is comming in while the first is still open...So there are more then 2 foms open.
                    I dont border about the growing sessiontable. I use it also for recording username and date. Nice for the statistics.

                    We can....now

                    Regards Bert
                    Last edited by ctmservice; 07-04-2015, 12:38 PM.

                    Comment


                    • #11
                      Thanks for your follow up Bert.
                      Albert Drent
                      aducom software netherlands
                      scriptcase partner, reseller, support and (turn-key) development
                      www.scriptcase.eu / www.scriptcase.nl

                      Comment

                      Working...
                      X