Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
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
Medium Priority
?
519 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
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 

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 1500 total points
ID: 24744004
The above way is only non programitic way of achiving your solution  :)

rakesh
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

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…
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

721 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