How to copy field data from one field to another

savetheorcas
savetheorcas used Ask the Experts™
on
Question Relates To: Microsoft Dynamics CRM 4.0

I have a lookup field (field name = sto_usstateid) on on of my forms. When a selection is made from this field, I want another field on my form (field name = address1_stateorprovince) to automatically contain the same value as the sto_usstateid field.

I've tried everything I can think of, but nothing works. Any help would be appreciated.

Thanks,
Sean
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I figured this out, here is what I used:

var lookupItem = new Array;

lookupItem = crmForm.all.sto_usstateid.DataValue;

if (lookupItem[0] != null)
{
   // The text value of the lookup.
   crmForm.all.address1_stateorprovince.DataValue = lookupItem[0].name;

}

Commented:
Thank YOU!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial