Skip to main content

Posts

Showing posts from July, 2016

Data Management : Importing and Exporting Data

Note: All credit goes to Salesforce, I am just a developer who enjoy playing trailhead and try to make note to myself. Importing Data Two methods of importing data :  When to use Data Import wizard : Need to load less than 50000 records The objects that need to be imported is supported by wizard No need automation process When to use Data Loader : Need to load 50000 to 5 Million records. The object is not supported by Data Import Wizard Want to schedule regular data loads Data Import Useful tips for cleaning data using Excel Salesforce Trailhead link :  Importing Data Exporting Data Two methods of exporting data Data export wizard - accessible through the Setup menu. It allows you to export data manually once every six days (for weekly export) or 28 days (for monthly export). You can also export data automatically, at weekly or monthly intervals. Data Loader -this is a client application that you must install separately. It can be operated either

Data Modelling :Creating object relationship

Note: All credit goes to Salesforce, I am just a developer who enjoy playing trailhead and try to make note to myself. Types of Object Relationship Lookup relationship that links one object to another object. can be used to create 1:1 or 1:M relationship Master Detail parent:child relationship. master record controls certain behavior of the details or subdetail record. ownership and sharing is determined by master record. when master record is deleted,the detail also will be deleted along with it. master detail relationship always required on detail record. use for tight binding between two objects master object can also contain rollup summary field. Differences between Lookup and Master detail relationships Master detail relationship cannot create detail without master detail is also deleted when master is deleted the sharing rules is inherited from the master record number of master detail relationships are limited based on platform edition and licence

Apex Basics & Database : Writing SOSL Queries

Note: All credit goes to Salesforce, I am just a developer who enjoy playing trailhead and try to make note to myself. What is SOSL? Salesforce Object Search Language (SOSL) is a Salesforce search language that is used to perform text searches in records . Use SOSL to search fields across multiple standard and custom object records in Salesforce. SOSL is similar to Apache Lucene . Differences and Similarities Between SOQL and SOSL Like SOQL, SOSL allows you to search your organization’s records for specific information. Unlike SOQL, which can only query one standard or custom object at a time, a single SOSL query can search all objects. They are same in :  allows you to search your organization’s records for specific information They are not same: SOQL can only query one standard or custom object at a time, a single SOSL query can search all objects. SOSL matches fields based on a word match while SOQL performs an exact match by default (when not using wildcards).

Process Builder Exception : The record couldn’t be saved because it failed to trigger a flow

The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 3xxxxxxxxxxxxxx.  Contact your administrator for help. The process builder is to update Country Contact with Account Country if the Contact Country is blank based on condition below : When user uploads the Contact data without Account data it will throw an exception and I receive an email contains information below which is not so helpful. An error occurred at element myDecision (FlowDecision). The flow failed to access the value for myVariable_current.Account.Country__c because it hasn't been set or assigned. Logically it should not run the process builder at the first place because the conditions are not fulfilled.I plan to raise ticket to Salesforce until I accidentally change the sequence of the conditions to : Note I put AccountId condition before checking the Account Country__c.I run another test and wallahhh...the exception is gone.Con

Apex Basics & Database Writing SOQL Queries

Note: All credit goes to Salesforce, I am just a developer who enjoy playing trailhead and try to make note to myself. Querying Related Records Get child records related to parent record Account [] acctsWithContacts = [ SELECT Name , ( SELECT FirstName , LastName FROM Contacts ) FROM Account WHERE Name = ' SFDC Computing ' ]; // Get child records Contact [] cts = acctsWithContacts [ 0 ]. Contacts ; System . debug ( ' Name of first associated contact: ' + cts [ 0 ]. FirstName + ' , ' + cts [ 0 ]. LastName ); Querying Record in Batches By Using SOQL For Loops With a SOQL for loop, you can include a SOQL query within a for loop. The results of a SOQL query can be iterated over within the loop. SOQL for loops use a different method for retrieving records—records are retrieved using efficient chunking with calls to the query and queryMore methods of the SOAP A

Apex Basics & Database : Manipulating Records with DML

Note: All credit goes to Salesforce, I am just a developer who enjoy playing trailhead and try to make note to myself. Manipulating Records with DML DML statements that are available: insert update upsert-creates new records and updates sObject records within a single statement, using a specified field to determine the presence of existing objects, or the ID field if no field is specified. delete undelete merge-merges up to three records of the same sObject type into one of the records, deleting the others, and re-parenting any related records. Each DML statement accepts either a single sObject or a list (or array) of sObjects. Operating on a list of sObjects is a more efficient way for processing records . Database Methods Apex contains the built-in Database class, which provides methods that perform DML operations and mirror the DML statement counterparts. These Database methods are static and are called on the class name. Database.insert() Database.update()

Apex Basic and Database :Using SObject

Note: All credit goes to Salesforce, I am just a developer who enjoy playing trailhead and try to make note to myself. Relationship between Sobjects and Salesforce record Every record in Salesforce is natively represented as an sObject in Apex . For example, the Acme account record corresponds to an Account sObject in Apex. The fields of the Acme record that we can view and modify in the user interface can be read and modified directly on the sObject as well. Each Salesforce record is represented as an sObject before it is inserted into Salesforce . Likewise, when persisted records are retrieved from Salesforce, they’re stored in an sObject variable. Some rules used for API names for custom objects and custom fields. For custom objects and custom fields, the API name always ends with the __c suffix. For custom relationship fields, the API name ends with the __r suffix. For example: A custom object with a label of Merchandise has an API name of Merchandise__c. A custom fie

Apex Basic and Database : What is Apex ?

Note: All credit goes to Salesforce, I am just a developer who enjoy playing trailhead and try to make note to myself. What is Apex? programming language that uses Java-like syntax and acts like database stored procedures. Apex enables developers to add business logic to system events, such as button clicks, updates of related records, and Visualforce pages. source  Apex is: Hosted —Apex is saved, compiled, and executed on the server—the Force.com platform. Automatically upgradeable —Because compiled code is stored as metadata in the platform, Apex is automatically upgraded as part of Salesforce releases. Object oriented —Apex supports classes, interfaces, and inheritance. Strongly typed —Apex validates references to objects at compile time. Multitenant aware —Governer limit.Because Apex runs in a multitenant platform, it guards closely against runaway code by enforcing limits, which prevent code from monopolizing shared resources. Integrated with the

Lightning Experience Development : User Interface Development Consideration

Note: All credit goes to Salesforce, I am just a developer who enjoy playing trailhead and try to make note to myself. Two models of developing web app Page Centric web application model great to serve basic functionality. not offer great user interactive experience server side generate user interaction App Centric mode great user experience client side Three options that offered by Salesforce Classic Visualforce UI Generation -  Server-side Data and Business Logic- Apex standard or custom controller Workflow User requests a page The server executes the page’s underlying code and sends the resulting HTML to the browser The browser displays the HTML When the user interacts with the page, return to step one. Pros Tried and true model Easy to implement for greater productivity Naturally splits large applications into small, manageable page Has built-in metadata integration Caveats Limited interactivity (aside from added JavaScript functionality

Lightning Experience

Note: All credit goes to Salesforce, I am just a developer who enjoy playing trailhead and try to make note to myself. Which one I should use?Lightning Experience or Salesforce Classic? Lightning Experience might be right for some or all of your org if: Your sales team does business-to-business sales using accounts, contacts, leads, opportunities, custom objects, and the other sales features supported in the new user interface. You want to pilot the new user interface with a group of sales reps. You’re looking to reboot your Salesforce implementation. This is a great opportunity to introduce new features because you’re doing change management anyway. Salesforce Classic might be right for you if: Your sales team makes regular use of features that aren’t yet available in Lightning Experience, such as quotes, forecasting, or territory management. You primarily use customer service tools or other non-sales features. You want a single experience for your sales and service teams.