Posts

How to start work with Anypoint Studio?

Image
Anypoint Studio  is a user-friendly eclipse-based  IDE (integration development environment) used for designing and testing Mule applications. Basic setup of our IDE: Install the following software: OpenJDK 8:  https://adoptopenjdk.net/ Anypoint Studio 7.9.0:  https://www.mulesoft.com/lp/dl/studio Git:  https://git-scm.com/download/ Maven:  https://maven.apache.org/download.cgi  ( Installation Guide ) Create your account on Anypoint Platform:    https://anypoint.mulesoft.com/login/signup After successful   installation  of software, start Anypoint Studio and: create a workspace configure Anypoint Studio for EU Region: Window > Preferences:  Configure Anypoint Studio to use the native browser: Window > Preferences: Configure your credentials for the Anypoint platform: Window > Preferences: Setup local Maven (Optional)  If you want to run MUnit tests from the command line, you will need to define a maven reposi...

2 things that surprised us while developing Attachment Exchange Interface for Salesforce instances with Mulesoft.

Image
Our Task: Build interface for synchron iz ation of Cases with attachments between two Salesforce instances. Main assumption of the implementation:       Attchaments linked directly to case and also attachments from emails are process separately. Exchange of Attachments should be triggered by successful transfer of Case.       So generally first Case exange flow is process and when it is successfully done, Attachments exchange flow is triggered. Today we are focused on Attachment part. Implementation for the first sight seems to be easy. All we need to do is to query needed Attachment data basing on Case Id from one Salesforce instance and insert it to second Salesforce instead. Unexpected issue: The main problem was proper approach for querying Attachments data. As we know the best practice for that is to use for that Content Version object. Because we need to retrieve attachments that are linked directly with Case as well as attachments from linked ...

Fetch dependent picklist values depending on record type

Image
The problem The main problem with getting picklist based on recordtype, there is no "out of box" solution. You can easly fetch all values from picklist but without information about recordtypes.  The solution You need use "User Interface API", not very elegant solution, but it works. Give more time Salesforce for implement such obvious functionality (the idea arose only 8 years ago). /ui-api/object-info/{objectApiName}/picklist-values/{recordTypeId}/{fieldApiName} Step by step: public static String innerSalesforceCallout(String serviceEndpoint) {      if (String.isEmpty(serviceEndpoint)){           return null;      } Http http = new Http(); HttpRequest webReq = new HttpRequest(); webReq.setMethod('GET'); webReq.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId()); webReq.setEndpoint(serviceEndpoint);     try { HttpResponse res = http.send(webReq);     } c...

Security Vulnerabilities in Salesforce

Image
  In Salesforce we are using a lots of custom user interfaces. That’s why we should be aware about  various types of security vulnerabilities. The most common you can find here:          SOQL injection,          Cross-Site Scripting (XSS),          Cross-Site Request Forgery (CSRF). Let's discuss each of them briefly. SOQL injection From definition SQL injection can happen when we have insecure construction of database queries with user-supplied data e.g.:         queries are built directly with user data inlined,         queries are   concatenated directly with the query text (not type-safe bind parameters). When designing SOQL queries there are basically three places where behavior of the query can be based on input from User:     Behaviors of the WHERE clause to change the set of returned records.   Selecting fields from ...

Hello Salesforce World

Image
Hello everyone! So, as you can see, this is the first post. I'm pretty sure the first ones are always the hardest, which is quite unfair, since hardly anybody ever reads them. But once you begin, things are supposed to get easier, as you go with the flow. Right?  Anyway, here it is, the first few words from your Salesforce Freaks. Hopefully this blog becomes nice source of information. We will talk about certifications, bugs, features, bugs that are features.. and maybe other way around as well. We'll see.  See you soon, Kinga on behalf of Salesforce Freaks ;)