Solved

Dynamics CRM 4.0: Copy Redarding Drop Down List value to Subject Field

Posted on 2009-05-12
6
896 Views
Last Modified: 2012-05-06
Hi Experts,

I know I have to add an onchange value to the regardingobjectid field in order to get it to auto populate the Subject field for me. I am trying to get the subject field to auto populate the exact value or string which appears on the regardingobjectid field.

Example: If I choose an Account 'ABC Pty Ltd' in the regarding list of the Phone Call Activity form I would like it to write 'ABC Pty Ltd in the subject field automatically. It will save our guys having to re-write the Regarding field into the subject field.

I have tried: 'crmForm.all.subject.DataValue' = 'crmForm.all.regardingobjectid.DataValue';

but I received an error. The  complete code for the solution would be great as I don't have alot of javascript skills.

Many Thanks.
0
Comment
Question by:logicsolutions
  • 3
  • 3
6 Comments
 
LVL 10

Expert Comment

by:crm_info
ID: 24363208
Getting a value out of a lookup field is not quite as simple as getting the value out of another field on a form.  The full code (possibly requiring some name changes) is below.
crmForm.all.subject.DataValue = crmForm.all.regardingobjectid.DataValue[0].name;

Open in new window

0
 
LVL 1

Author Comment

by:logicsolutions
ID: 24363274
WOW. Exactly what I needed. Just for the iceing on the cake how do I get it to add a colun (:) symbol on the end. i.e. If ABC Pty Ltd is selected from the list it will automatically put 'ABC Pty Ltd:' in the subject field.

Many Thanks CRM info.
0
 
LVL 10

Expert Comment

by:crm_info
ID: 24363458
crmForm.all.subject.DataValue = crmForm.all.regardingobjectid.DataValue[0].name & ":";
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 1

Author Comment

by:logicsolutions
ID: 24363570
Hi CRM info,

It says 'The Control only accepts strings or nulls as an input' after using the following:

crmForm.all.subject.DataValue = crmForm.all.regardingobjectid.DataValue[0].name & ":";

Big Thanks,
0
 
LVL 10

Accepted Solution

by:
crm_info earned 500 total points
ID: 24363581
Oops - try using

crmForm.all.subject.DataValue = crmForm.all.regardingobjectid.DataValue[0].name + ":";

(replacing the & with a +)
0
 
LVL 1

Author Closing Comment

by:logicsolutions
ID: 31580469
Perfect Solution. God bless your work.
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MS Dynamics Partnership 2 68
CRM 2011 Opportunity Bug 18 141
CRM 2011 SSRS Question 12 94
ASP.net application Microsoft Dynamics AX in the cloud 2 61
On Sep 22nd 2014 Microsoft released Update Rollup 1 for Microsoft Dynamics CRM 2013 Service Pack 1 and back in July Update Rollup 3 was released.  So we now have:   Update Rollup 1Update Rollup 2Update Rollup 3Service Pack 1Update Rollup 1 for S…
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question