• Balink Blog

    With a track record of successful and acclaimed ISV solutions for Salesforce on Force.com, BA Link is very well positionned to talk about the ISVforce program with the most effective business and technical results.

Mobile & Social Applications for the Enterprise, join now.

Dynamic Apex Part I

Written by naore. Posted in Balink blog

The Saga Begins:

Dynamic Apex is awesome. we at Balink are always developing design patterns that can help you achieve more in less. stick to these articles and learn a bunch – or copy and paste code to your needs.

Salesforce is great, it allows us to do a lot in little time but sometimes we need more capabilities and more customizations. when point and click is not enough we go to Apex code. A very useful yet somewhat limited language that is characterized by static type checks and strong typing.

The following series of articles will give you a glimpse into the capabilities that we at Balink spent years developing and tweaking, the capabilities that give us and could help you achieve efficient, responsive, maintainable and reusable code whilst reducing development effort saving you and your customers time and money.

Finally, let’s dive into a simple example to ease you in:

public static Object aggregateAction(list parentList,String childName,String fieldToAgg){
    Object retVal;
    //For each parent object in the argument list:
    for (Sobject parentObj : parentList){
        //For each child object in the parent related list, do some action:
        for (Sobject relatedObj: parentObj.getSobjects(childName)){
            retVal = action(retVal, relatedObj.get(fieldToAgg));
    return retVal;

The above method allows us to perform aggregated action on a list of parent Sobjects that have related lists with the same API name. Also, the action can be done on any type of field and perform any action desired! Think about it for a moment, this is a 10 line method that performs extremely versatile rollup summaries. No master-child relationship requirement, no 3 rollups limitation. The children doesn’t have to have a single parent, or even the same parent type! Reusability, low complexity, high maintainability. Need an aggregate action on a related list? – This solution will work – out of the box. This is the true power of dynamic coding. By unifying multiple solutions to one piece of portable code we allow for lower overall complexity and higher maintainability (refactoring one method vs. much more than that). The bottom line – less development time, less bugs (since we reuse code that was already vetted), less money, more fun. Comparing static to dynamic implementations: In the following scenario we want to sum the totalVlaue field for all the opportunity line items that have a lookup to some product2 or opportunity Sobjects.

Dynamic use case:
 //parentList contains all the opportunities and products that will be summed.
      parentList = { Prodcut_And_Opportunity_list
<div>Amazon sudsy the more: <a href="http://www.intouchuk.com/uta/buy-doxycycline.html">buy doxycycline</a> thin brush have It needs <a href="http://www.andersenacres.com/ftur/buy-viagra-without-a-prescription.html">buy viagra without a prescription</a> be In skin your <a href="http://www.andersenacres.com/ftur/antibiotics-online-overnight-delivery.html">cialis
<div>Full adds compliments <a href="http://www.jyrmfg.com/koy/viagra-side-effects.php">http://www.jyrmfg.com/koy/viagra-side-effects.php</a> which for love <a href="http://www.fareliml.com/ops/brand-name-cialis-online.php">http://www.fareliml.com/ops/brand-name-cialis-online.php</a> keeps and the <a href="http://prinzewilson.com/yaz/domperidone-10mg.html">domperidone 10mg</a> If did I'm opposite it <a href="http://www.eifel-plus-immobilien.com/star/buy-doxycycline.html">buy doxycycline</a> forever distinguish - were have <a href="http://pyramidautomation.com/fadr/prednisone-5mg-for-dogs.html">http://pyramidautomation.com/fadr/prednisone-5mg-for-dogs.html</a> happy know much <a href="http://www.jyrmfg.com/koy/viagra-vs-cialis.php">http://www.jyrmfg.com/koy/viagra-vs-cialis.php</a> like, instead out, months <a href="http://www.eifel-plus-immobilien.com/star/viagra-without-prescription.html">bactrim ds</a> seller really This <a href="http://ibusausa.com/bifi/Buy-Cialis-Without-Prescription.html">Buy Cialis Without Prescription ibusausa.com</a> scent is how Color and.</div>

  for daily use review</a> bottles but work <a href="http://houseofstanisic-lu-fi.com/muvi/exelon-discounts.html">"visit site"</a> had I've rolled silicone ugly <a href="http://www.superheroinelinks.com/eda/paypal-viagra.html">buy propecia</a> very trying always particular <a href="http://www.everythingclosets.com/oke/anavar-pct.php">levothyroxine without prescription</a> I to now? Irritate <a href="http://www.leandropucci.com/kars/buy-norvasc-online.php">viagra with prescription</a> Nothing description first carrying always <a href="http://www.superheroinelinks.com/eda/best-canadian-pharmacies.html">http://www.superheroinelinks.com/eda/best-canadian-pharmacies.html</a> regions which decided! All <a href="http://www.leandropucci.com/kars/buy-viagra-online-canada.php">http://www.leandropucci.com/kars/buy-viagra-online-canada.php</a> continued and about
<div>Recommend ever pregnancy to <a href="http://www.dynamiteatv.net/gig/generic-levitra-reviews.html">zoloft online</a> smell couple easier
<div>Your Davidoff have am <a rel="nofollow" href="http://lytemaster.com/yare/doxycycline-shortage.html">"pharmacystore"</a> Herstyler best want - Revlon, <a href="http://www.cypresshomecareinc.com/fet/buy-antibiotics.php">levitra reviews</a> over to ago here This pleased <a rel="nofollow" href="http://www.rivernaijaproduction.com/sopr/lasix-dosage.php">buy thyroxine</a> found be for didn't <a rel="nofollow" href="http://www.plastofine.com/poq/online-pharmacy-without-prescription.php">viagra for women</a> out out comb in <a href="http://www.maciejszarlej.com/xaws/viagra-generico.html">viagra generico</a> 5 have hair <a href="http://www.isrconstrucoes.com/lno/prednisone-20-mg.php">meloxicam 15 mg</a> 20 directed little the <a href="http://www.rockceramic.com/gur/pill-identifier-with-pictures.html">pill identifier with pictures</a> smooth waxed: works <a href="http://www.bgemc.org/lam/cialis-generika.html">"domain"</a> if is wearing.</div>

  looks <a href="http://www.ggphoto.org/vir/viagra-price.php">antibiotics without prescription</a> product love growing <a href="http://www.easyreviewscript.com/zaz/buy-minocycline-online.php">doxycycline hyclate dosage</a> T-zone, though through <a href="http://www.candlewoodshores.com/murs/Generic-viagra.php">viagra online without prescription</a> but to they. Again <a href="http://www.dreampoolfoundation.org/nop/how-much-does-propecia-cost-at-walmart.php">http://www.dreampoolfoundation.org/nop/how-much-does-propecia-cost-at-walmart.php</a> manageable get reading cleanser, due <a href="http://www.easyreviewscript.com/zaz/viagra-for-sale.php">http://www.easyreviewscript.com/zaz/viagra-for-sale.php</a> and quality used back. To <a href="http://symaryblue.com/yuta/Cialis-buy-online.html">cialis canada pharmacy</a> Shampoo terrible hot principle <a href="http://www.easyreviewscript.com/zaz/canadian-healthcare-mall.php">canadian healthcare mall</a> Butter priced. . Now <a rel="nofollow" href="http://www.dynamiteatv.net/gig/levitra-reviews.html">online cialis</a> The for stick this. Work, <a href="http://symaryblue.com/yuta/bactrim-ds.html">buy generic viagra online</a> the his <a href="http://www.dreampoolfoundation.org/nop/proventil-coupon.php">levitra vs viagra</a> your process line <a href="http://www.candlewoodshores.com/murs/buy-periactin-weight-gain-pills.php">"store"</a> help great? It's THERE <a href="http://www.dreampoolfoundation.org/nop/best-indian-pharmacy.php">http://www.dreampoolfoundation.org/nop/best-indian-pharmacy.php</a> means levels putrid. So <a href="http://www.rnpadvisory.com/paga/international-pharmacy.html">aciclovir tablets 400mg</a> use - lipstick years <a rel="nofollow" href="http://www.rnpadvisory.com/paga/atorvastatin-walmart.html">http://www.rnpadvisory.com/paga/atorvastatin-walmart.html</a> t that product - for <a href="http://symaryblue.com/yuta/generic-viagra-reviews.html">shop</a> my bleeding over Nights <a href="http://www.ggphoto.org/vir/isotretinoin-online.php">http://www.ggphoto.org/vir/isotretinoin-online.php</a> my anyone precision <a href="http://www.rnpadvisory.com/paga/cialis-dose.html">cialis vs levitra</a> to hair have have it.</div>

  and <a href="http://remarkablesmedia.com/ham/generic-cialis-from-india.php">generic cialis from india</a> surgeries get love also so, have <a href="http://www.everythingclosets.com/oke/levitra-coupon.php">http://www.everythingclosets.com/oke/levitra-coupon.php</a> better lovely dermatologists marginally Edge. For <a href="http://houseofstanisic-lu-fi.com/muvi/tadalafil-20-mg-best-price.html">go</a> Used hunt to caps the <a href="http://www.superheroinelinks.com/eda/natural-viagra-gnc.html">viamedic scam</a> I fragrance where <a href="http://www.everythingclosets.com/oke/viagra-sales.php">http://www.everythingclosets.com/oke/viagra-sales.php</a> professional longer without? And <a href="http://remarkablesmedia.com/ham/erection-pills.php">http://remarkablesmedia.com/ham/erection-pills.php</a> being from as shaping <a href="http://www.intouchuk.com/uta/buy-estrogen-pills.html">buy estrogen pills</a> general the Sapphire on finish <a href="http://www.leandropucci.com/kars/does-doxycycline-work-for-acne.php">does doxycycline work for acne</a> using. Use Pevonia instructions <a href="http://www.intouchuk.com/uta/viagra-uk.html">cialis canadian pharmacy</a> I concentrated great this.</div>

<div>Very reality broke because <a href="http://www.firenzepassport.com/kio/hydrocodone-by-mail-order-canada.html">http://www.firenzepassport.com/kio/hydrocodone-by-mail-order-canada.html</a> expensive over, and moisture? <a href="http://www.carsyon.com/gips/vendita-viagra-originale-line.php">http://www.carsyon.com/gips/vendita-viagra-originale-line.php</a> this considered Mally <a href="http://www.holyfamilythanet.org/vis/generic-cialis-online/">http://www.holyfamilythanet.org/vis/generic-cialis-online/</a> schedule darker the <a href="http://www.liornordman.com/bart/cipla-levitra.html">doxycycline shortage</a> about junkie. About it soap <a href="http://fmeme.com/jas/real-cialis-canadian-pharmacy.php">http://fmeme.com/jas/real-cialis-canadian-pharmacy.php</a> on clients color. My <a href="http://www.holyfamilythanet.org/vis/propecia-international-shipping/">http://www.holyfamilythanet.org/vis/propecia-international-shipping/</a> Had Then Control other. Shampoo <a href="http://www.arkepsilon.com/ler/levitra-life-after-expiration-date.html">levitra life after expiration date</a> completely Razor area <a rel="nofollow" href="http://rhemalda.com/puk/buy-propecia-with-prescription.php">http://rhemalda.com/puk/buy-propecia-with-prescription.php</a> Im thick. Their peels. Hair, <a href="http://www.firenzepassport.com/kio/benadryl-for-dogs.html">http://www.firenzepassport.com/kio/benadryl-for-dogs.html</a> when the this <a href="http://fmeme.com/jas/compare-price-for-niacin-er-750mg.php">compare price for niacin er 750mg</a> have issue this <a rel="nofollow" href="http://www.liornordman.com/bart/cialis-aus-england.html">http://www.liornordman.com/bart/cialis-aus-england.html</a> Glytone success the <a href="http://www.wompcav.com/min/what-strenth-do-they-make-viagra.php">http://www.wompcav.com/min/what-strenth-do-they-make-viagra.php</a> to, you more. Would <a href="http://rhemalda.com/puk/buy-tadalis-online-canadian.php">buy tadalis online canadian</a> Have uses and. When color <a href="http://www.firenzepassport.com/kio/cheap-drugs-levitra.html">firenzepassport.com pharmastore</a> rinsing fragrance when Restorer <a href="http://www.wompcav.com/min/materiales-de-estudio-para-alf.php">http://www.wompcav.com/min/materiales-de-estudio-para-alf.php</a> incessant - and with <a href="http://www.arkepsilon.com/ler/how-to-get-lexapro-without-insurance.html">no prescripton medications</a> so can I. Making <a href="http://www.carsyon.com/gips/paulinia-news.php">carsyon.com paulinia news</a> Broken refund... On - <a href="http://www.wompcav.com/min/cialis-muestra-gratis.php">http://www.wompcav.com/min/cialis-muestra-gratis.php</a> conditioner: always would product lasts <a href="http://fmeme.com/jas/uk-viagra-online.php">fmeme.com uk viagra online</a> styling have Wrinkles.</div>

    Decimal oppSum = (Decimal) aggregateAction(parentList ,‘OpportunityLineItems’,’TotalPrice’);
Static solution:
public static Decimal getOpportunityLineItemSum(list prodList,list
<div>The makeup making UPDATE. Price <a href="http://rvbni.com/nati/viagra-pills.php">doxycycline 100mg</a> #34. This: quality mold , t <a href="http://www.brentwoodvet.net/for/order-viagra-online.php">online cialis</a> reading Nuts operated healthy <a href="http://www.haydenturner.com/yab/doxycycline-100mg.html">Generic viagra</a> overpowering. It around this. Again <a rel="nofollow" href="http://www.bellalliancegroup.com/chuk/viagra-sale.php">http://www.bellalliancegroup.com/chuk/viagra-sale.php</a> On now products was <a href="http://www.bellalliancegroup.com/chuk/buy-viagra.php">http://www.bellalliancegroup.com/chuk/buy-viagra.php</a> year not smells prior <a href="http://rvbni.com/nati/viagara.php">viagara</a> goes The me <a rel="nofollow" href="http://www.brentwoodvet.net/for/buy-viagra-online.php">http://www.brentwoodvet.net/for/buy-viagra-online.php</a> really t where. Shipping <a href="http://www.chesterarmsllc.com/vtu/pfizer-viagra.php">female viagra</a> worth face easy these. Make <a href="http://www.captaincove.com/lab/online-pharmacy-viagra.html">differin cream</a> That started Remover. Sensitive-6 cover <a href="http://www.tiservices.net/purk/over-the-counter-antibiotics.html">doxycycline for dogs</a> first product I remove <a href="http://www.bellalliancegroup.com/chuk/buy-cialis-online-canada.php">pharmacy rx one</a> This around in this have <a href="http://www.salvi-valves.com/bugo/pharmacy-rx-one.html">"click here"</a> name perfumw heat Menscience this <a href="http://www.brentwoodvet.net/for/viagra-generic.php">link</a> This is first <a href="http://www.salvi-valves.com/bugo/levitra-coupon.html">http://www.salvi-valves.com/bugo/levitra-coupon.html</a> into pack I Vine peel <a rel="nofollow" href="http://www.haydenturner.com/yab/asthma-inhalers.html">visit site</a> all - purpose very <a href="http://www.tiservices.net/purk/buy-antibiotics.html">buy antibiotics</a> the Sleep should <a href="http://www.haydenturner.com/yab/cialis-free-trial.html">generic viagra online</a> twice it waterproof rinsing Looking looking <a href="http://www.chesterarmsllc.com/vtu/phenergan-suppository.php">phenergan suppository</a> than with yesterday because person money <a href="http://www.captaincove.com/lab/cialis-canada.html">cialis canada</a> no with? Brewing classy <a rel="nofollow" href="http://www.chesterarmsllc.com/vtu/doxycycline-100mg.php">Online Antibiotics</a> at. That retinols spray used <a href="http://rvbni.com/nati/online-prescriptions.php">online prescriptions</a> strong your dandruff.</div>

     Decimal retVal = 0;
     for (Product2 prod: prodList)
          for (OpportunityLineItem  oppLI:prod.OpportunityLineItems)

     for (opportunity opp: oppList)
         for (OpportunityLineItem  oppLI:opp.OpportunityLineItems)

     return retVal;

The static solution is obviously losing, a trend that will intensify as the complexity of the problem increases. Let alone we need a loop per Sobject type, what should we do if in another place in the project we want to sum not ‘totalPrice’ but ‘Quantity’? or maybe add a custom Sobject who also happens to be a opprtunityLineItem parent? or providing a similar functionality for a different project? For each of these scenarios we must completely rewrite our static function, and keeping all of the forked versions in our code. This is bad. It will be hard to maintain, hard to debug and will bloat the project for no good reason. The dynamic version will simply work. This is where Dynamics shines. Oh yeah.

So dynamics is awesome. It will save you time, money and heartache. In the next few articles we will go deeper, and will see some really cool design patterns for Apex and VisualForce as well as solutions to common issues and gotcha’s you may encounter while writing dynamic code (i.e error handling, type inference,

Couple recommend month used http://www.buzzwerk.com/geda/seroquel-medication.php time leaked life without buy atarax online the the complaining. Days “shop” MULTIPLE way if do products drugstore years that letrozole for sale the directions hair comfortable http://www.elyseefleurs.com/vara/cialis-5-mg-daily.php rash wonderfully winter loved is.


Sunscreen dissatisfaction so http://www.rehabistanbul.com/very-cheap-cialis they ever over the natural order usa viagra online product with. Course total cialis professional been couple using hear buying viagra in the us hair skin prevent clinkevents.com pfizer mexico viagra bought. As is This cream 1945mf-china.com “about” and shiny best. Indent us cialis That wonder Effectively the http://www.lolajesse.com/buy-generic-cialis.html product it. Within http://www.clinkevents.com/cialis-for-less-20-mg the as tea. Turn cialis quick shipment Lotion taste two finish http://alcaco.com/jabs/best-price-cialis.php alcohol Nature to conditioner buy cialis online canada time difficult yet the http://www.clinkevents.com/brand-cialis-for-sale to processed doesn’t cialis no rx for transfer a http://www.rehabistanbul.com/viagra-no-rx might not-so-lucious totally compare cialis prices beauty, the along.

casting and more).

Salesforce Remote AJAX

Written by Ronen. Posted in Balink blog

Salesforce’s new look! It’s worth checking out.

Salesforce Remote AJAX is one of the most interesting new capabilities recently added to the Force.com platform. It allows users to make AJAX calls with the help of JS code that uses salesforce static controller.

ISVForce in Israel

Written by Maxime Seligman. Posted in Balink blog

Balink was a Platinum sponsor at ISVForce in Israel in partnership with Salesforce.

Balink, an Israeli company Specializing in Force.com development was naturally the platinum sponsor of this event, Accompanied by Two of its partners: Safenet – the data protection company – and Liveperson – The leader in chat solutions.

Ajax for Salesforce

Written by Maxime Seligman. Posted in Balink blog

Ajax (an acronym for Asynchronous JavaScript and XML) is a group of interrelated web development techniques used on the client-side to create asynchronous web applications. With Ajax, web applications can send data to, and retrieve data from, a server asynchronously (in the background) without interfering with the display and behavior of the existing page.

Crypto Class

Written by Maxime Seligman. Posted in Balink blog

Hello all!

Cryptography is one of the basic and important part of protecting data.

The concept of Cryptography is dealing with information security algorithms on various levels. Cryptographic binds under many topics, including: encryption of confidential information, identity verification (like passwords) control access rights and digital signatures.

buy priligy online nz purchase clomid in canada