• Resolved Peter

    (@petert-1)


    When I save a custom post with updated data for the field I’m syncing I get this error:
    Object_Sync_Sf_Exception thrown
    Unable to get a Salesforce access token. Salesforce returned the following errorCode: 400

    The log entry says:
    Notice: Update Salesforce location with WordPress ID with xxxxx of Account was not allowed by this fieldmap.

    The only debug entry is this:
    Debug Salesforce API call: read the full log entry for request and response details. There is not an SOQL query included in this request.

    I tried disconnecting and reconnecting Salesforce Authorization and that worked without any issue.

    I have other fieldmaps set up that are syncing properly, so I don’t quite understand what the problem with this one is.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jonathan Stegall

    (@jonathanstegall)

    On the debug entry that says “Debug Salesforce API call: read the full log entry for request and response details. There is not an SOQL query included in this request,” that means that the log entry should have more info in its body. Presumably it will, at the very least, tell you what the Salesforce API is saying.

    Thread Starter Peter

    (@petert-1)

    HTTP method: PATCH

    URL of API call to Salesforce: https://company.my.salesforce.com/services/data/v54.0/sobjects/Account/0014x00000xxxxxxxx

    API result from Salesforce

    Array
    (
    [code] => 204
    [data] => Array
    (
    [success] => 1
    [body] =>
    )
    [from_cache] =>
    [cached] =>
    [is_redo] =>
    )

    • This reply was modified 1 year, 9 months ago by Peter.
    Thread Starter Peter

    (@petert-1)

    The field I’m updating is (near the bottom)

    [Demo_Budget_Balance__c] => 199
    
    The weird thing is that the field is updated in Salesforce even though I get that error message when updating the WordPress post.
    
    This is the 2nd Debug entry:
    HTTP method: GET
    
    URL of API call to Salesforce: https://company.my.salesforce.com/services/data/v54.0/sobjects/Account/0014x00000xxxxxxxx
    
    API result from Salesforce
    
    Array
    (
    [code] => 200
    [data] => Array
    (
    [attributes] => Array
    (
    [type] => Account
    [url] => /services/data/v54.0/sobjects/Account/0014x00000xxxxxxxx
    )
    [Id] => 0014x00000xxxxxxxx
    [IsDeleted] =>
    [MasterRecordId] =>
    [Name] => A & K Truckland
    [Type] => Active Distributor
    [ParentId] =>
    [BillingStreet] => 1023 S Huron Road
    [BillingCity] => Green Bay
    [BillingState] => Wisconsin
    [BillingPostalCode] => 54311
    [BillingCountry] => United States
    [BillingStateCode] => WI
    [BillingCountryCode] => US
    [BillingLatitude] =>
    [BillingLongitude] =>
    [BillingGeocodeAccuracy] =>
    [BillingAddress] => Array
    (
    [city] => Green Bay
    [country] => United States
    [countryCode] => US
    [geocodeAccuracy] =>
    [latitude] =>
    [longitude] =>
    [postalCode] => 54311
    [state] => Wisconsin
    [stateCode] => WI
    [street] => 1023 S Huron Road
    )
    
    [ShippingStreet] =>
    [ShippingCity] =>
    [ShippingState] =>
    [ShippingPostalCode] =>
    [ShippingCountry] => Canada
    [ShippingStateCode] =>
    [ShippingCountryCode] => CA
    [ShippingLatitude] =>
    [ShippingLongitude] =>
    [ShippingGeocodeAccuracy] =>
    [ShippingAddress] => Array
    (
    [city] =>
    [country] => Canada
    [countryCode] => CA
    [geocodeAccuracy] =>
    [latitude] =>
    [longitude] =>
    [postalCode] =>
    [state] =>
    [stateCode] =>
    [street] =>
    )
    
    [Phone] => (920)555-5555
    [Fax] =>
    [AccountNumber] => AAA000
    [Website] =>
    [PhotoUrl] => /services/images/photo/0014x00000xxxxxxxx
    [Sic] =>
    [Industry] =>
    [AnnualRevenue] =>
    [NumberOfEmployees] => 0
    [TickerSymbol] =>
    [Description] =>
    [Rating] => 2
    [Site] => ROC
    [OwnerId] => 0054x00000xxxxxxx
    [CreatedDate] => 2021-11-02T21:14:01.000+0000
    [CreatedById] => 0054x000003JdVqAAK
    [LastModifiedDate] => 2022-07-06T20:24:46.000+0000
    [LastModifiedById] => 0054x000004KMBaAAO
    [SystemModstamp] => 2022-07-06T20:24:46.000+0000
    [LastActivityDate] => 2022-06-28
    [LastViewedDate] => 2022-07-06T20:24:46.000+0000
    [LastReferencedDate] => 2022-07-06T20:24:46.000+0000
    [Jigsaw] =>
    [JigsawCompanyId] =>
    [AccountSource] =>
    [SicDesc] =>
    [TimeZone__c] => (-06:00) Central Standard Time
    [MetroArea__c] => Green Bay, WI
    [Distributor_Class__c] =>
    [TerritoryID__c] => ZONE05
    [ResaleID__c] => 20-1234567
    [TermsCode__c] => N30
    [GroupCode__c] => PUDL
    [Account_Epicor_ID__c] =>
    [LastCreditHold__c] =>
    [FleetSize__c] =>
    [MeetsLocatorReq__c] => 1
    [PrimaryLineVanEquip__c] => Steel
    [StandardPOS__c] => 1
    [PrefOutfitter__c] =>
    [NumVansMth__c] =>
    [Ford__c] =>
    [Ram__c] =>
    [Freightliner__c] =>
    [GMC__c] =>
    [Mercedes__c] =>
    [Nissan__c] =>
    [ID_EPICOR__c] =>
    [Category__c] => Upfitter
    [BrandOther__c] =>
    [My_Account_Id__c] => 9829
    [Is_From_Callout__c] =>
    [Sent_to_Epicor__c] => 1
    [Total_Sales_YTD__c] => 12345.00
    [rh2__testCurrency__c] =>
    [Total_Sales_Last_Year__c] => 123456.00
    [Demo_Budget_Balance__c] => 199
    )
    
    [from_cache] =>
    [cached] =>
    [is_redo] =>
    )
    • This reply was modified 1 year, 9 months ago by Peter.
    • This reply was modified 1 year, 9 months ago by Jan Dembowski.
    Plugin Author Jonathan Stegall

    (@jonathanstegall)

    It does look like it’s not running into any errors. It could be that the plugin is losing its connection to Salesforce and having to reauthorize itself more often than it’s supposed to, but it is handling that in its own. I think it could also be a permissions issue in Salesforce, maybe on an object or a field. It doesn’t appear to be keeping you from saving data, but I know Salesforce often has very complicated permission setup and there might be something there.

    Thread Starter Peter

    (@petert-1)

    After some trial and error with different settings, I got it working by checking off the Fieldmap setting “Process Asynchronously”. Now it doesn’t throw the exception and still pushes to Salesforce.

    Plugin Author Jonathan Stegall

    (@jonathanstegall)

    What that checkbox does is put each change into a queue, which then runs through the Action Scheduler library, instead of sending it to Salesforce immediately. If your system is unable to run things through the queue, that will cause problems if you try to pull data from Salesforce into WordPress, but if you only need to push data to Salesforce, and doing it instantly doesn’t cause any performance problems, I think it’s fine.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Object_Sync_Sf_Exception thrown’ is closed to new replies.