Thursday 8 January 2015

Is Self Chaining possible in Queueable Interface? - The Climax

Okay! So the story ends like this:

"But currently the chaining feature will be available in the spring 15 release. For the winter 15 release the queueable can call itself only once."

Let me put a period to my tryst with ‪#‎QueueableInterface‬ self-chaining capability till my sandbox is upgraded to Spring '15

Happy Apex coding !

‪#‎MySfdcTweets‬

Wednesday 7 January 2015

Is Self Chaining possible in Queueable Interface? - Part 2

With reference to previous #MySfdcTweets on #QueueableInterface self-chaining possibility, I encounter this error:

System.AsyncException: Maximum callout depth has been reached.

Salesforce documents says, "Maximum stack depth is two, which means you can add only one job from an executing job", which I think I am abiding by literally.

The reason in my case seems to be this:

I get this AsyncException because of recursive chaining like Job A --> Job A --> Job A.

So let me put this into a better perspective: ;)

Maximum stack depth should mean that there could be maximum two sequential jobs(Job A ---> Job B, not Job A --> Job B --> Job C and so on.) in a Queueable context.

I even tried putting some static flag to prevent recursion so as to maintain stack depth to 2. It too didn't work. :P  It feels that the static variable somehow getting lost in the asynchronous context. :D

However, it should be better to get this understanding verified by SFDC Technical Expert Team.

...To Be Continued  (Y)


My experience(twist and turns) with Queueable Interface implementation reminds me of this beautiful song.  Twist and turns by James Spencer

Listening to and feeling invigorated..

Tuesday 6 January 2015

Is Self Chaining possible in Queueable Interface?

#QueueableInterface allows Chaining Jobs.

For re-sending the failed records during a web service callout from SFDC to SAP, today I was just wondering if Self-Chaining is possible.

I wrote the below piece of code:

System.enqueueJob(new SameClassImplementingQueueable(listObject)) ;

And it compiled successfully. (Y)

So I believe the compiler allows us to perform self-chaining as well. Now I need to check what happens at the runtime.

The only restriction I see for implementing Queueable Interface is this: "The maximum number of jobs in the chain (maximum stack depth) is two, which means you can add only one job from an executing job".

I believe I am within the Salesforce limits.  :P  ;)

P.S: If it happens, I need to see how it behaves in its Test Class.  :D

#MySfdcTweets  #SalesforceDotCom  #SFDC

Monday 5 January 2015

Salesforce Spring '15 - Biggest Ideas Release Ever

#Salesforce Spring '15 could be annotated as the #BiggestIdeasReleaseEver.

The Sandbox Preview window for Spring '15 is scheduled to begin on January 9, 2015.


Can't wait more for #ApexFlexQueue (which allows the submission of up to 100 batch jobs and to prioritize the jobs by reordering) and #ProcessBuilder (which extends the capabilities of workflow to a new level).

Coming in the next release - Spring '15

#MySfdcTweets

Saturday 3 January 2015

A blend of SFDC Automaticity

"For a bidirectional synchronization between SFDC and SAP, Using an amalgamation of Apex Trigger, Queueable Interface, Web Service callout to SAP, AsyncApexJob, Integration Logger, Automated submission to Approval Process and Batch Apex with Schedulable Interface."

WOW !

It seems exciting. Correct?

However, it feels even more interestingly super-thrilling to do it practically.

‪#‎MySfdcTweets‬ ‪#‎Salesforce‬ ‪#‎SFDC‬

Friday 2 January 2015

Pricing Agreements (Contracts) in Salesforce.com CRM

Pricing, in Salesforce CRM, is one of the most interesting and complex process to set up and to integrate it with SAP.
Going through lots of discussion regarding redesigning the Pricing process in the on-going project and then converting it into the SAP requirements for creating Pricing Agreements in SAP.
Being as one of the sensitive data, Pricing/or Contract calls for an extra attention psychologically.   :P 

Pricing is the Contract Agreement between Customer and the Company. It could include the Reference Prices, Base Prices, Pricing Exceptions, Rebates, Payment Terms, different kinds of Surcharges at various levels for a product being purchased. 

For sending these info to SAP, each pricing record is mapping to corresponding Condition Types and Condition Tables (these are SAP Terminologies) which fetch key fields in SAP to create the corresponding SAP records.

This agreement could be later used to generate Contracts in pdf format using apps like Conga Merge or Thunderhead and then later could be sent for signature using apps like Docusign.

I hope I explained succinctly.    ;)

Queueable Interface: First time hands on

Recently implemented "Queueable Interface" for asynchronous processing of bulk records for making a web service callout from Salesforce.com to SAP system. 

A better enhanced feature of Salesforce.com as compared to the previous one; @future annotation. :) 

It's been fun incorporating this into my on-going integration project...... 

Waiting to release my next blog on it. :)

‪#‎MySfdcTweets‬ ‪#‎Salesforce‬ ‪#‎SFDC‬