Tech Support > Microsoft Windows > Windows CRM > Jscript on Lead Form?
Jscript on Lead Form?
Posted by Dan white on September 7th, 2006


I am real new to CRM, and would like some step by step advice or sample code,
but basically what I want to do is on the LEAD Form when someone filles out
the First name field and then the lastname field I want to autopopulate the
Customer Name field with First and Last Name.

I assume I would do this on the onchange event in the lastname field, But I
am puzzled, or just cant figure out How to do this.

Thanks

Posted by Mitch Milam on September 7th, 2006


Dan,

Here you go:

crmForm.all.companyname.DataValue = crmForm.all.firstname.DataValue +
" " + crmForm.all.lastname.DataValue


Mitch
blogs.infinte-x.net


"Dan white" wrote:

Posted by MattNC on September 8th, 2006


You might also consider adding that to the firstname field since you can
never predict what order users will input data, or if they go back to correct
a misspelling in the first name, etc.
--
Matt Wittemann, CRM MVP
http://icu-mscrm.blogspot.com


"Dan white" wrote:

Posted by Mitch Milam on September 8th, 2006


That is an excellent point Matt, and if I hadn't been in a hurry, I would
have mentioned that. The problem is, with the way the code is written, you'll
end up with the word 'null' in the Company name, should one of the values be
empty.

I posted an article on my blog regarding this topic:

http://blogs.infinite-x.net/2006/09/...e-a-crm-field/

I'll put the "enhanced" code up there by Noon CDT tomorrow that will take
into consideration the null field values.

Later, Mitch


"MattNC" wrote:


Similar Posts