bas60
Posts: 18
|
Posted: 09/09/2011, 5:22 AM |
|
Did a search - probably not asking the right question!
I have a DB with Manufacturers table with 2 fields - manufacturer_id &
manufacturer_name
I have products file with a link manufactuers_id
I need to display the Manufacturer name on my products page
I've sure I've done this before with code expression
something like 'select manufacturer_name from manufacturers where
manufacturers.manufacturer_id=manufacturer_id' but its not working today!
its actually displaying the above sql!!
aaaaargghhhh
|
|
|
datadoit
|
Posted: 09/09/2011, 7:04 AM |
|
For your label or textbox control, in the BeforeShow choose the DLookup
Action. From there just fill in the blanks.
|
|
|
jacem
Posts: 87
|
Posted: 09/09/2011, 9:27 PM |
|
Here is a little extra help in using the BeforeShow 'Dlookup' action event:
For expression enter "manufacturer_name"
For Domain enter "Manufacturers"
For Criteria enter "manufacturer_id=$Container->manufacturer_id->GetValue()"
For Connection enter databasenameDB as per your connection settings for the DB name
For convert result to enter Text
For Type of Target enter Control
for Target enter ManufacturerName or what ever the label is named that will hold the manufactures name on the page.
Notice above that the last four items don't have " encasing the answers but the first three do. Its a set up quirk of CCS
Hope this helps.
|
|
|
bas60
Posts: 18
|
Posted: 09/10/2011, 10:12 AM |
|
Thanks for the detailed info but it didn't work.
the manufacturer name is not displayed!
I the modified the page and added manufacturer_id - as I previously didn't
I assumed "manufacturer_id=$Container->manufacturer_id->GetValue()" would
need manufacture_id on the page... Anyway if I add this I get
Catchable fatal error: Object of class clsControl could not be converted to
string in /home/site/public_html/machines/prod_detailsY_events.php on line
109
What I am doing wrong??
|
|
|
bas60
Posts: 18
|
Posted: 09/10/2011, 3:43 PM |
|
Ok deleted and re-added manufacturer_id set to text
Still manufacturername is blank
Now if I replace this
$ccs_result = CCDLookUp("manufacturer_name", "manufacturers", "manufacturer_id=$Container->manufacturer_id->GetValue()", $Page->Connections["machines"]);
with
$ccs_result = CCDLookUp("manufacturer_name", "manufacturers", "manufacturer_id=292", $Page->Connections["machines"]);
Then manufacture with ID 292 is displayed
so "manufacturer_id=$Container->manufacturer_id->GetValue()" should be ok since the control is manufacturer_id
|
|
|