• TheDeckblad
  • 9 Points
  • Member since 2013

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 2
  • 8

I've an Account field I want to be editable by a small group of people with various profiles on various layouts accross various record types.

I'd like this field to be on all Account layouts. But, not visible by default. Unless the user has a specific permission set.

How can I make a field Read Only and not visible to all unless the user has a certain permission set? I cannot make additional page layouts.

Thank you.

P.S. Why does Read Only imply Visible? That doesn't make sense.

I'm trying to approximate the following criteria:

"Return true if a custom field on the current user is checked and a custom field on the object has changed to a certain value."

If I use filter criteria, I don't see a way to reference the running user.

If I use formula criteria, I don't see a way to use ISCHANGED() functionality.

How can I best encapsulate this criteria using a process?

Need help counting the number of files atatched to a custom object.
Should I be looking at ContentDocumentLinks
if ( Trigger.isInsert || Trigger.isDelete ){
            Set<Id> FileCount = new Set<Id>();

            for(SObject cdl : Trigger.new){
                ContentDocumentLink cdls = ( ContentDocumentLink ) cdl;


            List<File_c> fileList = [SELECT Id, (SELECT Id FROM ContentDocumentLinks) 
            FROM File_c WHERE Id IN :FileCount];

            for(File_c fl : fileList){

                fl.Number_of_Files__c = fileList.size();


I have only been working in Visualforce for a week, so forgive me if this is a stupid question.

I have a 'Custom Object' called 'Request__c'. I also have a custom object called 'Time_Entry__c' that is managed through a Visualforce page and is functionally a child of 'Request__c' and is displayed on the 'Request__c' form in Salesforce. I have some code where I am trying to pass the object id of the 'Request__c' object to the Apex method so that its value is included when I create a new instance (row) of the 'Time_Entry__c' object. However, the code that I have developed is not working. Please see the relevent code below. I would appreciate any help that I can get. Thank you so much.


<apex:page standardController="Request__c" extensions="TrController">
    <!--Because we will be defining 'Input' fields, we must wrap our code in a 'Form' block. -->
    <apex:form >
        <apex:pageBlock title="CDCR - Salesforce Time Reporting for Requests">
            <apex:pageBlockButtons >
                <!-- The following Button is defined in a more complicated fashion so that a parameter can be passed. -->
                <apex:commandButton >
                    <a href="javascript: CurrRequest('{!Request__c.Id}');" >New</a>               
                <apex:commandButton value="Save" action="{!save}"/>


       <apex:actionFunction action="{!add}" name="CurrRequest" reRender="">
            <apex:param name="EntryID" value="" assignTo="{!ReqID}"/>


APEX Controller

public with sharing class TrController
    public List<Time_Entry__c> TimeEntries {get;set;}
    public string reqRslt {get;set;}
    public string showMessage {get;set;}
    //Used to get a hold of the entry record that is selected for deletion.
    public string SelectedEntryID {get;set;}
    public string ReqID {get;set;}
    public TrController(ApexPages.StandardController controller)


    private void LoadData()
        //Load the related time entry records from the database.
        //TimeEntries = [select id, Activity__c, Date_Worked__c, Hours_Worked__c, Minutes_Worked__c, Work_Description__c from Time_Entry__c WHERE name=:profileName order by ID DESC];

        TimeEntries = [select id, Activity__c, Date_Worked__c, Hours_Worked__c, Minutes_Worked__c, Work_Description__c, Related_Object__c from Time_Entry__c order by ID DESC];

    public void add()
        //The following line will obetain the request id (ReqId) that is passed from the VisualForce page
        string RequestID = ReqId;
        //Build the default values to the new time entry record.
        Time_Entry__c entry = new Time_Entry__c(Activity__c='Research', Date_Worked__c=System.today(), Hours_Worked__c=' 0', Minutes_Worked__c='00', Related_Object__c=RequestID);
        //Insert the new default time entry row into the Salesforce database.
        Insert entry;
        //Call the method to reload the Visualforce list.


I'm trying to approximate the following criteria:

"Return true if a custom field on the current user is checked and a custom field on the object has changed to a certain value."

If I use filter criteria, I don't see a way to reference the running user.

If I use formula criteria, I don't see a way to use ISCHANGED() functionality.

How can I best encapsulate this criteria using a process?



I need to come up with a piece of code that will allow me to determine if the case owner is a queue or a user, The first things that come to my mind is to run a query on the owner and try to store the result to a user obect. If it faile therefore the case owner is a queue. I don't think this is a slick solution bo any means, so I am hoping someone can provide with a better suggestion.


Thank you.

  • March 30, 2011
  • Like
  • 0

Hi, i m facing problem to send mass email to contacts in Dev Org but error is thrown

"NO_MASS_MAIL_PERMISSION, Single email is not enabled for your organization or profile. Single email must be enabled for you to use this feature"

  • September 13, 2010
  • Like
  • 0

For who's interested: we (not Salesforce.com!) created an improved version of the Excel Addin with the following improvements:


1. Enhanced login-screen: easier switching between environments (less typing)
2. Validation rules are applied by default (by using newer api version)
3. Fixed error on duplicate columns (required custom fields were downloaded twice)
4. Removed default query on 'systemModeDate > [last 7 days]' if no filter criteria were filled in
5. Increased standard batch size from 50 to 200, improving upload performance
6. Removed checks on maximum amount of lines
7. Improved dates handling (sometimes downloaded dates would not upload back into salesforce again)

(update 2012-12-04, 2 more fixes)

8. ability to upload numberic fields as null instead of always 0

9. corrected the bug to cope with error when uploading numbers with many decimals. These were put into scientific notation in Excel but not loaded properly to SF

(update 2013-05-03, 1 fix)

10. ability to query more than 32766 rows (was hitting the VBA limit on Integer size)


Our users are very happy with it. Feel free to try it out or further build on it and let me know what you think:



Disclaimer: Though we made and tested all enhancements with great care, we take no responsibility for the consequences of the use of this tool. Also note that this is an open source tool and not maintained nor supported by Salesforce.com.




What is the soql statement used to generate the account hierarchy view?  For example, I'd like to run a soql statement that traverses forward and backward to return a resultset of the entire account hierarchy for the account...i.e the child accounts and the parent acount and potentially, the parent of the parent, etc., because the hierarchy can be 3 or 4 levels deep.


How would I construct a soql statement to return the entire account hierarchy view?



I am trying to implement my own email-to-case class and I have the following code, which is working in my sandbox, to create an EmailMessage on a case using email services:
EmailMessage[] newEmail = new EmailMessage[0];
newEmail.add(new EmailMessage(FromAddress = email.fromAddress,
FromName = email.fromName,
ToAddress = email.toAddresses[0],
Subject = email.subject,
TextBody = email.plainTextBody,
HtmlBody = email.htmlBody,
ParentId = newCase[0].Id, 
ActivityId = newTask[0].Id));   // (newCase and newTask are the newly created case and task from earlier code)
insert newEmail;
I have several questions.  Is it possible to set the email message status to "New"?  If I attempt to add "Status = 'New'" in the .add() method I get an error: Message: Insert failed. First exception on row 0; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, Status: bad value for restricted picklist field: New: [Status] null.  If I don't attempt to set the status, it defaults to "Sent".
Also, does anyone have any sample code to share that adds headers and attachments from an inbound email to an Email Message object?  I'm struggling with that one.
Another minor issue that is bugging me is that in the Email Section of the Case page in my sandbox, the column labelled "Email Address" shows the 'to address' and my production version using the the standard SFDC email to case application will have the 'from address' (contact's address) displayed.  Does anyone know what field in the Email Message object this data comes from?
Thanks for the help!
After turing on Duplicate Rules existing Process Builder flows are now failing.  The error: UPSERT --- UPSERT FAILED --- ERRORS : (DUPLICATES_DETECTED) You're creating a duplicate record. We recommend you use an existing record instead. --- for SFDC record with ID : null,

These are the steps:

1) User edits a record and changes the account name.
2) User saves the the changes and the Duplicate Rule runs and prompts user to Save Anyway or Cancel.
3) User selects Save Anyway.
4) Process Builder Flow Runs and fails because of the duplicate rule that the user has already made a selection.

The field being updated by the Process is a custom field that is not part of any Duplicate Rule.