How to nest visualforce page
How to nest one visualforce page into another to enable a managed visualforce page for lightning experience?

blake kathryn
Jules of Nature
Monterey Bay Aquarium

PR's Tumblrdome

izzy's playlists!
tumblr dot com
Show & Tell
art blog(derogatory)
YOU ARE THE REASON
No title available
Not today Justin

oozey mess
One Nice Bug Per Day

Product Placement

shark vs the universe
Claire Keane
hello vonnie
almost home

pixel skylines
todays bird

seen from Canada
seen from Egypt

seen from United States
seen from United States

seen from United States
seen from Malta
seen from United Kingdom
seen from Spain

seen from United States
seen from Malaysia
seen from Malta
seen from Bangladesh

seen from Malaysia
seen from United States
seen from Brazil
seen from Malaysia
seen from United States

seen from Russia
seen from United States

seen from China
@crmmanagers-com
How to nest visualforce page
How to nest one visualforce page into another to enable a managed visualforce page for lightning experience?
Nesting s-control into lightning-enabled visualforce page
How to nest s-control into lightning-enabled visualforce page
How to embed HTML code into Salesforce pages
How to embed HTML code into Salesforce pages - specifically for traffic tracking.Sfgeneral.
marketvisual/prospectvisual
How to Target Salesforce’s Task’s standard fields for custom button?
It may take you a while but soon you’ll discover that Task fields’ API names are not usable in custom button creation. The standard fields are hardcoded as:
tsk1 Created By Name tsk1_lkdi Created By Id tsk4 Due Date tsk5 Subject tsk12 Status whatid Related To whois Who /Name
How to change Activities' “Related-To” field’s default value?
Apex List Syntax
An Apex Collection is the in-memory store of data for code execution based on indexed order starting sequentially from 0 to X. Collection Types: Lists (Arrays), Maps, Sets. List Collection Collect elements or other collections. Collect anything from Integers, Strings, objects, user-defined types, built-in Apex types etc. In fact, a List collection can include a list of lists and therefore you gain a multi-dimensional view. Sequence is important in list with the first indexed position being 0. A list can have duplicates. Use new keyword to create a list. “new” needs to follow by the element type being collected which are held in < >.
List Example:
List <Account> sObjectAccountVariable = new List <Account>();
What the above code does is it creates a List of <accounts> where the sObjectAccountVariable is a user-defined name to be referenced later on by some code when the new List of <Account> is needed.
Apex Statement Types & Syntax
Just like any other programming language, an Apex Statement is simply any code that executes an action. A semicolon must end with all Apex Statements!
Types of Apex-Statement Usage: - Variable Assignments - If/Else Conditional Statements - Locking - DML (Data Manipulation Language) to insert, update, delete, etc. - Transactional Controls - Method Invoking - Exceptions Handling - Loops that include Do-while, While, For Use curly brackets { } to contain a single block of statements that are grouped to execute as one single statement.
if (true) { System.debug(1); //--> statement 1 of group 1 System.debug(2); //--> statement 2 of group 2 } else { System.debug(3); //--> statement 3 of group 2 System.debug(4); //--> statement 4 of group 2 }
If a block only has 1 statement then you’re not required to use the curly brackets.
if (true) System.debug(1); else System.debug(2);
Primitive vs. Non-Primitive Arguments
2 examples that show variable declarations first as primitive and second as non-primitive. Example 1 Integer Count = 0; // variable has a declarative value hard coded Example 2 Account MyAccount = new Account (); // an account-based variable that references the Account sObject
Primitive data type arguments like Integers and Strings are hard-coded with value that once processed will be lost. This is the case in Example 1. However, non-primitive data type arguments, that instantiate an sObject, are processed through the method through reference. Such reference though are fixed to the specific Object that that it references and can’t be changed to another one.
Generic sObject Limits
Generic sObject by default can only have fields added using constructor syntax such as Account acct = new Account(Name=‘Salesforce Consulting Company’, Phone=’(555)555-5555’, ClientStatus__c=‘Active’, ContactCount__c=100);
To use the dot notation syntax, you must cast the generic sObject.
Account acct = (Account)myGenericObject; String Name = acct.Name; String Phone = acct.Phone; String ClientStatus__c = acct.ClientStatus__c; String ContactCount__c= acct.ContactCount__c; Unlike strict declarations of specific sObjects types, generic sObjects can only be created using New sObject() insertion methods. Querying generic sObjects can only be done through Put() and Get() methods.
Generic sObject
Instead of referencing a specific Object Type, like Account or Contact, to then instantiate an in-memory container, you can reference a generic Object Type.
Instead of Account acct = new Account(Name='Salesforce Consulting Company'); We can use generic sObject by replacing “Account” type with simply “sObject”
sObject acct = new Account(Name=‘Salesforce Consulting Company’);
The use of generic sObject allows you to flexibly reference any Salesforce record, across standard vs. custom objects. This is different from fixing the sObject Type to specifically, for example, Account vs. Contact. If we set Account as the sObject type then we can only reference fieldnames that actually exist in the Account Object.
Adding Fields to sObjects
2 ways to add fields to sObjects. The first is called constructor and the second is called dot notation.
Example 1: Constructor
Account acct = new Account(Name=‘NameValue’); Name is the field name; it doesn’t have trailing __c because it’s a standard field to Salesforce’s standard Account object. Note the single quotation marks to encapsulates the NameValue. If you want the sObject’s “Name” datafield to have a value of “Salesforce Consulting Company” then you would replace ‘NameValue’ with ‘Salesforce Consulting Company.’
Add a trailing comma in order to add new fields & field values.
Account acct = new Account(Name='Salesforce Consulting Company', Phone='(555)555-5555', ClientStatus__c=‘Active’, ContactCount__c=100);
Notice how numeric values do not need to be inside single quotation marks.
Example 2: dot notation Account acct = new Account (); acct.Name = ‘Salesforce Consulting Company’; acct.Phone = ‘(555)555-5555′; ClientStatus__c=‘Active’; ContactCount__c=100;
sObject vs. Object
sObjects are abstractions of actual Salesforce Objects so that you can develop and execute Apex code against the database without actually impacting the actual Data Object directly. Therefore, sObjects are temporary data stores, in memory, of any Standard or Custom Object, such as Account vs. TerminatedAccount, for code processing.
sObject Syntax in Apex development:
[ObjectName] [UDF Variable] = [method] [sObjectName]();
“UDF” means user defined field. For our purposes, UDF means you state any custom name to the variable. Note that the ending semicolon is required!
Example 1: Account acct = new sObjectAccount(); “Account” is the datatype of the user-defined “acct” variable. “New” is the DML method.
Example 2: TerminatedAccount__c terminatedAcct =
new TerminatedAccount();
We state the standard vs. custom object, respectively without vs with the __c denotation. All we’re doing here is declaring in the Apex code the abstraction of the standard vs. custom object so that we can use temporarily in code execution.
sObjects must be declared before any DML execution. For example, before you can insert (create) a Salesforce record, you must create its sObject first in-memory. To create a new sObject instance we use the new command. In example 1, the () behind the sObjectName is empty because we haven’t yet declared any hard-coded value or provide any referencing datafield to populate by its value.
Salesforce Object vs. DataField
In Salesforce, an Object is a primary data container, from which many datafields may exist. “Account” vs. “Contact” vs. “Opportunity” are data Objects and within which, respectively AccountName, ContactName, OpportunityName exist as datafields. A datafield will have 2 naming conventions: label vs. API Name. A datafield’s label is what is shown to Users in the front-end; you can change datafield labels as-needed without impacting underlying code. Parallel to field label is field API Name. This is the name that all underlying code will leverage, whether through APEX or SOQL queries. Therefore, fields’ API Names should remain unchanged. Once changed, your code may break.
Referencing Object’s FieldNames In writing code, you call up a fieldname by its API Name using the following syntax: ObjectName.FieldAPIname (not Field Label!)
Example 1. Account.AccountName Example 2. Account.AccountAge__c Example 3. TerminatedClient__c.TerminationDate__c
The “__c” denotes the fact that it’s a custom object or field, not provided out-of-the-box as standard Salesforce data components. If an object or a field is custom, meaning you created it, then when you code against it you must reference it by the trailing double underscores and the “c” to denote “custom.”
Declaring Apex Variables
Because Apex is a strongly-typed language, you must declare data types for all variables before you can reference it in your code. Apex data types include: Integer, Date, Boolean, Lists, Maps, Objects, and sObjects.
Variable Declaration Format: datatype variable_name [ = value ]; The ending semicolon is required! e.g. Integer Count = 0; // variable has a declarative value hard coded e.g. Decimal Total; // variable doesn’t have any assigned value e.g. Account MyAccount = new Account (); // an account-based variable that references the Account sObject
What is Apex?
Apex is an object-based development language used to operate and customize Salesforce. Apex developers write Apex code to automate workflow models and execute controls related to how Salesforce data are calculated, rendered, and transacted against custom views and processes.
Apex is a strongly typed language. This means that it directly references data objects and field names to compile. Compiler will fail if object and/or fieldname references are not correctly declared.
Apex is Java-based so it uses similar expressions, statements, variables, and looping structures. When writing Apex code, you leverage both SOQL (Salesforce Object Query Language) & SOSL (Salesforce Object Search Language) to query the database and return lists of sObject records (Salesforce data records). Salesforce DML (data manipulation language) is used to insert, update, and delete from the database.