
johnkreagan
Posts: 2
|
| Posted: 03/11/2010, 12:14 PM |
|
Hey all,
Im working through my first CC project and am having trouble processing some records. I have a editable grid which pulls all "clients" associated with an ID. This displays info about each client, and gives the users the chance to change the price associated with it. Upon submission of the form I need 3 things to happen:
1. Update Client record showing an invoice number and changing a few fields. Got this working no problem. Used the basic CC GUI interface and this works properly.
2. Insert a record for each row of my editable grid into a table. Got this no problem by inserting custom SQL code in the Before Execute Update event from #1.
3. Now I want to build an Invoice record, grouping some info from the editable grid record. I have tried this several ways, first I tried adding it through the standard interface under the INSERT event using a custom written INSERT. No luck, I tried the Server After Submit event of the Submit button, no luck. For testing purposes I even tried adding it to the Before Execute Update event I mentioned in #2(I thought this would work but it would INSERT the invoices more times than I wanted, but no luck). Its like my code is being compeletly ignored without any warning or errors.
Here is the most recent code I used in the After Submit Server event:
//Begin FirmInvoices INSERT
global $db;
global $DBConnection1;
global $CCConnectionSettings;
$FirmID = $OrderProcessing->FirmID->GetValue();
$Today = $OrderProcessing->Invoice_Date1->GetValue(); //Returns Current Date Supplied by Form
$Today = date("m/d/Y",$Today[0]); //Formats Date so only mmddyyyy shows
$totalBill = $OrderProcessing->Label1->GetValue();
$totalClients = $OrderProcessing->num_clients->GetValue();
$Price = $OrderProcessing->PriceLabel->GetValue();
$Invoice_Num = ccGetFromPost("Invoice_Num", 000001); //Get the Invoice Number from the POST
$Invoice_SQL = "INSERT INTO FirmInvoices (InvoiceNumber, BCUserID, FirmID, InvoiceDate, totalBill, totalClients)
VALUES ($Invoice_Num, 1, $FirmID, $Today, $totalBill, $totalClients )";
$Invoice_db = new clsDBConnection1();
$Invoice_db->query($Invoice_SQL);
$Invoice_db->close();
If anyone has ANY ideas, I would greatly appreciate it!!!
|
 |
 |
mamboBROWN
Posts: 1713
|
| Posted: 05/16/2010, 11:42 AM |
|
johnkreagan,
Are you still having this problem?? Also, are you working with CC (Code Charge) or CCS (Code charge Studio)??
|
 |
 |
|

|
|
|
|