Solved

Dynamics CRM 4.0: How can I copy the display associated name of a selected lookup value in a textbox in the form?

Posted on 2009-06-29
6
509 Views
Last Modified: 2013-11-19
- My lookup field is called:   new_alternateid
- My associate field to the new_alternateid is called:    new_euorganization
- My text field in the form is called:       new_text

What I want to do is to select one 'new_alternateid' from the lookup and insert in the field 'new_text' the value of the 'new_euorganization' associated to the 'new_aternateid'.
I'm trying with
if (crmForm.all.new_alternateid.DataValue != null) {
    crmForm.all.new_text.DataValue = crmForm.all.new_alternateid.DataValue[0].new_euorganization;
}
and....DOES NOT WORK.

I have other lookup field that show me the full name of a contact (this is other example that I cannot solve), and I want to recover from the lookup field, the first name and the last name, but in separate fields.... I only can recover the fullname and I do not understand why!!
Thanks in advance for your help.

0
Comment
Question by:chonichon
  • 3
  • 2
6 Comments
 
LVL 8

Expert Comment

by:Aftab_Khateeb
Comment Utility
The below logic assigns the alternateid name to the text box new_text.

if (crmForm.all.new_alternateid.DataValue == null) {
    crmForm.all.new_text.DataValue = null;
}

else {
    crmForm.all.new_text.DataValue = crmForm.all.new_alternateid.DataValue[0].name;
}

I am quite not getting what you mean by associate field, is new_euorganization also a text field in the form?..

For your second query, make sure the contact lookup view has firstname and lastname fields in the view. If it is you could fetch them individually
0
 

Author Comment

by:chonichon
Comment Utility
In the first case, the new_euorganization is included in the alternateid lookup view with other fields...
And in the second case I also have inlcuded the first name and last name in the lookup view. But how is it possible to recover one or more fields from the lookup view??

With your solution I only can recover the alternateis but not other fields....
And with my other problem is the same, I can recover the fullname but not the first and last name in separate fields......

Many thanks for your help.
0
 
LVL 11

Expert Comment

by:rakeshAgarwal
Comment Utility
I think what you want to is

You have  entity called new_alternate (or whatever)  you have created a lookup  by relating this entity and entity in the problem

now you want  one of  the attribute of entity  new_alternate to be put on the entity in the problem

is it correct
 


just try this out

1. create a workflow  on the entity in the issue
2. on update of new_alternateid
3. update record  select entity in the problem
4. click on properties
5. select the text field you need to update
6.  select the entiy

regards
Rakesh Agarwal

0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:chonichon
Comment Utility
OK, I've created the Workflow and it works.... but I've to refresh 'manually'  several times before seeing in the screen the changes.
Any idea?
0
 
LVL 11

Expert Comment

by:rakeshAgarwal
Comment Utility
yes that will be there  else you have to write a plugin that is non programitic way of doing things  :)

regards
rakesh
0
 
LVL 11

Accepted Solution

by:
rakeshAgarwal earned 500 total points
Comment Utility
The above way is only non programitic way of achiving your solution  :)

rakesh
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Automatically creating a Trello card using data from a Microsoft Dynamics CRM record turned out to be an easy project that yielded great results.  Here's how I did this for an internal team at General Code.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now