• Anonymouse
  • NEWBIE
  • 140 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 32
    Questions
  • 31
    Replies
Hello,

I currently have a process builder send out an email alert before a task is due. How may I set the condition for the criteria to filter out the email alert to only send it out if the last modified date is greater than or equal to 2 weeks before the due date? Do I use a formula? If so, which formula may I use?

Any help would be greatly appreciated.
 
[Task].LastModifiedDate + 14

Criteria name = email user of upcoming task. Criteria for executing actions = conditions are met. Set conditions are this: field = [Task].customDateField; operator = greater than or equal; type = formula; value = [Task].LastModifiedDate + 14; conditions = all of the conditions are met (AND).

Sincerely,
Anon
Hello,

I currently have a process builder send out an email alert before a task is due. How may I set the condition for the criteria to filter out the email alert to only send it out if the last modified date is greater than or equal to 2 weeks before the due date? Do I use a formula? If so, which formula may I use?

Any help would be greatly appreciated.
 
[Task].LastModifiedDate + 14

Criteria name = email user of upcoming task. Criteria for executing actions = conditions are met. Set conditions are this: field = [Task].customDateField; operator = greater than or equal; type = formula; value = [Task].LastModifiedDate + 14; conditions = all of the conditions are met (AND).


Sincerely,
Anon
Hello,

I currently have a process builder send out an email alert before a task is due. How may I set the condition for the criteria to filter out the email alert to only send it out if the last modified date is greater than or equal to 2 weeks before the due date? Do I use a formula? If so, which formula may I use?

Any help would be greatly appreciated.
 
[Task].LastModifiedDate + 14

User-added image

Sincerely,
Anon
Hello,

I am currently working on a process builder. I have a formula field that is the concatenation of two fields. One of the fields is a Name Id (WhoId). How may I get the Name to show up as a name instead of as an Id?
[Task].Subject + " - " + [Task].WhoId
Any help would be greatly appreciated.

Sincerely,
Anon
Hello,

I currently have a Process Builder picklist field (example: customField__c) that needs to accept a concatination of two other fields: a picklist field (example: picklist__c) and a Name Id (example: WhoId).

customField__c = picklist__c + " - " + WhoId

Currently, the customField__c looks like it accepts the picklist__c field as desired, but the WhoId looks like an ID instead of the Name. How may I convert the Name to appear as some thing like "John Doe" instead of an ID value? I tried TEXT(), but it gives an error:

"The formula expression is invalid: Incorrect parameter type for function 'TEXT()'. Expected Number, Date, DateTime, Picklist, received Text"

Any help would be greatly appreciated.

Sincerely,
Anon
Hello,

I have two fields (example: fieldOne__c and fieldTwo__c). If both fields are filled out, I want an error to pop up. How may I do this? Any help would be greatly appreciated.

Sincerely,
Anon
Hello,

On an Opportunity, we have the ability to create an Event. With the Event, we would like one of the Contact name Fields to inherit the Primary Contact from the Opportunity.

How may we accomplish this with the Process Builder? Any help would be greatly appreciated.

Sincerely,
Anon
Hello,

I currently have a process builder that creates an Event everytime a Task is created. How may I import read-only fields to the Event from the Task? For instance, how may one import a read-only "email" field? I currently am unable to even select the "email" field from the dropdown. Any help would be greatly appreciated.

Sincerely,
Anon
Hello,

When creating a Task, I would like for Process Builder to automatically create an Event. Is this possible? How may I go about doing this? I would also like for some of the fields from the Task to be copied over to the Event.

If this is not possible with Process Builder, how may I go about doing this? Any help would be greatly appreciated.

Sincerely,
Anon
Hello,

How may I find out the file name of a file being uploaded in the following embedded code? Where may I add this? Do I create an Apex class?
<apex:page standardController="CustomObject__c"
           extensions="box.DisplayWidget"
           showheader="false"
           sidebar="false"
           action="{!GetLoginToken}">
<apex:stylesheet value="{!URLFOR($Resource.box__BoxEmbed, 'BoxEmbed/style.css')}"/>
<apex:iframe src="/apex/box__BOXSection?id={!CustomObject__c.Id}&param=CustomObject_Box_Section"
             rendered="{!DisplayBoxSection}"/>
<apex:iframe src="{!folderShareLink}"
             rendered="{!DisplayBoxWidget}"
             width="100%"
             height="100%"
             frameborder="0"
             scrolling="NO"/>
</apex:page>
Sincerely,
Anon
Hello,

How may one create a VisualForce page that has a button for a user to upload a file from their local computer to an external cloud site (such as Box)?

What steps need to be taken? Any help would be greatly appreciated.

Sincerely,
Anon
Hello,

How may one call an invocable method with the Professional Edition of Salesforce? What are some options? Process Builder does not show the invocable method.

Sincerely,
Anon
Hello,

I currently have a custom object (example: customObject__c). This object is related to another custom object (example: customObject2__c). I would like to have my custom object have a new field lookup to a picklist field from the second custom object.

I was thinking about approaching this as a formula field and then have it return text. I'm not sure if I'm going about this the wrong way.

This is what I have so far:
TEXT(customObject2__r.customfield__c)
How may I approach this? Should I be doing this a different way? What are my options?

Sincerely,
Jackie
Hello,

Is there a way to let a standard Salesforce user have permission to edit queues?

Sincerely,
Jackie
Hello,

I have a custom object with custom fields. One of the fields is a lookup field to another object. I would like to prevent the deletion of a record of my custom object if the lookup field is not null. How may I go about doing this? A validation rule?

Any help would be greatly appreciated.

Sincerely,
Jackie
Hello,

I am currently making Visualforce pages for custom objects. I've created several by just replacing the API Name for each. One of the custom objects is giving me an error in Visualforce by saying that the custom object does not exist. 

The particular custom object is part of a managed package; however, I've already created other Visualforce pages with other objects from that same package without any issues.

Just to clarify, I am using the API Name of the custom object (example: customObject__c).

Any help would be greatly appreciated.

Sincerely,
Jackie
Hello,

I'm having trouble accessing certain sections on a page layout. (For example, when trying to create an Account, I am unable to see the bottom section that I just added to the Account page layout.) What kinds of permissions may I look at to determine where I need to perhaps add my sandbox admin user account?

Any help would be greatly appreciated.

Sincerely,
Jackie
Hello,

I'm currently getting the following error when I try to test: "System.QueryException: unexpected token: <EOF>".

Class:
global class LeadProcessor implements Database.Batchable<sObject>, Database.Stateful {

    // Use a QueryLocator in the start method to collect all 
    // Lead records in the org
    global Database.QueryLocator start(Database.BatchableContext bc) {
        return Database.getQueryLocator(
        	'SELECT Id, LeadSource' +
            'FROM Lead' //+
//            'WHERE LeadSource = null'
        );
    }
    
    // Execute method must update all Lead records in the org 
    // with the LeadSource value of 'Dreamforce'
    global void execute(Database.BatchableContext bc, List<Lead> leadList) {
        
        // Process each batch of records
        List<Lead> newLeadList = new List<Lead>();
        
        // Check if the list is empty
        if (!leadList.isEmpty()) {
            
            // Add new LeadSource to each Lead
            for (Lead currentLead : leadList) {
            currentLead.LeadSource = 'Dreamforce';
            
            // Add Lead to list to be updated
            newLeadList.add(currentLead);
        	}
        
        	// Update Leads
        	update newLeadList;
        }
        
    }
    
    // Finish method
    global void finish(Database.BatchableContext bc){
        // Do nothing...
    }
}

Test Class:
@isTest 
private class LeadProcessorTest {
	
    @testSetup
    static void setup() {
    
        // Create Lead list
        List<Lead> leads = new List<Lead>();
        
        // Insert 200 leads
        for (Integer i = 0; i < 10; i++) {
            
 			// Lead.Name is polymorphic; it's made up of FirstName,
 			// MiddleName, LastName, and Salutation; use LastName
            leads.add(new Lead(LastName = 'Smith' + i,
                               Company = 'Smith Hardware' + i));
        }
        
        insert leads;
    }
    
    static testmethod void test() {
        Test.startTest();
        	LeadProcessor lpt = new LeadProcessor();
       		Id batchId = Database.executeBatch(lpt);
        Test.stopTest();
        
        // After the testing stops, assert records were 
        // updated properly
        System.assertEquals(10, [SELECT count() 
                                  FROM Lead 
                                  WHERE LeadSource = 'Dreamforce']);
    }
}

May you please assist?

Sincerely,
Jackie
Hello,
I'm currently implementing a box.com (similar to dropbox or google drive) file upload setup with Salesforce. Fortunately, there's an app on AppExchange and some instructions on how to implement it in Salesforce.

The client says they want it on each object and custom object page layout. 

The box.com instructions have the following code (I replaced the generic object name with "Task" for this case):

The visualforce page name is: Task_Box_Section.vfp
<apex:page standardController="Task"
           extensions="box.DisplayWidget"
           showheader="false"
           sidebar="false"
           action="{!GetLoginToken}">
    
<apex:stylesheet value="{!URLFOR($Resource.box__BoxEmbed, 'BoxEmbed/style.css')}"/>
<apex:iframe src="/apex/box__BOXSection?id={!Task.Id}&param=Task_Box_Section"
             rendered="{!DisplayBoxSection}"/>
<apex:iframe src="{!folderShareLink}"
             rendered="{!DisplayBoxWidget}"
             width="100%"
             height="100%"
             frameborder="0"
             scrolling="NO"/>

</apex:page>
Do you see anything that I'm doing wrong ? It's supposed to show up a file upload section, but nothing shows up and there's an error instead.

"Argument cannot be null. An unexpected error has occurred. Your solution provider has been notified. (box)"

May you please assist?

Sincerely,
Jackie

Hello,

I'm currently implementing a box.com (similar to dropbox or google drive) file upload setup with Salesforce. Fortunately, there's an app on AppExchange and some instructions on how to implement it in Salesforce.

The client says they want it on each object and custom object page layout. 

The box.com instructions have the following code (I replaced the generic object name with "Task" for this case):

The visualforce page name is: Task_Box_Section.vfp


<apex:page standardController="Task"
           extensions="box.DisplayWidget"
           showheader="false"
           sidebar="false"
           action="{!GetLoginToken}">
    
<apex:stylesheet value="{!URLFOR($Resource.box__BoxEmbed, 'BoxEmbed/style.css')}"/>
<apex:iframe src="/apex/box__BOXSection?id={!Task.Id}&param=Task_Box_Section"
             rendered="{!DisplayBoxSection}"/>
<apex:iframe src="{!folderShareLink}"
             rendered="{!DisplayBoxWidget}"
             width="100%"
             height="100%"
             frameborder="0"
             scrolling="NO"/>

</apex:page>


Do you see anything that I'm doing wrong ? It's supposed to show up a file upload section, but nothing shows up and there's an error instead.

"Argument cannot be null. An unexpected error has occurred. Your solution provider has been notified. (box)"

May you please assist?

Sincerely,
Jackie

Hello,

I currently have a process builder send out an email alert before a task is due. How may I set the condition for the criteria to filter out the email alert to only send it out if the last modified date is greater than or equal to 2 weeks before the due date? Do I use a formula? If so, which formula may I use?

Any help would be greatly appreciated.
 
[Task].LastModifiedDate + 14

Criteria name = email user of upcoming task. Criteria for executing actions = conditions are met. Set conditions are this: field = [Task].customDateField; operator = greater than or equal; type = formula; value = [Task].LastModifiedDate + 14; conditions = all of the conditions are met (AND).

Sincerely,
Anon
Hello,

I have two fields (example: fieldOne__c and fieldTwo__c). If both fields are filled out, I want an error to pop up. How may I do this? Any help would be greatly appreciated.

Sincerely,
Anon
Hello,

When creating a Task, I would like for Process Builder to automatically create an Event. Is this possible? How may I go about doing this? I would also like for some of the fields from the Task to be copied over to the Event.

If this is not possible with Process Builder, how may I go about doing this? Any help would be greatly appreciated.

Sincerely,
Anon
Hello,

Is there a way to let a standard Salesforce user have permission to edit queues?

Sincerely,
Jackie
Hello,

I have a custom object with custom fields. One of the fields is a lookup field to another object. I would like to prevent the deletion of a record of my custom object if the lookup field is not null. How may I go about doing this? A validation rule?

Any help would be greatly appreciated.

Sincerely,
Jackie
Hello,

I am currently making Visualforce pages for custom objects. I've created several by just replacing the API Name for each. One of the custom objects is giving me an error in Visualforce by saying that the custom object does not exist. 

The particular custom object is part of a managed package; however, I've already created other Visualforce pages with other objects from that same package without any issues.

Just to clarify, I am using the API Name of the custom object (example: customObject__c).

Any help would be greatly appreciated.

Sincerely,
Jackie
Hello,

I'm currently getting the following error when I try to test: "System.QueryException: unexpected token: <EOF>".

Class:
global class LeadProcessor implements Database.Batchable<sObject>, Database.Stateful {

    // Use a QueryLocator in the start method to collect all 
    // Lead records in the org
    global Database.QueryLocator start(Database.BatchableContext bc) {
        return Database.getQueryLocator(
        	'SELECT Id, LeadSource' +
            'FROM Lead' //+
//            'WHERE LeadSource = null'
        );
    }
    
    // Execute method must update all Lead records in the org 
    // with the LeadSource value of 'Dreamforce'
    global void execute(Database.BatchableContext bc, List<Lead> leadList) {
        
        // Process each batch of records
        List<Lead> newLeadList = new List<Lead>();
        
        // Check if the list is empty
        if (!leadList.isEmpty()) {
            
            // Add new LeadSource to each Lead
            for (Lead currentLead : leadList) {
            currentLead.LeadSource = 'Dreamforce';
            
            // Add Lead to list to be updated
            newLeadList.add(currentLead);
        	}
        
        	// Update Leads
        	update newLeadList;
        }
        
    }
    
    // Finish method
    global void finish(Database.BatchableContext bc){
        // Do nothing...
    }
}

Test Class:
@isTest 
private class LeadProcessorTest {
	
    @testSetup
    static void setup() {
    
        // Create Lead list
        List<Lead> leads = new List<Lead>();
        
        // Insert 200 leads
        for (Integer i = 0; i < 10; i++) {
            
 			// Lead.Name is polymorphic; it's made up of FirstName,
 			// MiddleName, LastName, and Salutation; use LastName
            leads.add(new Lead(LastName = 'Smith' + i,
                               Company = 'Smith Hardware' + i));
        }
        
        insert leads;
    }
    
    static testmethod void test() {
        Test.startTest();
        	LeadProcessor lpt = new LeadProcessor();
       		Id batchId = Database.executeBatch(lpt);
        Test.stopTest();
        
        // After the testing stops, assert records were 
        // updated properly
        System.assertEquals(10, [SELECT count() 
                                  FROM Lead 
                                  WHERE LeadSource = 'Dreamforce']);
    }
}

May you please assist?

Sincerely,
Jackie
Hello,
I'm currently implementing a box.com (similar to dropbox or google drive) file upload setup with Salesforce. Fortunately, there's an app on AppExchange and some instructions on how to implement it in Salesforce.

The client says they want it on each object and custom object page layout. 

The box.com instructions have the following code (I replaced the generic object name with "Task" for this case):

The visualforce page name is: Task_Box_Section.vfp
<apex:page standardController="Task"
           extensions="box.DisplayWidget"
           showheader="false"
           sidebar="false"
           action="{!GetLoginToken}">
    
<apex:stylesheet value="{!URLFOR($Resource.box__BoxEmbed, 'BoxEmbed/style.css')}"/>
<apex:iframe src="/apex/box__BOXSection?id={!Task.Id}&param=Task_Box_Section"
             rendered="{!DisplayBoxSection}"/>
<apex:iframe src="{!folderShareLink}"
             rendered="{!DisplayBoxWidget}"
             width="100%"
             height="100%"
             frameborder="0"
             scrolling="NO"/>

</apex:page>
Do you see anything that I'm doing wrong ? It's supposed to show up a file upload section, but nothing shows up and there's an error instead.

"Argument cannot be null. An unexpected error has occurred. Your solution provider has been notified. (box)"

May you please assist?

Sincerely,
Jackie
Hello,

I currently have a custom picklist field with several choices. In case a user tries to edit the object, I want to make sure that the choices they may change the picklist to is limited to only a couple choices depending on what the value was originally. 

I want an error to pop up in case something else was picked before trying to edit the record to "End". For instance, the only acceptable choices before changing to "End" would be either "Beginning" or "Middle." 

For instance, if the original value was "Never Started," then I want an error to popup.

This is what I have currently for a validation rule:
 
AND( ISPICKVAL( customField__c, 'End') , 
OR( ISPICKVAL( customField__c , 'Beginning'), 
ISPICKVAL( customField__c , 'Middle')
) 
)

Any help would be greatly appreciated.

Sincerely,
Jackie
Hello,

How may I validate 2 custom date fields to make sure that both are of the current or future year?

This is what I have so far:
 
AND(OR (YEAR(customField1__c) < YEAR(Today()),
YEAR( customField2__c) < YEAR(Today())), true, false)

Any help would be greatly appreciated.

Sincerely,
Jackie​
Hello,

I'm currently working on a Trailhead Challenge called: Create an Apex class that uses the @future annotation to update Account records.

I do not have any errors; however, how may I make my test class more efficient with bulkifying? I wish to create anywhere from 1-200 accounts/contacts for these tests. This is my current code:

 
@isTest
private class AccountProcessorTest {
	
    @isTest
    private static void testSingleAccountProcessor() {
        
        double numOfAcctsCreated = 0;
        
        // Create Account(s)
        Account acct = new Account(Name = 'Smith Hardward Account');
        insert acct; // This is not part of test
        
        // Create and insert Contact with Account ID
        Contact cont = new Contact(LastName = 'Smith',
                                   AccountId = acct.Id);
        insert cont;
        
        // Create List of Ids to keep track of Account Ids
        List<Id> listOfAcctIds = new List<Id>();
        
        // Add Account Id from Account just created into List
        listOfAcctIds.add(acct.Id);
        
        // Increment count on Account(s) created
        numOfAcctsCreated += 1;
        
        // Test
        Test.startTest();
        	AccountProcessor.countContacts(listOfAcctIds);
        Test.stopTest();
        
        // Verify results
        Account queryResults = [SELECT Number_of_Contacts__c
                                FROM Account
                                WHERE id =: acct.Id];
        
        
        System.assert(queryResults.Number_of_Contacts__c == numOfAcctsCreated,
                     'Error! Number of Contacts for Account failed. ' +
                     'queryResults.Number_of_Contacts__c = ' + 
                     queryResults.Number_of_Contacts__c + ' and ' +
                     'numOfAcctsCreated = ' + numOfAcctsCreated);
    }
    
    @isTest
    private static void testMultipleAccountProcessors() {
        
        double numOfAcctsCreated = 0;
        
        // Create Account(s)
        Account acct1 = new Account(Name = 'Smith Hardward Account1');
        insert acct1; // This is not part of test
        
        Account acct2 = new Account(Name = 'Smith Hardward Account2');
        insert acct2; // This is not part of test
        
        Account acct3 = new Account(Name = 'Smith Hardward Account3');
        insert acct3; // This is not part of test
        
        // Create and insert Contact with Account ID
        Contact cont1 = new Contact(LastName = 'Smith1',
                                   AccountId = acct1.Id);
        insert cont1;
        
        Contact cont2 = new Contact(LastName = 'Smith2',
                                   AccountId = acct2.Id);
        insert cont2;
        
        Contact cont3 = new Contact(LastName = 'Smith3',
                                   AccountId = acct3.Id);
        insert cont3;
        
        // Create List of Ids to keep track of Account Ids
        List<Id> listOfAcctIds = new List<Id>();
        
        // Add Account Id from Account just created into List
        listOfAcctIds.add(acct1.Id);
        listOfAcctIds.add(acct2.Id);
        listOfAcctIds.add(acct3.Id);
        
        // Increment count on Account(s) created
        numOfAcctsCreated = listOfAcctIds.size();
        
        // Test
        Test.startTest();
        	AccountProcessor.countContacts(listOfAcctIds);
        Test.stopTest();
        
        // Verify results
        Account queryResults1 = [SELECT Number_of_Contacts__c
                                FROM Account
                                WHERE id =: acct1.Id];
        
        Account queryResults2 = [SELECT Number_of_Contacts__c
                                FROM Account
                                WHERE id =: acct2.Id];
        
        Account queryResults3 = [SELECT Number_of_Contacts__c
                                FROM Account
                                WHERE id =: acct3.Id];
        
        Decimal counter =  	queryResults1.Number_of_Contacts__c + 
            				queryResults2.Number_of_Contacts__c +
            				queryResults3.Number_of_Contacts__c;
        
        System.assert(counter == numOfAcctsCreated,
                     'Error! Number of Contacts for Account failed. ' +
                     'counter = ' + counter + ' and ' +
                     'numOfAcctsCreated = ' + numOfAcctsCreated);
    }
}
Any help would be greatly appreciated.

Sincerely,
Jackie

Hello,

I currently have an Event Trigger and the code coverage is only 80%. I need to assign the WhatID for an event. How may I do this with a test class? This is what I have so far:

...
Event someEvent = new Event(Subject = 'Test', 
                              ActivityDate = date.today(), 
                              StartDateTime = System.Now(),
                              EndDateTime = System.Now() + 5,
                              whatId = ???);
...
Do I need to get the whatID from a User, Account, Contact, or something else? Any help is greatly appreciated!

Sincerely,
Jackie
Hello,

How may I use Process Builder to use a custom Event Field to have the "Record Type" of a related Opportunity? What kind of field(s) do I need to create? For instance, do I create any Lookup fields? If so, are they custom Activity Fields? If this is the case, what are these fields related to? Or, are they formula fields? How may I go about doing this? Any help would be greatly appreciated.

Sincerely,
Jackie