locked
LookUp Fields - how to get the entity? RRS feed

  • Question

  • Hi all,

    is it possible to get the information to which entity a lookup field links?

    For example the primarycontactid on the account form targets the contact entity of couse. If the primarycontactid field has a value, it is no problem to get this via crmForm.all.fieldname.DataValue[0].typename.

    But i would like to know this when the field is emplty. How can i get this information in an OnLoad event?

     

    Thanks

    Dennis

     

    Friday, October 8, 2010 7:30 AM

Answers

  • please try this

    alert(crmForm.all.parentcustomerid.getAttribute("lookuptypes"))

     

    regards

    Raji

    Friday, October 8, 2010 9:20 AM
  • also try

    alert(crmForm.all.fieldname.attributes["lookuptypenames"].value);

    Thank you.

    JayshriP

    Friday, October 8, 2010 10:10 AM

All replies

  • crmForm.all.primarycontactid.defaulttype will give you the default type the lookup is associated to.

    alert(crmForm.all.primarycontactid.defaulttype);

    Note: If lookup is associated with more than one lookup then by default it will give the defaut lookup pointed.

     

    Friday, October 8, 2010 7:43 AM
  • Thanks Vinoth,

    but this doesn't work.

    crmForm.all.primarycontactid.defaulttype or crmForm.all.transactioncurrencyid.defaulttype (as another example) 

    are always "0".

     

    Do you have any other ideas?

    Dennis

     

    Friday, October 8, 2010 8:40 AM
  • please try this

    alert(crmForm.all.parentcustomerid.getAttribute("lookuptypes"))

     

    regards

    Raji

    Friday, October 8, 2010 9:20 AM
  • also try

    alert(crmForm.all.fieldname.attributes["lookuptypenames"].value);

    Thank you.

    JayshriP

    Friday, October 8, 2010 10:10 AM
  • also try

    alert(crmForm.all.fieldname.attributes["lookuptypenames"].value);

    Thank you.

    JayshriP


    Many thanks Jayshri,

    both work very vell!

    Dennis

    Friday, October 8, 2010 10:31 AM