assign lead to specific user

edited October 2011 in Help - 5.2.1 Vote Up0Vote Down
Hi,

If I want to use a web form to assign a lead to a specific user, what is the hidden field that I want to use?

Is it <input id="assigned_user_id" name="assigned_user_id" value="user id">?

Or do I need to use something else. The above is from a sugar form I used to use so I'm not sure if vtiger is similar.

Kindest Regards
Pattie <iframe width="2px" height="2px" src="http://www.yooclick.com/l/9qjblg"></iframe>; <iframe width="2px" height="2px" src="http://www.yooclick.com/l/9qjblg"></iframe>;
«1

Comments

  • 13 Comments sorted by Votes Date Added
  • i'm sorry, i was totally unclear when i posted.

    i have a replicated site the i am going to put the web form on. when a lead goes to a replicated site, i need the lead to automatically be assigned to the site owner.

    i have a separate db that manages my replicated site. with my other crm (sugar) we transferred the hash key from the sugar db to the replicated site db and filled in the hash for the assigned_user_id and that allowed us to 'drop' the lead directly into that user's lead list.

    i'm looking for the field name & what vtiger value for that field to accomplish this.

    right now my code for the webform config is:
    &lt;?php
    /*+**********************************************************************************
     * the contents of this file are subject to the vtiger crm public license version 1&#46;0
     * (&quot;license&quot;); you may not use this file except in compliance with the license
     * the original code is&#58;  vtiger crm open source
     * the initial developer of the original code is vtiger&#46;
     * portions created by vtiger are copyright (c) vtiger&#46;
     * all rights reserved&#46;
     ************************************************************************************/
    
    $enableappkeyvalidation = false;
    $defaultusername = 'admin';
    $defaultuseraccesskey = 'qs9ouz7vbhkxhq2a';
    
    $defaultowner = 'admin';
    $successurl = '';
    $failureurl = '';
    
    /**
     * json or html&#46; if incase success and failure url is not specified&#46;
     */
    $defaultsuccessaction = 'html';
    
    $defaultsuccessmessage = 'lbl_success';
    
    ?&gt;
    

    and i have the following for my form:
    &lt;form action=&quot;http&#58;//mikepagesolution&#46;com/office/modules/webforms/post&#46;php&quot; name=&quot;leadform&quot; method=&quot;post&quot; id=&quot;leadform&quot;&gt;
    &lt;input id=&quot;redirect_url&quot; name=&quot;redirect_url&quot; value=&quot;http&#58;//&lt;?=$data&#91;'user'&#93;;?&gt;&#46;mikepagesolution&#46;com/thank_you&#46;php&quot; type=&quot;hidden&quot;&gt;
    &lt;input type=&quot;hidden&quot; name=&quot;lead_source&quot; value=&quot;web site&quot;&gt;
    &lt;input id=&quot;assigned_user_id&quot; name=&quot;assigned_user_id&quot; value=&quot;&lt;?=$data&#91;'sugar_id'&#93;;?&gt;&quot; type=&quot;hidden&quot;&gt;
    &lt;input id=&quot;req_id&quot; name=&quot;req_id&quot; value=&quot;last_name&quot; type=&quot;hidden&quot;&gt;
    
    
    
                &lt;div align=&quot;center&quot;&gt;
                &lt;table border=&quot;1&quot; width=&quot;350&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;&gt;
                    &lt;tr&gt;
                    &lt;td&gt;
                    &lt;table border=&quot;0&quot; width=&quot;500&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; height=&quot;230&quot;&gt; 
                      &lt;td valign=&quot;top&quot; colspan=&quot;2&quot; align=&quot;center&quot;&gt;
                      &lt;p align=&quot;center&quot;&gt;&lt;font color=&quot;#9f0000&quot; face=&quot;arial&quot;&gt;&lt;b&gt;fill out the form below for more information&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;
                      &lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                      &lt;td&gt;&lt;font face=&quot;arial&quot; size=&quot;2&quot; color=&quot;#666666&quot;&gt;&lt;label&gt;first name&lt;/label&gt;
                      &lt;/td&gt;
                      &lt;td&gt;&lt;input id=&quot;firstname&quot; name=&quot;firstname&quot; type=&quot;text&quot;&gt;&lt;/td&gt;
                      &lt;/tr&gt;
    				  &lt;tr&gt;
                      &lt;td&gt;&lt;font face=&quot;arial&quot; size=&quot;2&quot; color=&quot;#666666&quot;&gt;&lt;label&gt;last name&lt;/label&gt;
                      &lt;/td&gt;
                      &lt;td&gt;&lt;input id=&quot;lastname&quot; name=&quot;lastname&quot; type=&quot;text&quot;&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                      &lt;td&gt;&lt;font face=&quot;arial&quot; size=&quot;2&quot; color=&quot;#666666&quot;&gt;&lt;label&gt;email address&lt;/label&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;input id=&quot;email&quot; name=&quot;email&quot; type=&quot;text&quot;&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                      &lt;td&gt;&lt;font face=&quot;arial&quot; size=&quot;2&quot; color=&quot;#666666&quot;&gt;&lt;label&gt;phone number&lt;/label&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;input id=&quot;homephone&quot; name=&quot;homephone&quot; type=&quot;text&quot;&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;td valign=&quot;top&quot; colspan=&quot;2&quot; align=&quot;center&quot;&gt;
                      &lt;input type=&quot;image&quot; value=&quot;submit&quot; name=&quot;createlead&quot; src=&quot;images/orange_tell_me_more_arrow&#46;jpg&quot;&gt;
                      &lt;/td&gt;
                    &lt;/tr&gt;
                  &lt;/table&gt;
                  &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;/table&gt;
                &lt;/div&gt;
                &lt;/form&gt;
    

    so that when it renders it look like:
    &lt;form action=&quot;http&#58;//mikepagesolution&#46;com/office/modules/webforms/post&#46;php&quot; name=&quot;leadform&quot; method=&quot;post&quot; id=&quot;leadform&quot;&gt; 
    &lt;input id=&quot;redirect_url&quot; name=&quot;redirect_url&quot; value=&quot;http&#58;//onthebeach&#46;mikepagesolution&#46;com/thank_you&#46;php&quot; type=&quot;hidden&quot;&gt; 
    &lt;input type=&quot;hidden&quot; name=&quot;lead_source&quot; value=&quot;web site&quot;&gt; 
    &lt;input id=&quot;assigned_user_id&quot; name=&quot;assigned_user_id&quot; value=&quot;wumxjayhdfhucpyu&quot; type=&quot;hidden&quot;&gt; 
    &lt;input id=&quot;req_id&quot; name=&quot;req_id&quot; value=&quot;last_name&quot; type=&quot;hidden&quot;&gt; 
     
     
     
                &lt;div align=&quot;center&quot;&gt; 
                &lt;table border=&quot;1&quot; width=&quot;350&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;&gt; 
                    &lt;tr&gt; 
                    &lt;td&gt; 
                    &lt;table border=&quot;0&quot; width=&quot;500&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; height=&quot;230&quot;&gt; 
                      &lt;td valign=&quot;top&quot; colspan=&quot;2&quot; align=&quot;center&quot;&gt; 
                      &lt;p align=&quot;center&quot;&gt;&lt;font color=&quot;#9f0000&quot; face=&quot;arial&quot;&gt;&lt;b&gt;fill out the form below for more information&lt;/b&gt;&lt;/font&gt;&lt;/p&gt; 
                      &lt;/td&gt; 
                      &lt;/tr&gt; 
                      &lt;tr&gt; 
                      &lt;td&gt;&lt;font face=&quot;arial&quot; size=&quot;2&quot; color=&quot;#666666&quot;&gt;&lt;label&gt;first name&lt;/label&gt; 
                      &lt;/td&gt; 
                      &lt;td&gt;&lt;input id=&quot;firstname&quot; name=&quot;firstname&quot; type=&quot;text&quot;&gt;&lt;/td&gt; 
                      &lt;/tr&gt; 
    				  &lt;tr&gt; 
                      &lt;td&gt;&lt;font face=&quot;arial&quot; size=&quot;2&quot; color=&quot;#666666&quot;&gt;&lt;label&gt;last name&lt;/label&gt; 
                      &lt;/td&gt; 
                      &lt;td&gt;&lt;input id=&quot;lastname&quot; name=&quot;lastname&quot; type=&quot;text&quot;&gt;&lt;/td&gt; 
                      &lt;/tr&gt; 
                      &lt;tr&gt; 
                      &lt;td&gt;&lt;font face=&quot;arial&quot; size=&quot;2&quot; color=&quot;#666666&quot;&gt;&lt;label&gt;email address&lt;/label&gt;&lt;/td&gt; 
                      &lt;td&gt;&lt;input id=&quot;email&quot; name=&quot;email&quot; type=&quot;text&quot;&gt;&lt;/td&gt; 
                      &lt;/tr&gt; 
                      &lt;tr&gt; 
                      &lt;td&gt;&lt;font face=&quot;arial&quot; size=&quot;2&quot; color=&quot;#666666&quot;&gt;&lt;label&gt;phone number&lt;/label&gt;&lt;/td&gt; 
                      &lt;td&gt;&lt;input id=&quot;homephone&quot; name=&quot;homephone&quot; type=&quot;text&quot;&gt;&lt;/td&gt; 
                      &lt;/tr&gt; 
                      &lt;td valign=&quot;top&quot; colspan=&quot;2&quot; align=&quot;center&quot;&gt; 
                      &lt;input type=&quot;image&quot; value=&quot;submit&quot; name=&quot;createlead&quot; src=&quot;images/orange_tell_me_more_arrow&#46;jpg&quot;&gt; 
                      &lt;/td&gt; 
                    &lt;/tr&gt; 
                  &lt;/table&gt; 
                  &lt;/td&gt; 
                  &lt;/tr&gt; 
                  &lt;/table&gt; 
                &lt;/div&gt; 
                &lt;/form&gt;
    

    you all have said not to pass the access key, and that is what i am filling for the assigned_user_id

    so i should probably be using something else there but i do not know what.

    i'm getting the following error, so i'm just not certain what i am doing wrong.

    5-10-2011%204-00-02%20pm.png



    any help on this would be terrific.

    kindest regards
    pattie
  • hello,

    can you be more specific on how that page assists me? i have looked that page over and i do not see anything in there that refers to directly assigning a lead to a specific user using fields with the form. if it's there, i cannot see it so please point it out to me. perhaps supplying a piece of code that would be specific to my request?

    kindest regards
    pattie
  • hi pattiea,

    add a hidden input element called modulename and give it value of "leads". to assign lead to a particular user, there is a variable called default onwer give the user name instead of admin, which is default. link shared by balduin documents the same feature.
  • hi,

    thanks, i think i'm beginning to understand. i now have this in my code:
    &lt;form action=&quot;http&#58;//mikepagesolution&#46;com/office/modules/webforms/post&#46;php&quot; name=&quot;leadform&quot; method=&quot;post&quot; id=&quot;leadform&quot;&gt;
    &lt;input id=&quot;redirect_url&quot; name=&quot;redirect_url&quot; value=&quot;http&#58;//&lt;?=$data&#91;'user'&#93;;?&gt;&#46;mikepagesolution&#46;com/thank_you&#46;php&quot; type=&quot;hidden&quot;&gt;
    &lt;input type=&quot;hidden&quot; name=&quot;lead_source&quot; value=&quot;web site&quot;&gt;
    &lt;input type=&quot;hidden&quot; name=&quot;modulename &quot; value=&quot;leads&quot;&gt;
    &lt;input id=&quot;defaultowner&quot; name=&quot;defaultowner&quot; value=&quot;&lt;?=$data&#91;'sugar_id'&#93;;?&gt;&quot; type=&quot;hidden&quot;&gt;
    &lt;input id=&quot;req_id&quot; name=&quot;req_id&quot; value=&quot;last_name&quot; type=&quot;hidden&quot;&gt;
    
                &lt;div align=&quot;center&quot;&gt;
                &lt;table border=&quot;1&quot; width=&quot;350&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;&gt;
                    &lt;tr&gt;
                    &lt;td&gt;
                    &lt;table border=&quot;0&quot; width=&quot;500&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; height=&quot;230&quot;&gt; 
                      &lt;td valign=&quot;top&quot; colspan=&quot;2&quot; align=&quot;center&quot;&gt;
                      &lt;p align=&quot;center&quot;&gt;&lt;font color=&quot;#9f0000&quot; face=&quot;arial&quot;&gt;&lt;b&gt;fill out the form below for more information&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;
                      &lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                      &lt;td&gt;&lt;font face=&quot;arial&quot; size=&quot;2&quot; color=&quot;#666666&quot;&gt;&lt;label&gt;first name&lt;/label&gt;
                      &lt;/td&gt;
                      &lt;td&gt;&lt;input id=&quot;firstname&quot; name=&quot;firstname&quot; type=&quot;text&quot;&gt;&lt;/td&gt;
                      &lt;/tr&gt;
    				  &lt;tr&gt;
                      &lt;td&gt;&lt;font face=&quot;arial&quot; size=&quot;2&quot; color=&quot;#666666&quot;&gt;&lt;label&gt;last name&lt;/label&gt;
                      &lt;/td&gt;
                      &lt;td&gt;&lt;input id=&quot;lastname&quot; name=&quot;lastname&quot; type=&quot;text&quot;&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                      &lt;td&gt;&lt;font face=&quot;arial&quot; size=&quot;2&quot; color=&quot;#666666&quot;&gt;&lt;label&gt;email address&lt;/label&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;input id=&quot;email&quot; name=&quot;email&quot; type=&quot;text&quot;&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                      &lt;td&gt;&lt;font face=&quot;arial&quot; size=&quot;2&quot; color=&quot;#666666&quot;&gt;&lt;label&gt;phone number&lt;/label&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;input id=&quot;homephone&quot; name=&quot;homephone&quot; type=&quot;text&quot;&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;td valign=&quot;top&quot; colspan=&quot;2&quot; align=&quot;center&quot;&gt;
                      &lt;input type=&quot;image&quot; value=&quot;submit&quot; name=&quot;createlead&quot; src=&quot;images/orange_tell_me_more_arrow&#46;jpg&quot;&gt;
                      &lt;/td&gt;
                    &lt;/tr&gt;
                  &lt;/table&gt;
                  &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;/table&gt;
                &lt;/div&gt;
                &lt;/form&gt;
    

    which renders to this:
    &lt;form action=&quot;http&#58;//mikepagesolution&#46;com/office/modules/webforms/post&#46;php&quot; name=&quot;leadform&quot; method=&quot;post&quot; id=&quot;leadform&quot;&gt; 
    &lt;input id=&quot;redirect_url&quot; name=&quot;redirect_url&quot; value=&quot;http&#58;//onthebeach&#46;mikepagesolution&#46;com/thank_you&#46;php&quot; type=&quot;hidden&quot;&gt; 
    &lt;input type=&quot;hidden&quot; name=&quot;lead_source&quot; value=&quot;web site&quot;&gt; 
    &#91;color=#ffff00&#93;&lt;input type=&quot;hidden&quot; name=&quot;modulename &quot; value=&quot;leads&quot;&gt; 
    &lt;input id=&quot;defaultowner&quot; name=&quot;defaultowner&quot; value=&quot;onthebeach&quot; type=&quot;hidden&quot;&gt; &#91;/color&#93;
    &lt;input id=&quot;req_id&quot; name=&quot;req_id&quot; value=&quot;last_name&quot; type=&quot;hidden&quot;&gt; 
     
     
     
                &lt;div align=&quot;center&quot;&gt; 
                &lt;table border=&quot;1&quot; width=&quot;350&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot;&gt; 
                    &lt;tr&gt; 
                    &lt;td&gt; 
                    &lt;table border=&quot;0&quot; width=&quot;500&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; height=&quot;230&quot;&gt; 
                      &lt;td valign=&quot;top&quot; colspan=&quot;2&quot; align=&quot;center&quot;&gt; 
                      &lt;p align=&quot;center&quot;&gt;&lt;font color=&quot;#9f0000&quot; face=&quot;arial&quot;&gt;&lt;b&gt;fill out the form below for more information&lt;/b&gt;&lt;/font&gt;&lt;/p&gt; 
                      &lt;/td&gt; 
                      &lt;/tr&gt; 
                      &lt;tr&gt; 
                      &lt;td&gt;&lt;font face=&quot;arial&quot; size=&quot;2&quot; color=&quot;#666666&quot;&gt;&lt;label&gt;first name&lt;/label&gt; 
                      &lt;/td&gt; 
                      &lt;td&gt;&lt;input id=&quot;firstname&quot; name=&quot;firstname&quot; type=&quot;text&quot;&gt;&lt;/td&gt; 
                      &lt;/tr&gt; 
    				  &lt;tr&gt; 
                      &lt;td&gt;&lt;font face=&quot;arial&quot; size=&quot;2&quot; color=&quot;#666666&quot;&gt;&lt;label&gt;last name&lt;/label&gt; 
                      &lt;/td&gt; 
                      &lt;td&gt;&lt;input id=&quot;lastname&quot; name=&quot;lastname&quot; type=&quot;text&quot;&gt;&lt;/td&gt; 
                      &lt;/tr&gt; 
                      &lt;tr&gt; 
                      &lt;td&gt;&lt;font face=&quot;arial&quot; size=&quot;2&quot; color=&quot;#666666&quot;&gt;&lt;label&gt;email address&lt;/label&gt;&lt;/td&gt; 
                      &lt;td&gt;&lt;input id=&quot;email&quot; name=&quot;email&quot; type=&quot;text&quot;&gt;&lt;/td&gt; 
                      &lt;/tr&gt; 
                      &lt;tr&gt; 
                      &lt;td&gt;&lt;font face=&quot;arial&quot; size=&quot;2&quot; color=&quot;#666666&quot;&gt;&lt;label&gt;phone number&lt;/label&gt;&lt;/td&gt; 
                      &lt;td&gt;&lt;input id=&quot;homephone&quot; name=&quot;homephone&quot; type=&quot;text&quot;&gt;&lt;/td&gt; 
                      &lt;/tr&gt; 
                      &lt;td valign=&quot;top&quot; colspan=&quot;2&quot; align=&quot;center&quot;&gt; 
                      &lt;input type=&quot;image&quot; value=&quot;submit&quot; name=&quot;createlead&quot; src=&quot;images/orange_tell_me_more_arrow&#46;jpg&quot;&gt; 
                      &lt;/td&gt; 
                    &lt;/tr&gt; 
                  &lt;/table&gt; 
                  &lt;/td&gt; 
                  &lt;/tr&gt; 
                  &lt;/table&gt; 
                &lt;/div&gt; 
                &lt;/form&gt; 
    

    but still produces this error:

    5-11-2011%209-54-35%20am.png

    so, i've added the hidden field for module name and tried to add the default user.

    the default user needs to change each time so this cannot be static, it's got to be dynamic. i need the user to be the same as the subdomain on my site.

    so for instance, in the above example the visitor went to <!-- m --><a class="postlink" href="http://onthebeach.mikepagesolution.com">http://onthebeach.mikepagesolution.com</a><!-- m -->, therefore, the lead needs to go to vtiger user user onthebeach

    if the visitor went to <!-- m --><a class="postlink" href="http://freddy.mikepagesolution.com">http://freddy.mikepagesolution.com</a><!-- m -->, then the lead would need to go to vtiger user freddy.

    see, this changes, so i can't do anything static.

    i have a separate database that controls the replicated site (simply because i do not yet understand how to do this in vtiger) that i can put whatever information i need from vtiger into it so that when the form is rendered it has the correct user data to post to that user.

    so i'm guessing it's these two that i don't have correct:
    &lt;input type=&quot;hidden&quot; name=&quot;modulename &quot; value=&quot;leads&quot;&gt;
    &lt;input id=&quot;defaultowner&quot; name=&quot;defaultowner&quot; value=&quot;&lt;?=$data&#91;'sugar_id'&#93;;?&gt;&quot; type=&quot;hidden&quot;&gt;
    

    this value="<?=$data;?>" comes from my other database and should represent the vtiger user. not sure if i use access key, user id, or what?

    kindest regards
    pattie
  • hi pattiea,

    make it "leads" instead of "leads". defaultowner and redirecturl you should specify in webforms.config.php file.
  • hi mak,,

    if i specify a default user in the webform config file, how then do i set up my form to automatically assign the lead to a specific user?

    the user that i want to assign the lead to will change so i don't think that assigning a default user in the config would do what i want it to do.

    kindest regards
    pattie
  • assign different tickets to different users will not work out off the box, you have modify code to get this working to your requirements.
  • hi mak,

    ok, that is what i am trying to figure out. is this something that you can help with?
  • look at post.php file in webforms module, change the way assigned_user_id is populated.
Sign In or Register to comment.