1
votes

I'm looking at creating a form which contains a dropdown of values from my customer table, specifically the customer_ID attribute.

So far I have changed the customer_ID field in the form to a Select List and created this query to try and fetch the existing IDs:

SELECT Customer_ID
FROM tbl_Customer;

And I am given the error

 Column "CUSTOMER_ID" specified for attribute "" has not been found in data source!

I've been searching around for similar issues without much luck, so if anyone has a link to an article or video about this it would be appreciated, thanks!

Edit:

SELECT First_Name  as display_value,
Customer_ID as return_value
FROM tbl_Customer;

This allows me to view the page but the new problem is that I am only able to display the first name like this, and when I select something from the dropdown it does not appear, and seems to buffer forever.

infinite buffering

I have also tried achieving this by using a shared component, which creates a list of the customers, using this query:

SELECT CONCAT(First_Name, Last_Name) as display_value, 
Customer_ID as return_value
FROM tbl_Customer;

But the infinite buffering issue still happens, and I believe that the issue may be something to do with locating the Cutomer_ID as leaving the dropdown on its default value, and submitting the form creates a record which seems to leave the ID column as null ("-") in the Apex object browser.

1

1 Answers

3
votes

What is obvious, is that select list's query isn't valid. It must return exactly two values:

  • display value (usually name or something similar)
  • return value (usually ID or something like that)

In your case:

select customer_name as display_value,
       customer_id   as return_value
from tbl_customer

Certainly, make sure that table and its columns exist in schema you're fetching data from. Pay attention to possible double quotes around table/column names and mixed letter case. If you, by any chance, used them, then you'll have to use double quotes and exact letter case every time you refer to that table/column.