Entity is not org-accessible in Salesforce

1. Check whether there are any typo in the code.

2. If the issues is in Apex manage sharing reason access, check the OWD of the object.

Note:

OWD of the object should be either Private or Public Read Only to access Apex Manage Sharing Reason.

Hope this helps!!

Cheers!!!

Apex Sharing Reason in Salesforce

Apex sharing reasons are used by developers when adding sharing to a record programatically. Using an apex sharing reason prevents standard users from deleting the sharing, and allows the developer to track why they added the sharing.

1. Go to an object and click New in Apex Sharing Reason related list.


2. Create New Apex Sharing Reason.


Syntax:

Schema.CustomObject__Share.rowCause.SharingReason__c

Sample Code:

Schema.Member__share.RowCause.Sample_Reason__c

Cheers!!!

How to setup Enterprise Territory Management in Salesforce?

1. Go to Enterprise Territory Management Settings.


2. Click "Enable Enterprise Territory Management".


3. Select the related records access and click Save.


4. Click "New Territory Type".


5. Save Territory Type.


6. Click "New Territory Model".


7. Save the Territory Model.


8. Click Veiw Hierarchy to create Territory.


9. Click "Create Territory".


10. Set the other stuffs.


Cheers!!!

How Does Filter-Based Opportunity Territory Assignment Work in Salesforce?

Filter-Based Opportunity Territory Assignment lets you use a simple job to assign territories to opportunities. We provide code for an Apex class that you can use as-is or modify as needed based on our guidelines. After you create and deploy the class, run the job to complete the assignment process. Job options include making assignments within date ranges and assigning territories to open opportunities only. You can also configure your settings to run the job every time an opportunity is created.

The Apex class code Salesforce provides assigns territories to opportunities based on a number of factors.

• Is the opportunity excluded from filter-based territory assignment? If so, no territory is assigned.

• Does the opportunity have an account assigned and does that account have a territory assigned from the active territory model? If so, the account’s territory is assigned to the opportunity. If not, no territory is assigned.

• Does the opportunity’s assigned account have multiple territories from the active model assigned? If so, the job can use a priority value from the Territory2type object or other criteria to determine which territory (if any) to assign to the opportunity.

Cheers!!!

ENTERPRISE TERRITORY MANAGEMENT in Salesforce

Enterprise Territory Management allows you to organize your sales structure into separate territories, based on geographic attributes, named accounts, industry/verticals, or any other criteria that suits your organization. You can experiment with different territory models and activate the one that works best for your sales teams.

Deploying Territory Management includes these steps:

Build your territory hierarchy.
Assign users to territories and create rules for account assignment.
Preview your account assignments.
Activate your territory model.

Territory Type
Territory types help you organize your territories by key characteristics important to your company. Every territory you create must have a territory type. Territory types are used for organizing and creating territories only: they do not appear on territory model hierarchies.

Territory
Territories organize groups of accounts and the Salesforce users who work with those accounts. Territories are created based on territory types.

Territory Type Priority
Specifying and managing territory type priority information helps you choose the appropriate territory type for territories you create or edit. There are no predefined priority options, so your organization should create its own priority scheme. For example, 001 may indicate that a territory type is the highest priority or the lowest. Make sure your scheme can scale as you add more territory types.

Territory Model
A territory model represents a complete territory management system for your organization. Modeling lets you create and preview multiple territory structures and different account and user assignments before you activate the model that works best.

Territory Hierarchy
The territory hierarchy shows a model’s territory structure and serves as its main interaction point. Start from the hierarchy to create, edit, and delete territories; run assignment rules for territories, and navigate to territory detail pages for more information. From the hierarchy, you can also assign territories to opportunities, run assignment rules at the model level, and activate or archive the model.

Territory Model State
Territory model state indicates whether a territory is in the planning stage, in active use, or archived. Your organization can have only one active territory model at a time, but you can create and maintain multiple models in planning or archived state to use for additional modeling or reference

Cheers!!!

Platform Cache in Salesforce

Platform Cache is a memory layer that stores Salesforce session and org data for later access. When you use Platform Cache, your applications can run faster because they store reusable data in memory. Applications can quickly access this data; they don’t need to duplicate calculations and requests to the database on subsequent transactions. In short, think of Platform Cache as RAM for your cloud application.

With Platform Cache, you can also allocate cache space so that some apps or operations don’t steal capacity from others. You use partitions to distribute space. We’ll get to partitions later.

1. Go to Platform Cache.

2. Request Trial Capacity.


3. Create a New Platform Cache Partition.


4. Save a New Platform Cache Partition.


Sample Apex Class:

public class BusScheduleCache {
    private Cache.OrgPartition part;
    
    public BusScheduleCache() {
        Cache.OrgPartition orgPart = Cache.Org.getPartition('local.BusSchedule');
    }
    
    public void putSchedule(String busLine, Time[] schedule) {
        // Get partition
        Cache.OrgPartition orgPart = Cache.Org.getPartition('local.BusSchedule');
        
        // Add cache value to the partition. Usually, the value is obtained from a callout
        orgPart.put(busLine, schedule);
    }
    
    public Time[] getSchedule(String busLine) {
        Cache.OrgPartition orgPart = Cache.Org.getPartition('local.BusSchedule');
        Time[] listTimes = new Time[]{};
        Time[] listTimes1 = (Time[])orgPart.get('BusSchedule');
        if (listTimes1 == null) {
            listTimes.add(Time.newInstance(8, 0, 0, 0));
            listTimes.add(Time.newInstance(17, 0, 0, 0));
        } else {
            listTimes = listTimes1;
        }
        return listTimes;
    }
}
Cheers!!!

Salesforce User Research Program

Use the below link to join Salesforce User Research Program.

https://design.secure.force.com/ux?rc=db95a15d4f618a4

Very useful!!!

Cheers!!!

How to get data from one org to another org in Salesforce?

Check the below links for the tools to get data from one org to another org in Salesforce

https://www.sfapex.com

http://www.talend.com/download

I recommend SFApex tool. Awesome tool. Saves lot of time during migration. Easy to use and setup.

Cheers!!!

aura:method in Salesforce

Use <aura:method> to define a method as part of a component's API.

This enables you to directly call a method in a component’s client-side controller instead of firing and handling a component event.

Using <aura:method> simplifies the code needed for a parent component to call a method on a child component that it contains.

Sample Code:

Lightning App:

<aura:application >
    <c:myLightningComponent/>

</aura:application>

Lightning Component:

<aura:component >
    <aura:method name="compMtd" action="{!c.callFromCompMetd}">
        <aura:attribute type="String" name="Str" default="testing"/>
    </aura:method>
    <ui:button label="Click" press="{!c.callBtn}"/>
</aura:component>

Lightning Controller:

({
callBtn : function(component, event, helper) {
component.compMtd();
},
    callFromCompMetd : function(component, event, helper) {
        var params = event.getParam('arguments');
        if (params) {
            var param1 = params.Str;
    alert(param1);
        }
}
})

Output:


Cheers!!!

Lost my contact number associated to Salesforce authenticator


Click Disconnect next to App Registration Salesforce Authenticator.

Cheers!!!

Chart Colors in Visualforce Charting

By default, chart colors match those of the built-in reporting and analytics charts so that you can create visually-consistent dashboards. If you want to create your own color scheme you can customize the colors of most chart elements.

To provide a set of color definitions to draw data series elements (bars, pie wedges, and so on), use the colorSet attribute. Set <apex:chart colorSet="..."> to specify the colors to be used for every data series in a chart. Set colorSet on a data series component to specify colors for that series only.

Sample Code:

Visualforce Page:

<apex:page controller="Sample">
    <apex:pageblock title="Members and their Years of experience" >
        <apex:chart height="250" width="350" data="{!pieData}"> 
            <apex:pieSeries tips="true" dataField="data" labelField="name" colorSet="#37241E,#94B3C8,#4D4E24,#BD8025,#816A4A,#F0E68C"/> 
            <apex:legend position="bottom"/>
        </apex:chart>
    </apex:pageblock>
                        
    <apex:pageblock title="Members and their Years of experience" >
        <apex:chart height="250" width="350" data="{!pieData}"> 
            <apex:axis type="Numeric" position="left" fields="data" title="Years of experience"/>    
            <apex:axis type="Category" position="bottom" fields="name" title="Member"/>            
            <apex:barSeries orientation="vertical" axis="left" xField="name" yField="data" colorSet="red"/> 
        </apex:chart>
    </apex:pageblock>   

</apex:page>

Apex Controller:

public with sharing class Sample {  
    public List<PieWedgeData> getPieData() {  
        List<PieWedgeData> data = new List<PieWedgeData>();
        List<Member__c> memb = new List<Member__c>();  
        
        String sql = 'SELECT Name, Year_s_Of_Experience__c FROM Member__c';
        memb = Database.Query(sql);
        for(Member__c temp:memb)
        {           
            data.add(new PieWedgeData(temp.Name,temp.Year_s_Of_Experience__c));
        }
        return data;  
    }  
    
    // Wrapper class  
    public class PieWedgeData 
    {  
        public String name { get; set; }  
        public Decimal data { get; set; }  
        
        public PieWedgeData(String name, Decimal data) 
        {  
            this.name = name;  
            this.data = data;  
        }  
    }  

}

Output:


Cheers!!!

How to automate creation of sandbox in Salesforce?

SandboxInfo

Represents a sandbox.

SandboxInfo enqueues a sandbox for creation or refresh. A create operation on SandboxInfo represents creation of a new sandbox, and an update represents refresh of an existing sandbox.

For every create or update, a SandboxProcess is automatically created and is used for monitoring the sandbox copy process.

This object is available in API version 35.0 and later.

For more information, check the below link

https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_sandboxinfo.htm

Cheers!!!

Lightning Experience Permission

Under System Permissions, select Lightning Experience user.


This permission helps the user to access the Salesforce Lightning Experience. Users with this permission can individually enable or disable this user interface.

Cheers!!!

Lightning Challenge Salesforce

Calling all Salesforce Admins – you’re invited to participate in the first ever Admin #LightningChallenge!

Join us on a 10-day quest to learn more about Lightning and get hands-on experience with some of the cool new features and functionality.

If you successfully complete all 10 challenges, you’ll score yourself an awesome SWAG pack!

You may even be selected to be a special guest on the ButtonClick Admin Podcast.

Check the below for Salesforce Lightning Challenge.

https://admin.salesforce.com/lightningchallenge

Cheers!!!

How to create home page in Salesforce Lightning Experience?

1. Go to Lightning App Builder.


2. Click New.


3. Select Home Page.


Cheers!!!

External Data Integration Limits in Salesforce

Salesforce has External Data Integration Limits in Salesforce.

Check the below link for more information

https://help.salesforce.com/articleView?id=platform_connect_considerations_query_rate_limits.htm&language=en_US&type=0

Cheers!!!

Shield Platform Encryption for Custom Field in Salesforce


Cheers!!!

Push Notification in Service Cloud Console

1. Go to Apps.


2. Select Console App.

2. Click "Select objects and fields for notifications".


3. Click Edit and select the objects and fields related to it.


4. Choose refresh for list and record detail page.


Output in the List:


Cheers!!!

Which Fields Can I Encrypt using Shield Platform Encryption?

Encrypted Standard Fields
You can encrypt the contents of these standard field types.

On the Account object:
Account Name
Description
Fax
Website
Phone

On the Contact object:
Description
Email
Fax
Home Phone
Mailing Address (Encrypts only Mailing Street and Mailing City)
Mobile
Name (Encrypts First Name, Middle Name, and Last Name)
Other Phone
Phone

On the Case object:
Subject
Description
On Case Comments:
Body (including Internal Comments)
Encrypted Custom Fields

You can encrypt the contents of fields that belong to one these custom field types:
Email
Phone
Text
Text Area
Text Area (Long)
URL
Date
Date/Time

Important
Once a custom field is encrypted, you can’t change the field type. For custom phone and email fields, you also can't change the field format.
You can't use currently or previously encrypted custom fields in custom formula fields or criteria-based sharing rules.
You can't use Schema Builder to create an encrypted custom field.

Some custom fields can’t be encrypted:
Fields that have the Unique or External ID attributes or include these attributes on previously encrypted custom fields
Fields that are used in custom formula fields
Fields on external data objects
Fields that are used in an account contact relation

Cheers!!!

How to find Text (Encrypted) usage in Salesforce?

1. Create a Force.com project in Eclipse.

2. Make sure Objects - Standard and Objects - Custom are added.

3. Search "EncryptedText" from the eclipse by pressing CTRL + H.


Cheers!!!

How to query view setup audit trail using apex in Salesforce?

Starting with Winter'16 the SetupAuditTrail object is exposed to query from Apex.

For fields in the object, check the below link

https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_setupaudittrail.htm

Sample SOQL:

List<SetupAuditTrail> listAudits = [SELECT Id, 
Action, 
CreatedBy.Name, 
CreatedDate, 
Display, 
Section 
FROM SetupAuditTrail 
WHERE CreatedBy.Email LIKE '%abc.com%'];

Cheers!!!

How to enable Platform Encryption in Salesforce?

1. Create a Permission Set with "Manage Encryption Keys Permissions Salesforce" permission.


2. Go to "Platform Encryption".


3. Click "Generate Tenant Secret".


4. Use Encrypt Files and Attachments to encrypt attachments and Encrypt Fields to encrypt the fields.


Output:


Cheers!!!

Salesforce IoT Cloud

Now you can harness the power of the Internet of Things and turn the data generated by every one of your customers, partners, devices, and sensors into meaningful action. With IoT Cloud you can process massive quantities of data, build business rules with simple, intuitive tools, and engage proactively with customers in real time.

Salesforce IoT Cloud is powered by Thunder, a scalable event processing engine, designed to ingest and analyze billions of events. Events are the data that comes from the networked devices and objects we talked about above. On top of that, Thunder lets you take personalized actions based on these events, which help your company create more enriching and focused customer experiences.

IoT Cloud’s way of taking in data and triggering actions to create experiences lets your company focus on creating engaging, individualized experiences for all your customers. These might be customized alerts, emails, or messages. Or the actions might be something else within Salesforce, like creating a service ticket, or customizing the information they access through an app.

For videos, check the below link

https://www.salesforce.com/form/conf/iot-demo.jsp?leadcreated=true&chapter=&internal=true&videoId=&__element=pre&DriverCampaignId=70130000000sUVb&player=&redirect=true&FormCampaignId=70130000002Dq4d&playlistId=&d=70130000000Yunl&mcloudHandlingInstructions=&landing_page=%2Fform%2Fdemo%2Fiot-demo.jsp&nurture=

Cheers!!!

Transaction Security in Salesforce

Transaction Security is a feature that monitors Salesforce events in real time and applies actions and notifications based on rules you create. These rules, or policies, are applied against events in your org. (In the earlier example, our policy was to have no more than three active sessions per user.) You create policies for certain event combinations, and specify actions to take when those events occur.

1. Go to Transaction Security.


2. Enable Transaction Security Policies.


3. Create New Custom Transaction Security Policy.

Example:

Below New Custom Transaction Security Policy will send an email if any user logs in from Safari browser.


Apex class generated as part of this is below:

global class AvoidSafariBrowserPolicyCondition implements TxnSecurity.PolicyCondition {
    
    public boolean evaluate(TxnSecurity.Event e) {
        LoginHistory eObj = [SELECT ApiType FROM LoginHistory WHERE Id = :e.data.get('LoginHistoryId')];
        if(eObj.ApiType == 'Safari') {
            return true;
        }        
        return false; 
    }
    
}

Cheers!!!

Steps to be followed for Per User Identity type while setting External Data Source in Salesforce

1. Go to the Profile or the Permission Set used for Files Connect permission.


2. Add the External Data Source to the profile/permission set.

3. Go to Authentication Settings for External Systems and authenticate yourself.


Cheers!!!