claudeless
|
| Posted: 06/02/2005, 11:38 AM |
|
Here is my Event.php
//VofL_ds_BeforeExecuteSelect @251-EDA442D2
function VofL_ds_BeforeExecuteSelect()
{
$VofL_ds_BeforeExecuteSelect = true;
//End VofL_ds_BeforeExecuteSelect
//Custom Code @269-35D71D0D
// -------------------------
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect");
$this->CountSQL = "Select distinct COUNT(MIDID) As Line, MIDID" .
" From (Select DISTINCT assets.MasterCusID AS MIDID, CTYPE, CAT" .
" FROM assets, (SELECT DISTINCT `Orginal AssetType` AS CTYPE, " .
" Catagory AS CAT FROM assets INNER JOIN classofsoftware ON " .
" (assets.`Orginal MODEL_NO` = classofsoftware.ModelNo) " .
" Where (assets.MasterCusID = " . $this->SQLValue($this->wp->GetDBValue("1"), ccsInteger) . " AND assets.VOIDED = 0 AND assets.QuoteAsset = 0)) AS CAT ) AS DETAILS" .
" Where MIDID = ". $this->SQLValue($this->wp->GetDBValue("1"), ccsInteger) . " GROUP BY MIDID ";
$this->RecordsCount = CCGetDBValue(CCBuildSQL($this->CountSQL, $this->Where, ""), $this);
// Write your own code here.
// -------------------------
//End Custom Code
//Close VofL_ds_BeforeExecuteSelect @251-B3D54EF1
return $VofL_ds_BeforeExecuteSelect;
}
//End Close VofL_ds_BeforeExecuteSelect
?>
|
|
|
 |
Nicole
Posts: 586
|
| Posted: 06/03/2005, 2:51 AM |
|
Hello,
Do not use $this in events code. And refer to CCS Help, in includes directives how to modify SQL and Count SQL in Before Execute Select http://docs.codecharge.com/studio/html/ProgrammingTechn...ifySQL.html?toc
_________________
Regards,
Nicole |
 |
 |
Claudeless
|
| Posted: 06/03/2005, 2:57 PM |
|
It Seems Alot of People are having this Problem...
Can you Please Post some LIVE Working Code.
The Syntax in the Manual is OK...
BUT...
Newbies who do not write code would like to see Working Examples with remarks next to it explaining what it does that they can toy with and learn from...
//Custom Code @269-35D71D0D
// -------------------------
global $VofL; /////////////// What is this and Why
// Write your own code here.
$task -> ////////////// Where Does this come from and what cant you use here
CountSQL =
"SELECT COUNT(*) FROM `end users` "Where `end users`.MasterCuSID = " .
$task ->
SQLValue //////// ??????????
($take ->wp
->GetDBValue("1"), ccsInteger) . "";
// -------------------------
//End Custom Code
I think it would help Alot of People...
Thanks..
Thanks
|
|
|
 |
mrachow
Posts: 509
|
| Posted: 06/06/2005, 1:11 AM |
|
Please start with a look at
1.1 Referencing Objects in
Component Reference.
When you are doing more advanced things with studio I think you have to dive deep into the scripting language you are generating for.
_________________
Best regards,
Michael |
 |
 |
|