ACF Library

newCustomersToBOWC

Back to List

Description: Save new customers to the Timesheet web-site,

FileMaker Prototype:

Set Variable [$res; ACF_Run("newCustomersToBOWC")]

Category: UTILITY

Function source:

function newCustomersToBOWC ()
   array int aBOWCID;
   array string aKundeID, aKundeNavn;
   
   string sql = "SELECT KundeID, BOWC_ID, KundeNavn FROM Kunder
            WHERE BOWC_ID IS NULL OR BOWC_ID=0
            
            INTO :aKundeID, :aBOWCID, :aKundeNavn";
   
   string res = executeSQL (sql); 
   int i, cnt; 
   cnt = sizeof (aKundeID); 
   sql = "INSERT INTO Kunder (RemoteID, Navn, Aktiv) VALUES "; 
   array string values; 
   for (i = 1, cnt)
      values[] = format ("('%s', '%s', 1)", aKundeID[i], aKundeNavn[i]); 
   end for
   
   int db = connectBOWC(); 
   res = ExecuteMySQL ( db, sql+implode(",", values)); 
   mysql_close(db); 
   return "OK"; 
end

newCustomersToBOWC is a function to interact with a time-sheet web-application. When a new customer is registered in the FM application, this function is called to update the timesheet application. The ID for the record in the web-app is updated localy so we send this if we like to update it later.

  • uses the built inn mySQL connector in the plugin

Example

Set Variable [$res; ACF_Run("newCustomersToBOWC")]
Back to List