Tuesday, June 24, 2014

How PEMDAS Can Help Salesforce Admins

I was recently contacted by a friend from the New York City User Group.  She was having trouble getting a validation rule to work correctly, she wasn't getting a syntax error, but the rule wasn’t firing at the correct time.  She asked if I had a few minutes to help her through this so she could get this new validation in production for their users.  I got on the phone with my friend and she emailed me their formula, which looked something like this:

 AND( Approval__c = false, 
Test_Price_1__c > Test_Price_2__c +Test_Price_3__c *.3)

 After speaking with my friend it turned out what she was trying to do was have a validation that a record couldn't be saved if it wasn’t submitted for approval and the first price field was greater than 30% of the sum of the second and third price fields. She couldn’t figure out what was wrong, she was able to save the validation rule so it wasn’t a syntax error. 

 What I ended up doing is quickly re-creating the fields in a developer org I have setup so I could play with the rule. She told me that when she was testing she was using 500 in the first price field and 400 and 500 in the 2nd and 3rd price fields respectively.  In her head she was thinking the result should be 270 (30% of 900), so she should not have been able to save.  

 After reviewing the calculation I realized what salesforce was actually calculating was 30% of 500 + 400 which equals 550 so that’s why was able to save her test record.  

 After she told me all of this I blurted out one word to her “PEMDAS”!  I heard a “huh?” on the other line of the phone. I started to explain to her the Acronym for the order of operations of Math and what her validation rule was actually calculating.

  I went through that Parentheses will be calculated first, Exponents second, then multiplication and division, then finally adding and subtracting.  Even though we were just on the phone I felt like I heard the light bulb go off in her head.  She said she understood what I meant and realized the problem wasn’t in her syntax but in her math.  She applied PEMDAS and re-wrote the validation like this:

 AND( Approval__c = false, 
Test_Price_1__c > (Test_Price_2__c +Test_Price_3__c) *.3)

 I was really happy that I was able to help my friend with her validation rule and pass on a great lesson from one of my favorite teachers of all time. 

After helping my friend I posted a facebook status sharing my re-found love of the PEMDAS Acronym.  “Mrs. Baker would be proud (my 7th grade math teacher). I still use PEMDAS to this day when writing Salesforce formulas. And you should too!”  

 It was through this post that I had a bunch of friends I went to Junior High with comment and share they all still use PEMDAS in their everyday lives too!  I also had some friends from the Salesforce world ask about PEMDAS which is what inspired this blog post.  If you would like to read more about PEMDAS or math in general check out this article from the Math is Fun website.  

 I would like to dedicate this post to my 7th grade math teacher, Mrs. Baker.  PEMDAS is just one of the many lessons that Mrs. Baker taught me. Mrs. Baker was all about making sure she fostered the love of math in both girls and boys.  She even had an afterschool program she ran called “Girls Count” which was open to girls of all grades in our Junior High.  Looking back I thought this was just a fun thing to do afters school that would help me in math and make friends. I didn’t realize that some of the lessons she taught us about believing in ourselves, going after our dreams and showing us that we could be just as good at math and science as boys would still be useful over 20 years later.  

 I hope this post helps some of you out there in Salesforce land and that you’ll think of PEMDAS the next time you write a formula or validation rule in Salesforce.

 As always thank you for reading.

 Cheryl

12 comments:

  1. Great post! Way to go Mrs. Baker!

    ReplyDelete
  2. But wiki said Aunt Sally - http://en.wikipedia.org/wiki/Order_of_operations
    "Please Excuse My Dear Aunt Sally"

    Great one !

    ReplyDelete
  3. nike air max shoes, http://www.nikeairmaxshoess.co.uk/
    ralph lauren shirts, http://www.poloralphlaurenshirts.us.com/
    ralph lauren uk, http://www.ralphlaurenoutletuk.org.uk/
    nike mercurial, http://www.nikemercurial.org/
    air max 2015, http://www.airmax2015.in.net/
    tory burch outlet, http://www.toryburchoutletonline.in.net/
    moncler jackets, http://www.nobis.us.com/
    oakley outlet, http://www.oakleyoutlet.in.net/
    moncler coats, http://www.moncler.us.com/
    true religion jeans, http://www.truereligionjeansoutlet.com/
    coach handbags, http://www.coachhandbagsoutletonline.us.com/
    winter jackets, http://www.cybermonday2015.us.com/
    michael kors handbags, http://www.michaelkorshandbagsoutletstore.us.com/
    ray ban sunglasses, http://www.raybansunglass.com.au/
    cheap nhl jerseys, http://www.nhljerseys.us.com/
    ray ban sunglasses, http://www.raybansunglass.co.uk/
    cyber monday 2015, http://www.blackfriday2015.in.net/
    michael kors outlet, http://michaelkors.outletonlinestores.us.com/
    oakley sunglasses, http://www.oakley.in.net/
    louis vuitton handbags, http://www.louisvuittonhandbags.org.uk/
    louis vuitton outlet, http://www.louisvuittonoutlet.in.net/
    black friday deals, http://www.barbourjacketsuk.co.uk/
    cheap nba jerseys, http://www.nbajerseys.net/
    oakley sunglasses, http://www.oakleysunglassesdiscount.us.com/
    rolex watches, http://www.rolexwatches.in.net/
    michael kors factory outlet, http://www.michaelkorsfactoryoutlets.in.net/
    cheap jordans, http://www.cheapjordanshoes.in.net/
    cheap wedding dresses, http://www.cheap-weddingdresses.net/
    ralph lauren outlet, http://www.ralphlaurenoutlet.in.net/
    1010maoqiuyun

    ReplyDelete
  4. List of packers and movers India. As you satisfied and overwhelming to the request reliable to make to know as immense get shifting still as gain talking to compromise ideal appears to the approach to never sure with ways assistance creative visit precious experience that would make your move to the places which anther offers a multiple along growth opportunities to the relieve about this option assist to you intend support http://www.fooglepackers.com dream the help rid all Foogle mover and packer in India all in one service are provide give up ways to easy tips give finding to above get the hassle for header assured choose to developments moving lead to any kind service for.

    movers and packers Mumbai
    movers and packers pune
    movers and packers Gurgaon
    movers and packers Bangalore
    movers and packers Delhi
    movers and packers Hyderabad
    movers and packers Chennai

    ReplyDelete
  5. Perfect! You assisted give me well read material and a solid understanding of this subject download tik tok videos

    ReplyDelete
  6. إذا كنت تمتلك شركة ، فأنت تدرك أهمية تجنب الاضطرابات في مكان العمل. لحسن الحظ ، من خلال جدولتنا المرن الذي يشمل الأمسيات وعطلات نهاية الأسبوع ، يمكننا العمل وفقًا للجدول الزمني الخاص بك لضمان استمرار سير عمليتك بسلاسة.
    سواء كنت تنتقل إلى منزل أو شقة أو شقة أو وحدة تخزين ، فلدينا كل ما يلزم لنقل متعلقاتك بأمان إلى وجهتها التالية. نحن نستخدم وسادات واقية وأغطية مطاطية ، ولدينا غلاف فقاعي وصناديق متوفرة بأحجام مختلفة. نقدم أيضًا صناديق خاصة مثل عبوات الأطباق وصناديق خزانة الملابس للحفاظ على متعلقاتك محمية ومنظمة. سواء كنت بحاجة إلى شخص ما لتعبئة وتحميل منزلك بالكامل أو نقل عنصر واحد فقط ، فإننا نخصص هذه الخطوة لتناسب احتياجاتك. أنت الرئيس ، وهدفنا هو أن تجعلك تشعر بالاستقرار والاستعداد للفصل التالي.
    المناظر جميلة في المباني الشاهقة ، لكن الانتقال إليها يمكن أن يمثل تحديًا كبيرًا! هل تنتقل من أو إلى الطابق المرتفع ولديك قيود على البناء؟ نحن هنا للمساعدة! نحن نعلم خصوصيات وعموميات التنقل في مناطق المدينة المزدحمة. يوجد مستشارو النقل لدينا في كل خطوة على الطريق للتأكد من حجز المصاعد وأن المبنى الشاهق الخاص بك يحتوي على شهادة تأمين محدثة في الملف. نحن نعمل عن كثب مع الشقق الشاهقة والشقق السكنية في المدينة ، لذلك هناك فرصة جيدة لأننا ساعدنا بالفعل في نقل جيرانك.
    يعد التخلص من المتعلقات غير المرغوب فيها جزءًا طبيعيًا من أي حركة أو تجديد أو عملية تفكيك. من خلال خدمة إزالة القمامة الجديدة الخاصة بنا ، يمكن لأدوات النقل المحترفة لدينا المساعدة في التنظيف عن طريق إزالة الأثاث والحطام والفوضى غير المرغوب فيها من منزلك أو مساحة التخزين. سنقوم بعد ذلك بسحب العناصر بعيدًا ليتم التخلص منها بشكل صحيح. يرجى ملاحظة أنه لا يمكن لفريقنا نقل بعض الأجهزة الإلكترونية والنفايات الخطرة. اتصل بنا لمعرفة كيف يمكننا المساعدة في التخلص من الفوضى!
    نقل اثاث بخميس مشيط
    نقل اثاث بحائل
    افضل شركة نقل اثاث بمحايل عسير
    افضل شركة نقل اثاث بنجران

    ReplyDelete

  7. بصفتنا شركة نقل اثاث محترفة، نقدم نقل البضائع بين المدن إلى كل منطقة من البلاد ،
    من خلال خدمة نقل البضائع بالقطعة التي بدأناها في عام 2000 ، نجحنا في نقل البضائع المنزلية الجزئية لعشرات الآلاف من العملاء حتى اليوم. خاصة في فصل الصيف ، نعمل بشكل مكثف من خلال الخدمات التي ننظمها كل أسبوع ، نأخذ متعلقاتك من منزلك ونسلمها إلى العنوان الذي تريد نقله . علاوة على ذلك ، نقدم خدمات تشمل جميع أنواع فك وتركيب الأثاث والتعبئة والنقل والتأمين.
    شركة نقل عفش بجازان
    شركة نقل اثاث
    نصائح لنقل الأثاث بأمان

    نصائح لنقل الأثاث بأمان
    قد يكون نقل الأثاث الثقيل وحده عملاً محفوفًا بالمخاطر ، خاصة إذا لم تكن لديك خبرة في الشحن. عند الانتقال من منزل إلى آخر ، تحتاج إلى إتقان قواعد السلامة لتجنب الإصابة أو إتلاف الأشياء الثمينة الخاصة بك.
    يمكن لأي شخص يجرؤ على تجاهل إرشادات السلامة عند نقل الأثاث أن يصاب بإيذاء نفسه برفع الأثقال أو نقل الأثاث بطريقة خاطئة.
    أسهل طريقة لنقل الأثاث هي التعامل مع شركة نقل أثاث محترفة. حتى إذا لم يكن لديك أي معلومات ، فقد قمنا بإعداد سلسلة من المقالات من أجل سلامتك.

    ReplyDelete
  8. يساعد المنزل المرتب بالتأكيد في زيادة إنتاجية الفرد. بالعمل في بيئة نظيفة ومنظمة ، لديك رغبة متزايدة في الاستثمار في عملك. أخيرًا ، يجلب طاقم التنظيف معهم جميع المنظفات التي يستخدمها في عمله حتى لا تضطر إلى دفع مبلغ إضافي لشرائها. بالتأكيد يمكنك الحصول على منظف ، لكنك ستوفر المال عندما لا تشتري هذا النوع من المنتجات كثيرًا.
    تنظيف المنزل هو بالتأكيد عملية لدينا أكثر أو أقل في جدولنا الزمني. في بعض الحالات ، قد يحتاج منزلك إلى تنظيف بسيط للأسطح. في حالات أخرى ، قد يتطلب تنظيفًا أعمق. كما هو موضح أعلاه ، هناك العديد من الفوائد لتوظيف طاقم التنظيف. لذلك يمكنك ، بناءً على الحاجة ، عليك إجراء بعض الأبحاث والعثور على ما تبحث عنه. سواء كنت تبحث عن عروض لخدمات معينة أو تقارن الأسعار ، فمن الجيد التأكد من أن ورشة التنظيف التي تختارها موثوقة وفعالة.
    شركة تنظيف شقق
    شركة تنظيف فلل

    ReplyDelete
  9. تعد نظافة البيئة التي نبقى فيها أو نرتاح أو نعمل ، سواء في المنزل أو في المكتب ، أساس راحة الراحة والعمل ، ولكنها أيضًا عنصر مهم جدًا يؤثر على تصور الشركة. لا يمكن إنكار أنه في الوقت الحاضر ، يتم استخدام فرق التنظيف بشكل متزايد ليس فقط من قبل الشركات والمكاتب ، ولكن أيضًا من قبل الأفراد العاديين ، الذين يبحثون عن محترفين يعتنون بالأعمال المنزلية اليومية. إذن ما الذي يجب الانتباه إليه عند البحث عن شركة تنظيف جيدة؟ أراد المهنيين
    ينمو سوق خدمات التنظيف كل عام. ومع ذلك ، على الرغم من المنافسة الشرسة ، ليس من الممكن دائمًا العثور على متخصصين مثل شركة فارس الفرسان ، الذين يقدمون أعلى مستوى من الخدمات التي تلبي توقعات العملاء المحتملين. لذلك ، عند البحث عن محترفين يهتمون بنظافة منازلنا أو مكاتبنا ، يجدر الانتباه إلى الجوانب التالية:
    نطاق الخدمات المقدمة - قبل توقيع عقد مع مقاول معين ، يجدر التحقق مما هو مدرج في سعر الخدمة وما هو العرض الذي يمكننا الاعتماد عليه وكيف سيتم تنفيذ طلبنا ،
    ساعات العمل - والتي يتم تحديدها غالبًا بشكل فردي. في حالة المكاتب ، تقدم أطقم التنظيف عادةً خدمات "ما بعد الدوام" ، أي عندما يعود الموظفون إلى منازلهم ، بحيث لا يتدخل أي من الطرفين مع الآخر. ومع ذلك ، تجدر الإشارة إلى أن بعض الشركات تعمل أيضًا في عطلات نهاية الأسبوع والعطلات ، أو ، على سبيل المثال ، على مدار الساعة ، وبالتالي عليك التفكير بعناية في موعد ظهور متخصصي التنظيف. من الجيد أن تسمح لك الشركة أيضًا بالاتصال بفريق التنظيف على الهاتف ، في مواقف عشوائية ، عندما تكون هناك حاجة فجأة إلى تنظيف الشركة
    افضل شركة تنظيف منازل بالاحساء
    ارخص شركة تنظيف منازل بالاحساء

    ReplyDelete
  10. يخبرنا الخبراء في شركة فارس الفرسان أن تنوع شركات التنظيف كبير بشكل خاص ، ويؤكدون أنه يجب علينا اتخاذ القرار الصحيح الذي سيصل بنا إلى محترف موثوق به! لقد جمعنا لك بعض البيانات التي يجب عليك التحقق منها ، قبل أن نطلب شركة تنظيف لمرة واحدة:
    سنفضل دائمًا شركة تتمتع بخبرة محترمة لعدة سنوات ، لأنها تشير عادةً إلى كيفية إدارة الشركة. عادةً ما توظف الشركات ذات الخبرة موظفين مهرة ومهنيين ، وتقدم عروض أسعار عادلة ودقيقة ، وتتميز بمستوى عالٍ من خدمة العملاء.
    ارخص شركة تنظيف
    ارخص شركة تنظيف بالخبر

    ReplyDelete