• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 615
  • Last Modified:

Form Scripting: How to I access a lookup Value

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
juttaReimann
Asked:
juttaReimann
1 Solution
 
Feridun KadirPrincipal ConsultantCommented:
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
 
juttaReimannAuthor Commented:
Thanks for pointing me in the right direction.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now