0

I have a visual force page that needs to return the name of a property location to be loaded into the input field on page load. (I click edit and the name is already there when page loads. See screenshot of original before I started making a cusome visual force page). What it is supposed to look like

So I figured I could use my apex page to do a query and then send over a variable to the visual force page. However when I query the Location it returns me the numerical id not the properties name itself. The query I am attempting to use is:

for (EventPackageRevenueBreakdown__c ETR : [    SELECT       UnitPrice__c, Location__c
 From EventPackageRevenueBreakdown__c]){ 
     test = ETR.UnitPrice__c;
     prop = ETR.Location__c;
}

I'm not sure how to say look at this property ID and get the name of it and then add it to my visualforce page. Sorry I am new at this and it is my second day on the job out of college.

Nicole Phillips
  • 753
  • 1
  • 18
  • 41

1 Answers1

0

Is it possible for you to add a bit more detail? Are you aware of the table and/or database structure?

Your problem is that, apparently, the [Location__C] column from the [EventPackageRevenueBreakdown__c] table is actually the property ID rather than the property name.

So... your first task is to figure out the actual table structure. IF there is a property name column in the same table, simply replace the [Location__C] column with whatever the property name column is. Now, IF there is no property name column in the table, you must locate another table where the names are stored, along with the corresponding ID ([Location__C]). Once you do this you can query the property name with a JOIN.

Does this make sense? If you are able to provide more detail in your question, you can get a stronger answer.

    -
E. Monk
  • 378
  • 3
  • 11