• Stephanie Boggs 17
  • NEWBIE
  • 30 Points
  • Member since 2016
  • Sales Operations Analyst
  • Montage


  • Chatter
    Feed
  • 0
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 6
    Replies
Hello,

This is currently an OnClick JS button that I have. Can this be converted into a Lightning Component?

location.replace('/email/author/emailauthor.jsp?retURL=/{!Demo__c.Id}&template_id=00XF0000001UAxV&p3_lkid={!Demo__c.Id}&p24={!Demo__c.BR_Email__c}');
Hello! Thank you in advance for your assistance! I have been working on this for over 24 total changing the Controller and Component in small ways here and there to test and re-test, and I think I am going in circles at this point.

We have 8 custom Javascript buttons for our Cases - one per department. What these buttons do is allow the user to own the case with one click. It enters their name into a custom user lookup "owner" field for that department, updates their name to the standard Owner field, and updates the Status to Assigned. 

The current, working, custom JS button is:
{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")} 
var caseObj = new sforce.SObject("Case"); 
caseObj.Id = '{!Case.Id}'; 

caseObj.CST_Owner__c = '{!$User.Id}'; 
caseObj.OwnerId = '{!$User.Id}'; 
caseObj.Status = "Assigned"; 

var result = sforce.connection.update([caseObj]); 
window.location.href=window.location.href;

My Case Buttons Component is currently - this shows on the page and allows for button clicks and will sometimes throw an error and sometimes not but makes no changes:
<aura:component implements="flexipage:availableForAllPageTypes" access="global">
    <aura:attribute name="CaseObj" type="Case" />
        <lightning:button label="Own CST" onclick="{! c.owncst}"/>
</aura:component>

My Controller is currently:
({
owncst : function(component, event, helper) {
    var btnClicked = event.getSource();
    var CaseObj = component.get('v.CaseObj',true)
    component.set('v.CaseObj.Description', "true");
}})
I am thinking that Apex is my only hope for this, but if this can be done without let me know!

I have a formula field on the Lead that pulls the email domain (i.e. gmail.com) (Email_Domain__c) from the email field. I have a field on the Account that contains the primary email domain via a text field (Primary_Email_Domain__c).

When a Lead is created, I want to compare the Lead's Email Domain to all Primary Email Domain Account field values to find a match and then assign the Lead to the Account Owner for conversion.

Please and Thanks!! 
I have a trigger where if the Approval Process is Rejected and the Comments are blank the following page displays. My issue is that I would like to customize the error page so that the actual error is more prominent for the users. Is this possible?

Everything I see is related to error messages from VF pages.

trigger RequireRejectionComment on Contact (before update) 
{

  Map<Id, Contact> rejectedStatements 
             = new Map<Id, Contact>{};

  for(Contact inv: trigger.new)
  {
    /* 
      Get the old object record, and check if the approval status 
      field has been updated to rejected. If so, put it in a map 
      so we only have to use 1 SOQL query to do all checks.
    */
    Contact oldInv = System.Trigger.oldMap.get(inv.Id);

    if (oldInv.SAL_Approval_Status__c != 'Rejected' 
     && inv.SAL_Approval_Status__c == 'Rejected')
    { 
      rejectedStatements.put(inv.Id, inv);  
    }
  }
   
  if (!rejectedStatements.isEmpty())  
  {
    // UPDATE 2/1/2014: Get the most recent approval process instance for the object.
    // If there are some approvals to be reviewed for approval, then
    // get the most recent process instance for each object.
    List<Id> processInstanceIds = new List<Id>{};
    
    for (Contact invs : [SELECT (SELECT ID
                                              FROM ProcessInstances
                                              ORDER BY CreatedDate DESC
                                              LIMIT 1)
                                      FROM Contact
                                      WHERE ID IN :rejectedStatements.keySet()])
    {
        processInstanceIds.add(invs.ProcessInstances[0].Id);
    }
      
    // Now that we have the most recent process instances, we can check
    // the most recent process steps for comments.  
    for (ProcessInstance pi : [SELECT TargetObjectId,
                                   (SELECT Id, StepStatus, Comments 
                                    FROM Steps
                                    ORDER BY CreatedDate DESC
                                    LIMIT 1 )
                               FROM ProcessInstance
                               WHERE Id IN :processInstanceIds
                               ORDER BY CreatedDate DESC])   
    {                   
      if ((pi.Steps[0].Comments == null || 
           pi.Steps[0].Comments.trim().length() == 0))
      {
        rejectedStatements.get(pi.TargetObjectId).addError(
          'Please provide a rejection reason in the Comments field. Click the back arrow on your browser to go back to the Approve/Reject page.');

      }
    }  
  }
}

User-added image
Hello,

I installed the Unmanaged Action Plans App (https://appexchange.salesforce.com/listingDetail?listingId=a0N30000003HcINEA0&tab=r) in sandbox, and we use a custom Activity Type field to allow more functionality that the standard one. 

Can someone assist me in editing the existing triggers/classes or creating a new trigger/class so that the Activity Types match and reference each other between the 4 Action Plan objects? I am not very knowledgeable in writing apex, however, I did search the classes to find where "Type" was used and updated them to Activity_Type__c and only one custom value is populating, but the others are not. What could I be missing?

Let me know if I can clarify further, and thank you in advance!
Stephanie
Hello,

I want to ensure that I am reviewing this accurately. https://help.salesforce.com/articleView?id=Hyperlink-Formula-Fields-for-JavaScript-Disablement&language=en_US&type=1

Is there a way to report on all the formula fields and what the formulas are so that I can search to see if my org is affected by this change?

I don't believe that we will be affected, but I want to do my due diligence, so any help in how I should go about this would be greatly appreciated!

Thanks!
Stephanie
Hello,

I installed the Unmanaged Action Plans App (https://appexchange.salesforce.com/listingDetail?listingId=a0N30000003HcINEA0&tab=r) in sandbox, and we use a custom Activity Status value of "Cancelled". 

Can someone assist me in editing the existing triggers or creating a new trigger so that the Status' match and reference each other between the 4 Action Plan objects? I am not very knowledgeable in writing apex.

It would also be ideal that all other dependent tasks and/or all other tasks for that action plan are able to be canceled without being deleted in one click. 

i.e. We might have an action plan to call, email, etc and if we get a not interested response we won't want to continue reaching out and want to keep the call task as complete but have the others be marked canceled.

Let me know if I can clarify further, and thank you in advance!
Stephanie
Hello,

I am following the instructions at https://developer.salesforce.com/page/Using_Data_Loader_from_the_command_line and am getting the following error.

c:\Program Files (x86)\salesforce.com\Data Loader\bin>process.bat "C:\Program Files (x86)\salesforce.com\Data Loader\bin\conf" csvAccountExtractProcess
2016-12-27 21:05:15,487 INFO  [main] controller.Controller initLog (Controller.java:396) - Using built-in logging configuration, no log-conf.xml in c:\Program Files (x86)\salesforce.com\Data Loader\bin\log-conf.xml
2016-12-27 21:05:15,495 INFO  [main] controller.Controller initLog (Controller.java:398) - The log has been initialized
2016-12-27 21:05:15,498 INFO  [main] process.ProcessConfig getBeanFactory (ProcessConfig.java:104) - Loading process configuration from config file: C:\Program Files (x86)\salesforce.com\Data Loader\bin\conf\process-conf.xml
2016-12-27 21:05:15,564 INFO  [main] support.AbstractApplicationContext prepareRefresh (AbstractApplicationContext.java:495) - Refreshing org.springframework.context.support.FileSystemXmlApplicationContext@53e25b76: startup date [Tue Dec 27 21:05:15 CST 2016]; root of context hierarchy
2016-12-27 21:05:15,603 INFO  [main] xml.XmlBeanDefinitionReader loadBeanDefinitions (XmlBeanDefinitionReader.java:315) - Loading XML bean definitions from file [C:\Program Files (x86)\salesforce.com\Data Loader\bin\conf\process-conf.xml]
2016-12-27 21:05:15,664 INFO  [main] support.DefaultListableBeanFactory preInstantiateSingletons (DefaultListableBeanFactory.java:557) - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1936f0f5: defining beans [csvAccountExtractProcess]; root of factory hierarchy
2016-12-27 21:05:15,700 INFO  [csvAccountExtract] controller.Controller initConfig (Controller.java:334) - config dir created at C:\Program Files (x86)\salesforce.com\Data Loader\bin\conf
2016-12-27 21:05:15,711 INFO  [csvAccountExtract] controller.Controller initConfig (Controller.java:362) - The controller config has been initialized
2016-12-27 21:05:15,712 INFO  [csvAccountExtract] process.ProcessRunner run (ProcessRunner.java:116) - Initializing process engine
2016-12-27 21:05:15,712 INFO  [csvAccountExtract] process.ProcessRunner run (ProcessRunner.java:119) - Loading parameters
2016-12-27 21:05:15,713 ERROR [csvAccountExtract] config.Config initEncryption (Config.java:731) - Error initializing encryption for key file ?c:\Temp\key.txt: Cannot Access Key File: ?c:\Temp\key.txt
2016-12-27 21:05:15,714 FATAL [main] process.ProcessRunner topLevelError (ProcessRunner.java:238) - Unable to run process csvAccountExtract
java.lang.RuntimeException: com.salesforce.dataloader.exception.ConfigInitializationException: Error initializing encryption for key file ?c:\Temp\key.txt: Cannot Access Key File: ?c:\Temp\key.txt
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:162)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:100)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.java:253)
Caused by: com.salesforce.dataloader.exception.ConfigInitializationException: Error initializing encryption for key file ?c:\Temp\key.txt: Cannot Access Key File: ?c:\Temp\key.txt
        at com.salesforce.dataloader.config.Config.initEncryption(Config.java:732)
        at com.salesforce.dataloader.config.Config.postLoad(Config.java:651)
        at com.salesforce.dataloader.config.Config.loadParameterOverrides(Config.java:678)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:120)
        ... 2 more

My process-conf is:
<beans>
    <bean id="csvAccountExtractProcess"
          class="com.salesforce.dataloader.process.ProcessRunner"
          singleton="false">
      <description>csvAccountExtract job gets account info from salesforce and saves info into a CSV file."</description>
        <property name="name" value="csvAccountExtract"/>
        <property name="configOverrideMap">
            <map>
                <entry key="sfdc.debugMessages" value="false"/>
                <entry key="sfdc.debugMessagesFile" value="c:\dataloader\samples\status\sfdcSoapTrace.log"/>
                <entry key="sfdc.endpoint" value="https://login.salesforce.com/"/>
                <entry key="sfdc.username" value="myusername@email.com"/>
                <entry key="sfdc.password" value="b028bead3a6fa728a40c9176df0fa742"/>
                <entry key="process.encryptionKeyFile" value="‪c:\Temp\key.txt"/>
                <entry key="sfdc.timeoutSecs" value="600"/>
                <entry key="sfdc.loadBatchSize" value="200"/>
                <entry key="sfdc.entity" value="Implementation__c"/>
                <entry key="sfdc.extractionRequestSize" value="500"/>
                <entry key="sfdc.extractionSOQL" value="SELECT Name,Account_Manager__c,Account_Executive__c,Question_Reset_Allowed__c,Configuration_Notes__c,Special_Use_Cases__c,Using_Integration__c,Integration_System__c,Integration_Notes__c,Utilizes_Roles__c,Utilizes_Group_Access__c,Client_creates_new_users__c,Contact_for_New_User_Setup__c FROM Implementation__c WHERE Implementation_Stage__c != 'Inactive'"/>
                <entry key="process.operation" value="extract"/>
                <entry key="process.mappingFile" value="C:\Program Files (x86)\salesforce.com\Data Loader\bin\conf\mappings.sdl"/>
                <entry key="dataAccess.type" value="csvWrite"/>
                <entry key="dataAccess.name" value="C:\Users\User1\Documents\extract.csv"/>
            </map>
        </property>
    </bean>
</beans>
Hello,

I am using the following code I found online, and I get an error when attempting to upload a document that is more than 135KB. I do not have apex coding skills, so I am having a tough time altering the code myself. I have found some forums that go over fixes to other similar code but not sure where to make what changes to what I have. Also, if I could get a "Your document has been uploaded" message inline I would be so thankful! There is nothing that informs the users it's been uploaded and they are uploading the file(s) multiple times.

Apex Class:
public class attachmentsample {

    public attachmentsample(ApexPages.StandardController controller) {

    }
    Public Attachment myfile;
    Public Attachment getmyfile()
    {
        myfile = new Attachment();
        return myfile;
    }
   
    Public Pagereference Savedoc()
    {
        String accid = System.currentPagereference().getParameters().get('id');

        Attachment a = new Attachment(parentId = accid, name=myfile.name, body = myfile.body);
         
         /* insert the attachment */
         insert a;
        return NULL;
    }   

}

Visualforce Page: (I have other VF code, but this is the part that is affected by what I am attempting to do.)
</apex:pageBlockSectionItem>
<apex:inputfile value="{!myfile.body}" filename="{!myfile.Name}" />
<apex:commandbutton value="Attach File" action="{!Savedoc}"/>
</apex:pageblocksection>
I have a VF page that appears when a button is clicked on the Opportunity to assist in getting certain fields completed for a process. I currently have a couple of Contact lookups for the Opportunity. For one of them, I need to pull in the Title, Phone, and Email fields for the user to confirm that they are complete and/or accurate and update them if they are not currently completed prior to kicking off the process. 
Hello,

I am attempting 2 different types of automation for creating Opportunity Contact Roles (OCRs).
  1. Adding a contact with a certain level of activity as an Influencer.
    • I have custom fields on the contact that calculates the total activity and a simple checkbox that determines if the contact should be an OCR or not (if an Opportunity is open).
    • Adding only when meeting the criteria, not removing at all. Removal can be manual.
  2. Copying OCRs from a previous opportunity to a renewal opportunity. 
    • When an opportunity is closed won a renewal opportunity is created automatically. We would like the OCRs for the original opportunity to be copied over to the renewal. 
I have attempted to do this with Flows and Process Builder, but Process Builder is limited in regards to creating OCRs. I have reviewed the most popular OCR blogs, but they are mostly based on having a Contact lookup field on the Opportunity, and I don't want more than one lookup. Even if I somehow made the single lookup auto-update with a contact when it reaches the criteria I don't know how I would update the single field since the opportunity is not yet related to the contact (this might be easiest if you can tell me how to do this!).

I am a click-to-code admin (VF is not easy for me) so any help with APEX/Triggers would be AMAZING! Or at least possible brainstorming or simple triggers/code to assist with a flow/process builder.

THANK YOU!!!
Hello,

I want to ensure that I am reviewing this accurately. https://help.salesforce.com/articleView?id=Hyperlink-Formula-Fields-for-JavaScript-Disablement&language=en_US&type=1

Is there a way to report on all the formula fields and what the formulas are so that I can search to see if my org is affected by this change?

I don't believe that we will be affected, but I want to do my due diligence, so any help in how I should go about this would be greatly appreciated!

Thanks!
Stephanie
Hello,

This is currently an OnClick JS button that I have. Can this be converted into a Lightning Component?

location.replace('/email/author/emailauthor.jsp?retURL=/{!Demo__c.Id}&template_id=00XF0000001UAxV&p3_lkid={!Demo__c.Id}&p24={!Demo__c.BR_Email__c}');
Hello! Thank you in advance for your assistance! I have been working on this for over 24 total changing the Controller and Component in small ways here and there to test and re-test, and I think I am going in circles at this point.

We have 8 custom Javascript buttons for our Cases - one per department. What these buttons do is allow the user to own the case with one click. It enters their name into a custom user lookup "owner" field for that department, updates their name to the standard Owner field, and updates the Status to Assigned. 

The current, working, custom JS button is:
{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")} 
var caseObj = new sforce.SObject("Case"); 
caseObj.Id = '{!Case.Id}'; 

caseObj.CST_Owner__c = '{!$User.Id}'; 
caseObj.OwnerId = '{!$User.Id}'; 
caseObj.Status = "Assigned"; 

var result = sforce.connection.update([caseObj]); 
window.location.href=window.location.href;

My Case Buttons Component is currently - this shows on the page and allows for button clicks and will sometimes throw an error and sometimes not but makes no changes:
<aura:component implements="flexipage:availableForAllPageTypes" access="global">
    <aura:attribute name="CaseObj" type="Case" />
        <lightning:button label="Own CST" onclick="{! c.owncst}"/>
</aura:component>

My Controller is currently:
({
owncst : function(component, event, helper) {
    var btnClicked = event.getSource();
    var CaseObj = component.get('v.CaseObj',true)
    component.set('v.CaseObj.Description', "true");
}})
I am thinking that Apex is my only hope for this, but if this can be done without let me know!

I have a formula field on the Lead that pulls the email domain (i.e. gmail.com) (Email_Domain__c) from the email field. I have a field on the Account that contains the primary email domain via a text field (Primary_Email_Domain__c).

When a Lead is created, I want to compare the Lead's Email Domain to all Primary Email Domain Account field values to find a match and then assign the Lead to the Account Owner for conversion.

Please and Thanks!! 
Hello,

I am using the following code I found online, and I get an error when attempting to upload a document that is more than 135KB. I do not have apex coding skills, so I am having a tough time altering the code myself. I have found some forums that go over fixes to other similar code but not sure where to make what changes to what I have. Also, if I could get a "Your document has been uploaded" message inline I would be so thankful! There is nothing that informs the users it's been uploaded and they are uploading the file(s) multiple times.

Apex Class:
public class attachmentsample {

    public attachmentsample(ApexPages.StandardController controller) {

    }
    Public Attachment myfile;
    Public Attachment getmyfile()
    {
        myfile = new Attachment();
        return myfile;
    }
   
    Public Pagereference Savedoc()
    {
        String accid = System.currentPagereference().getParameters().get('id');

        Attachment a = new Attachment(parentId = accid, name=myfile.name, body = myfile.body);
         
         /* insert the attachment */
         insert a;
        return NULL;
    }   

}

Visualforce Page: (I have other VF code, but this is the part that is affected by what I am attempting to do.)
</apex:pageBlockSectionItem>
<apex:inputfile value="{!myfile.body}" filename="{!myfile.Name}" />
<apex:commandbutton value="Attach File" action="{!Savedoc}"/>
</apex:pageblocksection>

Hello,

I'm pretty new to Salesforce so please forgive me if I'm posting to the wrong area. I'm trying to install an app from the app exchange to my Sandbox. I log in to my admin account to install and I get a popup asking me to approve third party access to the app. The button that says continue is grayed out so I'm unable to continue with the  installation.

User-added image

 

Any ideas on how I can fix this?