?
Solved

Form Scripting: How to I access a lookup Value

Posted on 2010-11-15
2
Medium Priority
?
609 Views
Last Modified: 2012-05-10
I like to use a value of a lookup list for calculation in a Form Script.

I had a picklist and I could access the value of the picklist:

var priority
priority = crmForm.all.prioritycode.DataValue

I have now replaced the picklist with a lookup field. It contains two attributes NAME & DURATION. I use the NAME attribute to populate the Form Control.  But now I like to get the value of the DURATION attribute to do some calculation with.  

How do I do this?
0
Comment
Question by:juttaReimann
[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
2 Comments
 
LVL 30

Accepted Solution

by:
Feridun Kadir earned 2000 total points
ID: 34140867
What entity is the lookup field connecting to?

Is duration a field on the other entity?  If so, then you can't get at the value of it directly using javascript. You can only directly get values of fields that are explicitly shown on the form. If you want to get the value of another attribute in a connected record(i.e. via a lookup) then you will need to call the CRM web services in the javascript to query for the attribute that you are interested in on the connected record. The CRM SDK has a section on using web services in javascript (or jscript as Microsoft refers to it).

0
 

Author Closing Comment

by:juttaReimann
ID: 34144007
Thanks for pointing me in the right direction.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

This is a walkthrough guide I wrote whilst upgrading my on-premise MS Dynamics CRM 3.0 deployment to 4.0. This covers the actual installation of the product to a working level for my system, I ran into a lot of issues that the steps below fixed so h…
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month12 days, 16 hours left to enroll

777 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