• Resolved graham6117

    (@graham6117)


    Hi,

    I am trying to pass a parameter from an update form to a thank you page. I want to pass the id of the record which is in the querystring (?id=) of the update form. I have seen a similar post on here but I could not get it working based on that. What am I doing wrong? I have tried the following (among a few others).

    #1
    {% form entity=”contact” mode=”edit” record=currentrecord hide_form=”true” name=”Web Update” parameters={ “id”: params.id } redirect=”/share/?id={{params.id}}” %}

    #2
    {% form entity=”contact” mode=”edit” record=currentrecord hide_form=”true” name=”Web Update” parameters={ “id”: params.id } redirect=”/share/?id=” ~ params.id %}

    #3
    {% form entity=”contact” mode=”edit” record=currentrecord hide_form=”true” name=”Web Update” parameters={ “id”: params.id } redirect=”{{ ‘/share/?id=’ ~ params.id }}” %}

    Thank you for your help!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor wizardist

    (@wizardist)

    Hi @graham6117

    Let me assume that ?id= holds the GUID of the record you are editing with a form.

    The form tag doesn’t accept a parameters argument – so it doesn’t make sense. You specify the record you’re eager to edit with the record parameter. In your code you use currentrecord which is good.

    In terms of Twig syntax, the second example is close to excellent!

    
    {% set redirectUrl = "/share/?id=" ~ currentrecord.id
    {% form entity="contact" name="Web Update" mode="edit" record=currentrecord redirect=redirectUrl %}
    

    HTH

    • This reply was modified 6 years ago by wizardist.
    Thread Starter graham6117

    (@graham6117)

    That works perfectly, thank you for the help.

    On a semi-related note, is it possible to include new data in the referral URL? So that if someone creates a new record using a form, their firstname (for insatance) can be passed as a parameter to the next page?

    Plugin Contributor wizardist

    (@wizardist)

    @graham6117

    That would require custom code to be written. wordpresscrm_twig_form_submit_success action in src/Form/Model.php has two arguments, the submitted form with the new data, and the CRM record with new data too.

    You can add_action() it and make a redirection by yourself.

    Thanks

    Thread Starter graham6117

    (@graham6117)

    Great, thank you for your help today!

    pritysingh27

    (@pritysingh27)

    Hi this is my code
    [msdyncrm_form entity=”lead” name=”NewContactForm” mode=”create” captcha=”true” redirect=”https://www.solzit.com/thank-you-4/” hide_form=”true”]

    How to use redirect thank you page. I can’t understand.
    Please clearify me ..

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Redirect with parameters’ is closed to new replies.