Getting attributes from account

Feb 8, 2013 at 12:17 PM
Hello,

First, thank you for creating this feature.

I have a custom entity that I am mapping that has no lat/long info. I used advanced find to get the lat/long, and a couple of other attributes from the account record (using link-entity this worked well in advanced find), but the attributes in the map always return zero. I have attached my config.

Am I able to get the lat/long from related entities like accounts? If so, how?

<entities>
<globalsettings>
<defaultMapLocation Center="36.197742, -86.778259" ZoomLevel="5" />
<nearDistanceUnit value="miles" />
</globalsettings>
<entity name="new_servicerequest" displayname="Machine Down">
<fetchXml>
  <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
    <entity name="new_servicerequest">
      <attribute name="new_customer" />
      <attribute name="new_requestdate" />
      <attribute name="new_technician" />
      <attribute name="new_serialno" />
      <attribute name="new_model" />
      <attribute name="new_manufacturer" />
      <attribute name="new_problemdescription" />
      <attribute name="new_warranty" />
      <attribute name="new_servicerequestid" />
      <attribute name="new_urgency" />
      <order attribute="new_requestdate" descending="false" />
      <filter type="and">
        <condition attribute="statecode" operator="eq" value="0" />
        {0}
        {1}
        <condition attribute="new_requesttype" operator="in"> 
             <value>1</value>
             <value>3</value>
        </condition>
        <condition attribute="new_problemresolved" value="0" operator="eq"/>
        <condition attribute="new_urgency" value="1" operator="eq"/>
      </filter>
      <link-entity name="account" alias="a_1b985cd35749e2118f73782bcb48f57d" link-type="outer" visible="false" to="new_customer" from="accountid">
          <attribute name="address2_stateorprovince"/>
          <attribute name="address2_city"/>
          <attribute name="address1_longitude"/>
          <attribute name="address1_latitude"/>
       </link-entity>
    </entity>
  </fetch>
</fetchXml>
<address>
  <latitude name="address1_latitude"></latitude>
  <longitude name="address1_longitude"></longitude>
</address>
<Conditions>
  <mapcondition text="Name: ">
    <condition attribute="new_customer" operator="like" value="%{0}%" />
    <value type="string" default=""></value>
  </mapcondition>
  <mapcondition text="City: ">
    <condition attribute="address2_city" operator="like" value="%{0}%" />
    <value type="string" default=""></value>
  </mapcondition>
  <mapcondition text="Model: ">
    <condition attribute="new_model" operator="like" value="%{0}%" />
    <value type="string" default=""></value>
  </mapcondition>
  <mapcondition text="Serial: ">
    <condition attribute="new_serialno" operator="like" value="%{0}%" />
    <value type="string" default=""></value>
  </mapcondition>
</Conditions>
<displaypanel>
  <list>
    <listitem text="Name">
      <field name="new_customer"></field>
    </listitem>
    <listitem text="City">
      <field name="account.address2_city"></field>
    </listitem>
    <listitem text="State">
      <field name="account.address2_stateorprovince"></field>
    </listitem>
    <listitem text="Manufacturer">
      <field name="new_manufacturer"></field>
    </listitem>
    <listitem text="Model">
      <field name="new_model"></field>
    </listitem>
    <listitem text="Serial">
      <field name="new_serialno"></field>
    </listitem>
    <listitem text="Warranty">
      <field name="new_warranty"></field>
    </listitem>
    <listitem text="Urgency">
      <field name="new_urgency"></field>
    </listitem>
    <listitem text="Problem">
      <field name="new_problemdescription"></field>
    </listitem>
  </list>
  <tooltip text="Visit Pushpin">
    <field name="new_customer"></field>
    <color name="red"></color>
    <zoomlevel name="10"></zoomlevel>
  </tooltip>
</displaypanel>
</entity>
</entities>
Feb 8, 2013 at 2:30 PM
Actually, I figured it out. If I use the link-entity alias before the lat/long it works.
Feb 8, 2013 at 3:01 PM
Can we use any of the link-entity attributes as a search (mapcondition) variable?
Coordinator
Feb 9, 2013 at 7:00 AM
You can use mapcondition to add link-entity conditions as well, if that's what you mean. You just need to make sure the sequence of placeholders and mapconditions is same.