CCman
Posts: 6
|
Posted: 04/09/2005, 2:18 PM |
|
Hi.. i am a noob here i have a little question about the before show event in the record form
i need to count some items before the page is displayed.
something like this
select count(*) from table_items where user_id = UserID and items=item_id
item_id is a variable inthe URL
UserID is the session variable with the id of the user
then if the select return more than 1 the page display "you alredy have this item"
basicaly i need to translate this to codecharge "code"
any help?
thnkz =)
|
|
|
Nicole
Posts: 586
|
Posted: 04/11/2005, 12:37 AM |
|
Hello,
You need to execute custom sql query in page or form Before Show event. You can refer to CCS Help that provides sample code for it http://docs.codecharge.com/studio/html/ProgrammingTechn...tomSQL.html?toc
To get URL parameter use CCGetParam() function, its description for ASP is http://docs.codecharge.com/studio/html/Components/Funct...tParam.html?toc
To get ID of logged in user you can use CCGetUserID() function, it is also listed under http://docs.codecharge.com/studio/html/Components/Functions/ASP/
_________________
Regards,
Nicole |
|
|
rclayh
Posts: 8
|
Posted: 04/11/2005, 7:32 AM |
|
You actually could just put a label on the page and have it perform a DLookup in the Before Show event. You could assign the results to a variable and then set the visible property of the label based on the results. You can build this mostly from the stock actions in CodeCharge. I usually build as much as I can from the stock actions and then put them altogether in a custom action when I'm done. This way I have the right nomenclature for all the CCS parts.
|
|
|
ccmann
|
Posted: 04/11/2005, 6:30 PM |
|
ok! i made it..
i hate CCS.. i use CC =) more simple
|
|
|
|