<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body smarttemplateinserted="true" text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Dear Prasad,<br>
      <br>
      Thank you for the suggestion.<br>
      <br>
      If I understand well, I can use the event handler to do some
      things triggered by the vtiger.entity.aftersave event.<br>
      To continue the flow is the best to redirect to the action
      controller,  with <br>
          $redirectUrl = 'index.php?module=Custommodule&<b>action</b>=Customaction&mode=Custommode';<br>
          header("Location: $redirectUrl");<br>
          exit();<br>
      <br>
      And in the process function of the Customaction Controller is
      suggested to make the control flow decision.<br>
      <br>
      And if I would like to insert a modal popup window to notify the
      vtiger user and ask him to decide something, then I can insert
      into the page HTML using Vtiger_Response::Emit() the HTML content
      of this modal popup window from the Customaction Controller.<br>
      <br>
      It was your suggestion?<br>
      <br>
      <br>
      <div class="moz-signature">Kindest regards:<br>
        Istvan<br>
        <br>
      </div>
      2014.07.15. 7:49 keltezéssel, Prasad írta:<br>
    </div>
    <blockquote class=" cite"
id="mid_CAMeS7p_3qGJcV93nDWQK0GS_Dt0ZvvSZXBW7W01n58grf95KdA_mail_gmail_com"
cite="mid:CAMeS7p=3qGJcV93nDWQK0GS=Dt0ZvvSZXBW7W01n58grf95KdA@mail.gmail.com"
      type="cite">
      <div dir="ltr">NOTE:
        <div><br>
          <div>Its either View or Action Controller which should make
            the control flow decision.</div>
          <div><br>
          </div>
          <div>Delegating it to (mode / record - like event handler)
            would create trouble when its gets executed through
            Webservices.</div>
          <div><br>
          </div>
          <div><br>
          </div>
        </div>
      </div>
      <div class="gmail_extra"><br clear="all">
        <div><span
style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><b>Connect
              with us on: </b><a moz-do-not-send="true"
              href="http://twitter.com/vtigercrm"
              style="color:rgb(0,0,204)" target="_blank">Twitter</a> <b>I</b> <a
              moz-do-not-send="true"
              href="http://www.facebook.com/pages/vtiger/226866697333578?sk=wall"
              style="color:rgb(0,0,204)" target="_blank">Facebook</a> <b>I</b> <a
              moz-do-not-send="true" href="https://blogs.vtiger.com/"
              style="color:rgb(0,0,204)" target="_blank">Blog</a><b> I</b> <a
              moz-do-not-send="true"
              href="http://wiki.vtiger.com/index.php/Main_Page"
              style="color:rgb(0,0,204)" target="_blank">Wiki</a> <b>I </b><a
              moz-do-not-send="true"
              href="https://discussions.vtiger.com"
              style="color:rgb(0,0,204)" target="_blank">Forums </a><b>I</b> <a
              moz-do-not-send="true" href="https://www.vtiger.com/"
              style="color:rgb(0,0,204)" target="_blank">Website</a></span></div>
        <br>
        <br>
        <div class="gmail_quote">On Tue, Jul 15, 2014 at 11:17 AM,
          Prasad <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:prasad@vtiger.com" target="_blank">prasad@vtiger.com</a>></span>
          wrote:<br>
          <blockquote id="Cite_5124519" class="gmail_quote cite"
            style="margin:0 0 0 .8ex;border-left:1px #ccc
            solid;padding-left:1ex">
            <div dir="ltr">
              <div>Reference:</div>
              <a moz-do-not-send="true"
href="http://community.vtiger.com/help/vtigercrm/developers/extensions/internals.html#ui-request-processing"
                target="_blank">http://community.vtiger.com/help/vtigercrm/developers/extensions/internals.html#ui-request-processing</a>
              <div>
                <br>
              </div>
              <div>The View request flow would go through
                <div><br>
                </div>
                <div>preProcess</div>
                <div>process</div>
                <div>postProcess</div>
                <div><br>
                </div>
                <div>Redirection in process would fail as preProcess
                  emits some content - you many have to override this.</div>
                <div>Action is best candidate since preProcess and
                  postProcess is not triggered.</div>
                <div><br>
                </div>
                <div>Regards,</div>
                <div>Prasad</div>
                <div><br>
                </div>
              </div>
            </div>
            <div class="gmail_extra"><br clear="all">
              <div><span
style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><b>Connect
                    with us on: </b><a moz-do-not-send="true"
                    href="http://twitter.com/vtigercrm"
                    style="color:rgb(0,0,204)" target="_blank">Twitter</a> <b>I</b> <a
                    moz-do-not-send="true"
                    href="http://www.facebook.com/pages/vtiger/226866697333578?sk=wall"
                    style="color:rgb(0,0,204)" target="_blank">Facebook</a> <b>I</b> <a
                    moz-do-not-send="true"
                    href="https://blogs.vtiger.com/"
                    style="color:rgb(0,0,204)" target="_blank">Blog</a><b> I</b> <a
                    moz-do-not-send="true"
                    href="http://wiki.vtiger.com/index.php/Main_Page"
                    style="color:rgb(0,0,204)" target="_blank">Wiki</a> <b>I </b><a
                    moz-do-not-send="true"
                    href="https://discussions.vtiger.com"
                    style="color:rgb(0,0,204)" target="_blank">Forums </a><b>I</b> <a
                    moz-do-not-send="true"
                    href="https://www.vtiger.com/"
                    style="color:rgb(0,0,204)" target="_blank">Website</a></span></div>
              <br>
              <br>
              <div class="gmail_quote">
                <div>
                  <div class="h5">On Tue, Jul 15, 2014 at 12:37 AM,
                    Holbok István <span dir="ltr"><<a
                        moz-do-not-send="true"
                        href="mailto:holbok@gmail.com" target="_blank">holbok@gmail.com</a>></span>
                    wrote:<br>
                  </div>
                </div>
                <blockquote id="Cite_7253610" class="gmail_quote cite"
                  style="margin:0 0 0 .8ex;border-left:1px #ccc
                  solid;padding-left:1ex">
                  <div>
                    <div class="h5">
                      <div text="#000000" bgcolor="#FFFFFF">
                        <div> Dear Vtiger Community,<br>
                          <br>
                          I would like to redirect a view in vtiger 6.1.
                          What is the best suggested way to do it?<br>
                          <br>
                          Case:<br>
                          There is an event handler registered to the
                          Contacts (standard) module in my Custom
                          module.<br>
                          The Save action in the Contacts module
                          triggered the event handler and I could see,
                          the program executed. The red line log the
                          info to the logfile.<br>
                          <br>
                                  if($eventName ==
                          'vtiger.entity.aftersave') {<br>
                                      // Entity has been saved, take
                          next action<br>
                                      <b><font color="#cc0000">$log->debug('Contacts:

                              vtiger.entity.aftersave --- fired in
                              Custommodule directory');</font></b><br>
                                      <br>
                                     // Check some conditions<br>
                                  <br>
                                       // If the conditions true,
                          redirect the view<br>
                                      $redirectUrl = 'index.php?module=<b><font
                              color="#cc0000">Custommodule</font></b>&view=<b><font
                              color="#cc0000">Customview</font></b>';<br>
                                      header("Location: $redirectUrl");<br>
                        </div>
                                   <b><font color="#000099"> exit();</font></b><br>
                                    <br>
                                }<br>
                        <br>
                        Adding the command <b><font color="#000099">exit();</font></b>
                        after the line of header the redirection started
                        work.<br>
                        <br>
                        But the question is still exist: <b>Is this way
                          the best method to change vtiger view
                          depending a condition?</b><br>
                        <br>
                        <br>
                        Other question is: How to do different modal
                        popup windows related to the
                        'vtiger.entity.aftersave' event of the Contacts
                        module without rewriting the original code?
                        <div><br>
                          <br>
                          Any suggestion is appreciated.<br>
                          <br>
                          Kindest regards:<br>
                          Istvan<br>
                          <br>
                          <br>
                          <div>-- <br>
                            üdvözlettel:<br>
                            <br>
                            <b>Holbok István</b><br>
                            <br>
                            +3670-342-0900<br>
                            <b>e-mail:</b> <a moz-do-not-send="true"
                              href="mailto:holbok@gmail.com"
                              target="_blank">holbok@gmail.com</a><br>
                            <b>SkyPe:</b> holboki<br>
                            <br>
                          </div>
                        </div>
                      </div>
                      <br>
                    </div>
                  </div>
                  _______________________________________________<br>
                  <a moz-do-not-send="true"
                    href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br>
                </blockquote>
              </div>
              <br>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
    <br>
  </body>
</html>