This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| * This method accepts the ID of any object type and returns the full name, including prefix of the sObject | |
| # | |
| * type to which it belongs. | |
| # | |
| * @author cpeterson | |
| # | |
| **/ | |
| # | |
| public static Schema.SObjectType getObjectType(id subject){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| List<UserFeed> myfeed = [SELECT Id, FeedPostId | |
| FROM UserFeed | |
| WHERE feedpostid = :recipeSixFPostID LIMIT 1]; | |
| FeedComment fcomment = new FeedComment(); | |
| fcomment.FeedItemId = myfeed.get(0).id; | |
| fcomment.CommentBody = recipeSixComment; | |
| insert fcomment; | |
| recipeSixComment = ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void recipeFiveAddPost() | |
| { | |
| FeedPost fpost = new FeedPost(); | |
| fpost.ParentId = UserInfo.getUserId(); | |
| fpost.Body = recipeFiveAddAFeedPost; | |
| insert fpost; | |
| ApexPages.addMessage(new ApexPages.Message( | |
| ApexPages.Severity.INFO, 'FeedPost ID is:'+fpost.id)); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public List<Recommendation> getRecipeEightTopPosters() | |
| { | |
| List<AggregateResult> results = [ | |
| SELECT ParentId pid, Parent.Name pname, COUNT(id) fcount | |
| FROM UserFeed | |
| WHERE Type='UserStatus' | |
| AND CreatedDate = THIS_WEEK | |
| GROUP BY Parent.Name, ParentId | |
| ORDER BY Count(id) DESC LIMIT 10]; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public with sharing class RESTController { | |
| public void processRequest(){ | |
| validateRequest(); | |
| if( HasError ) | |
| return; | |
| //Add support for other types of verbs here | |
| processGetQuery(); | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public with sharing class AccountTriggerHandler { | |
| private boolean m_isExecuting = false; | |
| private integer BatchSize = 0; | |
| public AccountTriggerHandler(boolean isExecuting, integer size){ | |
| m_isExecuting = isExecuting; | |
| BatchSize = size; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public with sharing class AccountTriggerHandler { | |
| private boolean m_isExecuting = false; | |
| private integer BatchSize = 0; | |
| public AccountTriggerHandler(boolean isExecuting, integer size){ | |
| m_isExecuting = isExecuting; | |
| BatchSize = size; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| trigger AccountTrigger on Account (after delete, after insert, after undelete, | |
| after update, before delete, before insert, before update) { | |
| AccountTriggerHandler handler = new AccountTriggerHandler(Trigger.isExecuting, Trigger.size); | |
| if(Trigger.isInsert && Trigger.isBefore){ | |
| handler.OnBeforeInsert(Trigger.new); | |
| } | |
| else if(Trigger.isInsert && Trigger.isAfter){ | |
| handler.OnAfterInsert(Trigger.new); | |
| AccountTriggerHandler.OnAfterInsertAsync(Trigger.newMap.keySet()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //http://www.force2b.net/index.php/2010/08/date-time-and-timezone-handling-in-apex/ | |
| /* ********************************************************************************************** | |
| * TimeConversions Class | |
| * Created by: Michael Smith/Force2b, 04/06/2010 | |
| * | |
| ************************************************************************************************ */ | |
| global class TimeConversions { | |
| /* ------------------------------------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ChatPostWrapper { | |
| Chat_Session__Feed post; | |
| public String postBody { get; set; } | |
| public String userHandle { get; set; } | |
| public String createdDate { get; set; } | |
| public Boolean newPost { get; set; } | |
| public Boolean systemMessage { get; private set; } | |
| public List<FeedComment> comments { get; set; } |
OlderNewer