5

You have to enable Create Audit Fields permissions from the SF UI to set createdById and CreatedDate Set Audit Fields upon Record Creation - Allow the user to set audit fields (like "Created By" or "Last Modified By") when you create a record via API importing tools like Data Loader. Src: https://help.salesforce.com/articleView?id=000213290&type=...


4

You can't just update related records in this way. You need to actually call update on a record. You can't access parent fields in a trigger context, but in this case you do not even need a query because you just need the ParentId. Map<Id, Case> cases = new Map<Id, Case>(); for (CaseComment record : trigger.new) if (record.ParentId != null) ...


3

CaseComment is the classic "Case Comment" object, not related to feed items at all. You're looking for FeedComment, which contains comments on feed items.


3

Case comment character limit is 4000 and if that is encrypted then character limit will be 2959 characters. If you need more characters then create a separate object, link to Case object and create long text area according to your desire limit.


3

Case Comments are affected by several settings. For internal users, only the case's sharing is considered. If the user can see the case, they can see all of the case comments, published or not. For portal users, they can only see the case comments if Published is true, and they are either contact on the case or a super-user for the account the case is ...


3

You should be using {!Case.Thread_Id} in your email templates. The formula in the link you provided was not provided by salesforce.com, but just a random customer that felt they wanted to demonstrate how their formula was (which is incorrect). It's been revealed that the fifth character of an ID is actually part of the pod Id, which was only recently ...


3

So the first step is writing one test each that will confirm the validation and successful save paths: static testmethod void testValidation() { // set up closed case // set up comment in memory but do not insert DmlException expectedException; Test.startTest(); try { /*insert comment*/ } catch (DmlException d) { ...


3

You can do something like the following: SELECT Id, CommentBody, CreatedDate, ParentId, Parent.AccountId FROM CaseComment Where Parent.AccountId would give you the AccountId from the Case.


2

Yes, you can write a trigger to set this field. Note from the documentation on CaseComment that the field you are looking to update has an API Name of IsPublished. Note also from the Apex Developer Guide on Triggers: There are two types of triggers: Before triggers are used to update or validate record values before they’re saved to the database. ...


2

Permissions do not carry over to cases like you would think. There is an existing idea around this here: https://success.salesforce.com/ideaView?id=08730000000BpYo Currently, administrators can assign granular permissions to cases -- read, create, edit and delete. These permissions do not, however, carry over to case comments. A user with read-only ...


2

The CreatedById field only supports User values. You cannot specify a Contact value under any circumstances. Note that you can only set CreatedById if you first Enable Create Audit Fields.


2

There are two common patterns to minimize recursion: Static flags (covered in the already written answer) Proper filtering (including changes to the filtered fields) My recommendation here is that you filter so that you only act on records whose Last_email__c has changed. List<Case> filtered = new List<Case>(); for (Case newRecord : newRecords)...


1

Your screenshot looks like Chatter posts, not CaseComments. To post a rich-text Chatter post, you need to use the Chatter API's rich-text comment function. The CommentBody field on CaseComment is a text area, not rich text, so you can't insert HTML into it.


1

You want to use the Email to Case feature. Salesforce has good instructions on setting up Email to Case, so I'm not going to repeat them here. The basic gist of it is that your agents will be sending emails from support@yourcompany.com which should be configured to point to your specific email to case email address in Salesforce. If the email contains a ...


1

CaseComment doesn't have separate permissions. To delete Case Comments by other, user has to have Modify All permission on Case object. For more information, refer Creating and Editing Case Comments on Case Detail Pages


1

You can call an API like this to get related stuff. https://ap2.salesforce.com/services/data/v34.0/sobjects/Case/5002800000oGq8CAAS/CaseComments


1

Update can fire multiple times during a transaction and you are most likely running into this as an issue. Aside from the "You should implement a Trigger Handler Framework" answer you can add a static property to limit the recursion in your current code: Trigger trigger ForARPU on case (after insert,after update,after delete,before insert,before update) {...


1

Case Comments are part of the case so the visibility will be based on the Case permissions. The IsPublished field (label as Public) on screen means that community and portal users are not able to view it if the IsPublished is not set. You can remove the Related List from the Case Page layout so if you wanted a specific user profile not to view them then you ...


1

You can't embed the script in the page, because it won't have access to the parent page (it's an iframe). However, you can use apex:detail, and just override the entire page: <apex:page standardController="Case"> <script type="text/javascript"> var sty = document.createElement('style'); sty.innerHTML = "table.list{width:...


1

This is just because its not supported, you can find reference here The following are examples of supported SOQL statements. Custom object SELECT Id, MyCustomField__c FROM MyCustomObject__c Standard objects (may include custom fields) Account SELECT Id, Name FROM Account WHERE NumberOfEmployees > 1000 Campaign SELECT Id, Name ...


1

The public actually refers to making it available to the case contact(customer) on a Customer Portal/Self-Service Portal. Internally, if a user can see the case, they can see the case comments.


1

However, you can create a visualforce case detail page and then customize the case comment section according to your business requirement. Below is the VF component for the New Case Comment: <apex:componentBody > <apex:form > <apex:pageBlock title="Case Comments" > <apex:pageBlockButtons location="top"> ...


Only top voted, non community-wiki answers of a minimum length are eligible