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
516 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 8

Expert Comment

by:Aftab_Khateeb
ID: 24742328
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
ID: 24742943
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
ID: 24743192
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:chonichon
ID: 24743596
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
ID: 24744000
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
ID: 24744004
The above way is only non programitic way of achiving your solution  :)

rakesh
0

Featured Post

Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

Question has a verified solution.

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

Suggested Solutions

An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
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.

734 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