Announcement

Collapse
No announcement yet.

Add a Link with parameters

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

  • Add a Link with parameters

    I would like to create a button or link in the detailed lead view in EspoCRM that redirects to another page while passing lead data (e.g., email, name, etc.) as URL parameters. Specifically, I want to link to a booking tool where certain fields, such as email and name, are pre-filled via URL parameters. How can I create such a button or text link and embed the required parameters into the URL?

  • #2
    I think this could be achieved with the Kharg extension.
    Hello Everyone, Today I am releasing a new extension: Link Button This extension enhances EspoCRM by introducing a button field that can store URLs and execute multiple actions, including: Open the URL in a new browser tab. Displaying the URL content within a popup window. Embedding the URL content inside an Espo Modal.


    Simply fill this link button with a formula and the parameters are transferred to the other page.​

    Comment


    • Kharg
      Kharg commented
      Editing a comment
      Nice extension, I recommend it as well

  • #3
    Thx - i installed the plugin and was able to create a button and also to insert a link. But what do you meant with formula? How can i append lets say the email as a parameter to the url?

    Comment


  • #4
    Thx - but i still dont know what to do. Also i dont know where to put this new string into so that it is in every button?

    Comment


    • #5
      You have to "tell" the link everything, that you want to insert as the link and parameters. The parameter for opening the users e-mail client is href="mailto:contact@yourdomain.com", what means that you will have to build the whole string for the link with a formula (string\concatenate). How to do that is described in the documentation, it is easy.
      Then you create the button and place it in your detail view of the respective entity. After that you will have to re-calculate all records, where the button should appear. This way the button should open the link as you wish.
      If you still have problems, post the link with parameters, which you want to attach to the button, we can have a look and help.​

      Comment


      • #6
        Thx - but i am a little confused. Actually the button is created and a url is added - but so far i havent used any formula to add the parameters. Lets say the url is "https://domain.com?firstname=<Firstname>;Lastname=<lastnam e>,email=<email>" How could i create that?

        Comment


        • #7
          I would do it like this:

          PHP Code:

          buttonname 
          string\concatenate('https://domain.com/?firstname=',{Vorname},'&Nachname=',{Nachname},'&email=',{E-Mail}); 
          But whether the requested page can interpret it that way is another question.

          The only thing that irritates me is that the first name is written in English and the last name in German. The parameters would have to match the requested page, otherwise it won't work.
          Last edited by ChrisSka83; 09-26-2024, 09:29 AM.

          Comment


          • #8
            Thx - i put in my correct link and the parameters, but i still have a problem. Where do i put this php code to? I put it in Standard, but then the PHP-Code is as link in the button and not the gererated String - that throws an error if i want to save a new created link

            Comment


            • #9
              No, completely wrong.

              #Admin/entityManager -> then your desired entity
              -> formula -> custom script before saving.

              Enter the formula there. Save.
              Then go to the frontend, select your entry that should receive this formula.
              In the actions drop-down menu above it, select -> Recalculate formula.​

              Comment

              Working...
              X