Feline Flock Blog: cloud architecture/development and AI

  • Revolutionize Your Reports and Page Layouts with SVG:  an innovative field format

    Revolutionize Your Reports and Page Layouts with SVG: an innovative field format

    If you add a long text field to a report, you may end up with something undesirable like the image below:  a field of plain text squeezed and stripped of any formatting. The “normal” way of fixing that would be to create a plain text field and use a workflow to copy the first 255 characters…

  • Unlock the Power of Color in Your Reports and Page Layouts

    Unlock the Power of Color in Your Reports and Page Layouts

    Other than using Rich Text fields, there are rigid limits in regards to how fields appear on a page layout or report. In the Account report below, you can see a text field that appears in different colors depending on the industry of the account. This article shows one way to obtain that functionality. Below is the formula used…

  • Data modeling insight from the Bible

    “In the beginning, God created the heaven and the earth.” The very first sentence in the Bible lays out all dimensions of information:– the time: in the beginning– the person: God– the action: created– the location: the heaven (the first reference to a place)– and the matter produced by the action: the earth Those correspond to…

  • Optimize Complex Salesforce Formulas: 3 Proven Steps

    This article was also posted in LinkedIn:  3 Steps to optimize a complex formula in Salesforce. The formula below was created straight from the client requirements and didn’t fit the maximum formula size (5k bytes) when compiled. It was intended to display a red, yellow or green square depending on how many days the account was…

  • Trying to resolve the Travelling Salesman Problem in Salesforce

    Trying to resolve the Travelling Salesman Problem in Salesforce

    Below is a screen showing one attempt at finding the best route to visit several accounts using the Artificial Bee Colony algorithm. The best route is defined as the route with minimal total sum of the distances between accounts. In other words, the route to spent the least amount of time and gas. I am not sure…

  • How to implement edit locking

    When 2 users start editing the same record, the first user who saves the record wins, and the other user will lose the changes with an error message similar to “The record you were editing was modified by *someone* during your edit session. Please re-display the record before editing again.” This can be an inconvenience:  if…

  • Another trick: how to obtain a set from any field in a list – faster and without loops!

    This is like the previous post about getting maps out of a list, but with the same trick applied for getting a set. In triggers, we usually code a loop like below to collect certain IDs in a set and later use the set in a query. … Set<String> acctIDSet = new Set<String>(); for( Contact aContact…

  • Trick: How to obtain a map indexed by any field (not just ID) faster and without loops!

    Often we query an object and need to create a map out of the list of records retrieved. The most straightforward way is to declare a Map<ID, sObject> and initialize it with a list resulting from a SOQL query. List<Account> acctList = [ SELECT ID, Name, AccountNumber             FROM Account ]; Map<ID, Account> acctMapByID = new Map<ID, Account>( acctList…

  • How to clone a custom object in Salesforce/Eclipse

    This is how you can create a new custom object with the same fields as an existing custom object: 1) Download custom objects in Eclipse – right-click the project in the ‘Package Explorer’ window – in the popup menu, select ‘Force.com/Project Properties’ – in the properties window, select ‘Force.com/Project Contents’ – click ‘Add/Remove’, then make…

  • How to emulate EXISTS clause in SOQL

    Here is how to emulate the EXISTS clause in SOQL In the example below Education__c is a custom object that has a lookup field to Contact. Suppose you have a query that would be written like this: SELECT Id, Name FROM Contact cn WHERE EXISTS ( SELECT 1 FROM Education__c WHERE Contact__c =  cn.Id )…

Got any recommendations?