+ Reply to Thread
Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23
This is a discussion on Salesforce MySQL Full Replication Script Process within the Salesforce PHP Tutorials forums, part of the Salesforce category; That is exactly what i did. It appears any INTEGER field that
  1. #11
    mramsey is offline Junior Member
    Join Date
    Mar 2008
    Posts
    15
    That is exactly what i did. It appears any INTEGER field that is blank in salesforce gives error and also any date that is blank or if the date is in salesforce format ('2008-10-11T15:35:31.000Z') says it's invalid DATETIME format. Not sure if i'm missing something. I used both the downloadable script you made that automatically creates the schema in mysql for you and also the one you have hosted here.

  2. #12
    mramsey is offline Junior Member
    Join Date
    Mar 2008
    Posts
    15
    OK I copied your posted Lead import script and modified the includes and db username's and passwords. Kept your dev information in there (removing your custom fields from the soql query) and tried i get error:

    Lead Table Truncated
    Incorrect date value: '' for column 'ConvertedDate' at row 1

    There are currently Leads:

  3. #13
    mike's Avatar
    mike is offline Administrator
    Join Date
    May 2007
    Location
    Wylie, Texas
    Posts
    607
    Blog Entries
    16
    Why dont you try my schema and that exact same script that I just posted to see if you can get that to work

    Maybe it is something to do with your Server or PHP installation.

    If you want, you can email me your script and I can take a look at it along with your schema, you have my personal email

    Let me know

    Hey I just noticed your second post. Do you have skype? it is a great way to talk over the web. If not give me a call


    ~Mike

  4. #14
    mike's Avatar
    mike is offline Administrator
    Join Date
    May 2007
    Location
    Wylie, Texas
    Posts
    607
    Blog Entries
    16
    take out the converted date field and try it again
    It is working on my end, but the values being insterted are all zeroes (0000-00-00)


    ~Mike

  5. #15
    mike's Avatar
    mike is offline Administrator
    Join Date
    May 2007
    Location
    Wylie, Texas
    Posts
    607
    Blog Entries
    16
    Quote Originally Posted by mramsey View Post
    OK I copied your posted Lead import script and modified the includes and db username's and passwords. Kept your dev information in there (removing your custom fields from the soql query) and tried i get error:

    Lead Table Truncated
    Incorrect date value: '' for column 'ConvertedDate' at row 1

    There are currently Leads:

    what version of MySQL are you using Mike?

  6. #16
    mramsey is offline Junior Member
    Join Date
    Mar 2008
    Posts
    15
    Yes I have skype.. I've just sent a message trying to add you as contact.. i'm using the latest version of MySQL

  7. #17
    mike's Avatar
    mike is offline Administrator
    Join Date
    May 2007
    Location
    Wylie, Texas
    Posts
    607
    Blog Entries
    16
    Mike

    Catch me on skype today! if you don't, I'll give you a call later on today.

    I was thinking about the problems you were having yesterday and I came to the conclusion, and I maybe wrong, that it is something to do with your MySQL setup or something in the configuration setup.

    On my localhost I am using XAMPP: PHP 5.2.5 and MySQL 5.0.45

    On this server, which I control, I am using: CentOS, PHP 5.2.5 and MySQL 4.1.22-standard-log.

    I placed the same script and another that I modified by just changing the paths and the database information:

    http://www.mikesimonds.com/salesforce_test/

    Both work just fine

    Anyway catch me later on sometime today

    ~Mike

  8. #18
    mevin is offline Junior Member
    Join Date
    Apr 2009
    Posts
    6
    Hello,
    I got an error with the Replication Script; below is the error

    Warning
    : Invalid argument supplied for foreach() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\******.php on line 148

    (oci8): INSERT INTO table_name (Id) VALUES ('a')

    The foreach() is found in the function store_in_db


    I have done a print on $r

    SObject Object ( [type] => xxxxx_xxx__c
    [fields] =>
    [Id] => a )


    In the fields it is not retrieving any values while for for ID is retrieving the 1st character 'a';
    Note I have also to a print on $records[$i]; here is displaying correctly

    Hope u can help me
    thks
    Last edited by mevin; 04-17-2009 at 04:47 AM.

  9. #19
    mike's Avatar
    mike is offline Administrator
    Join Date
    May 2007
    Location
    Wylie, Texas
    Posts
    607
    Blog Entries
    16
    That is something to do with the version of the PHP toolkit that you are using mevin? Try and catch me on IM or skype and we can take care of this on monday

    ~Mike

  10. #20
    x2002ugp is offline Junior Member
    Join Date
    Jul 2010
    Posts
    4
    Interesting.

    Hey Mike, sorry to raise this thread from the dead, but did either you or mramsey figure out what this issue was?

    I'm getting the same error:

    Code:
    1292: Incorrect datetime value: '2010-06-02T23:20:54.000Z' for column 'CreatedDate' at row 1
    I'm using your code from this post:
    http://www.mikesimonds.com/synchroni...1.html#post906

    With the the latest adodb-511-for-php5, and the PHPToolKit from your homepage.

    It's been almost two years since this post was first made, but I'm hoping you can remember what the resolution was.

    Thanks again for such an awesome site!

    UPDATE:

    I found a crappy work-around. I've changed these date fields to be VARCHAR(30) in MySQL, and the export works fine.

    I then added a short bit of code at the end of the script to update other MySQL fields with the proper DATETIME values:

    PHP Code:
    $soql "Select Id, IsDeleted, MasterRecordId, Name, ParentId, BillingStreet, BillingCity, BillingState, BillingPostalCode, BillingCountry, Phone, Fax, Website, OwnerId, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, LastActivityDate, Primary_Category__c, Do_Not_Call__c, Do_Not_Fax__c, Additional_Categories__c, Additional_Market_Areas__c, County__c, NOLO_Lead_Source__c, Lead_Source_Detail__c, Do_Not_E_Mail__c, Telesales_Agent__c, Primary_Market_Area__c, pymt__Convert_To_Person_Account__c, Code__c, Phone_2__c, Notes__c, Taking_new_Clients__c, Old_SF_Record_ID__c, Add_l_Info__c, Number_of_Contacts__c FROM Account";

    //Processes the query to get account information from Salesforce
    $records get_records($client$soql$db);

    // Here I update two of my "custom" fields in MySQL (DateCreated and DateLastModified):
    $sql "UPDATE $table SET DateCreated = LEFT(CreatedDate,23), DateLastModified = LEFT(LastModifiedDate,23)";

    $db->Execute($sql);
    if (
    $db)
    {
        echo 
    "dates updated\n";
    }
    else
    {
        echo 
    "Failed";
        
    var_dump($db->ErrorMsg());
        exit();
    }


    exit; 
    Last edited by x2002ugp; 07-12-2010 at 07:49 PM.

+ Reply to Thread
Page 2 of 3 FirstFirst 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO 3.5.2