Lightning is available in GA from this release .You can ofcourse approach via lightning .Some of the things you need to be extra careful are here 1)No router support in lightning yet and hence its extremely difficult designing navigation at this point .You will end up writing lot of code just to achieve navigations 2)Custom lookups you can get from developerforce blogs 3)Toggling visibility is...
‘Immediate’ attribute for commandbutton and commandlink in VF page
This is basically used when we don’t want our validation rules to be fired during any server request. It is a Boolean value that specifies whether the action associated with this component should happen immediately, without processing any validation rules associated with the fields on the page. If set to true, the action happens immediately and validation rules are skipped. If not specified, this...
Showing Google Maps on Standard & Custom Visualforce Pages in Salesforce
//Write this code under VF page <img src=”{!mapImage}” class=”mapimg”/> //Write this code under Apex Class public string mapImage {get; private set;} ——————————————————————– Where Address__c => Field which hold Address in...
How to generate dynamic queries in apex for sObjects & fields
//return a dynamic Query string that includes all the direct sObject fields and the related Name fields from the parent objects //dependent method of getSobjects //TODO: move this into platform wide sobject utils class as it is not domain specific public static String getBaseQuery(String objName, List<String> customFields) { // get the describe info for the org, object and its fields...
How to get picklist values for fields in apex salesforce
//get all picklist option values using the type of sobject and specific picklist field //TODO: move this into platform wide sobject utils class as it is not domain specific public static List<String> getPickListValues(String objectName, String fieldName) { try { List<String> pickListValuesList = new List<String>(); sObject sObj = Schema.getGlobalDescribe().get(objectName)...
How to read & check permissions of profiles in apex salesforce
public with sharing class IPA_MyAppsComponentController { //Member Var public list myApps {get; private set;} private static ID userId; private static ID profileId; private List myPermSetAsgmnts = new List(); private List profilePermSetAsgmnt = new List(); private Set permSetIds = new Set(); private List appList = new List(); private Set appIds = new Set(); public IPA_Page_Widget__c pageWidgetObj...
How to get your Salesforce Apps List in Apex
// To get list of apps assigned to logged in user public with sharing class IPA_MyAppsComponentController { //Member Var public list<AppMenuItem> myApps {get; private set;} private static ID userId; private static ID profileId; private List<PermissionSetAssignment> myPermSetAsgmnts = new List<PermissionSetAssignment>(); private List<PermissionSet> profilePermSetAsgmnt =...
How to add/remove member to Chatter Group in Apex Salesforce
public pagereference addMembersInGroup() { public Map<String,String> options = new Map<String,String>(); public Map<String,Id> groupsNmembers = new Map<String,Id>(); try{ ConnectApi.ChatterGroupPage groupPage = ConnectApi.ChatterGroups.getGroups(communityId); for (ConnectApi.ChatterGroupDetail grp : groupPage.groups) { options.put(grp.Name,String.valueOf(grp.myRole));...
How to get Chatter Feeds using ConnectApi in Apex Salesforce
public List<ConnectApi.FeedItem> getFeedItems() { List<ConnectApi.FeedItem> lst = new List<ConnectApi.FeedItem>(); if(!istest) { try { lst = ConnectApi.ChatterFeeds.getFeedItemsFromFeed(communityId, ConnectApi.FeedType.Record, chatterGroupId).items; } catch(Exception ex) { } } return lst; } ...
How to get members of Chatter Group in Apex Salesforce
public list<CollaborationGroupMember> returnChatterGroupMember(String chatterGroupId) { list<CollaborationGroupMember> groupMemberDel; groupMemberDel = [select Id, MemberId from CollaborationGroupMember where CollaborationGroupId =: chatterGroupId]; return groupMemberDel; }...