• Riell
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

I'm syncing product data from salesforce to an external system using the salesforce API. The problem I'm having is determining if pricebookentry records have been updated in SF. Here's what I'm doing:

 

I have a custom field on the product table called syncDate__c that I write to when I've sync'd a product to my system.

I have a custom formula field on the product table called needsSync__c that gets set to 1 if the lastModifiedDate is more recent than the syncDate__c, otherwise it's set to 0.

That all works great, and makes it easy to fetch updated products doing something like: select id, name, etc from product2 where needsSync__c = 1.

 

The problem I'm running into is knowing when to fetch updated pricing info. I can't figure out how to compare the lastmodifeddate from pricebookentry with a date on the corresponding product.

 

How can I determine if a pricebookentry has been updated more recently than the product it references without fetching all pricebookentry and product2 records?

 

 

 

 

 

  • September 18, 2012
  • Like
  • 0

Hi,

 

We need to make a few callouts to a service that is using OAuth 1.0 and requires each request to be signed with HMAC-SHA1.

 

The service doesn't have any APEX client API. Thus, we have to do it manually.

 

Unfortunately, 

 

EncodingUtil.base64Encode(Crypto.generateMac('hmacSHA1', Blob.valueOf(data), Blob.valueOf(key)));

 returns a different string from what we expect. We have compared the output for the same input with libraries for other languages. And the output was different.