• Katherine Rowe
  • NEWBIE
  • 30 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 19
    Replies
Can you reference a custom setting in a process builder process? For example, upon insert of a new Account, take the value in textfield1, look it up in the custom setting, take the corresponding field value in the cusotm setting, and write it back to textfield1.
Can someone help me with the for loop I'm trying to put in my trigger?

I want to use a custom setting to hold mapping for a field. For example, if the user selects the Industry field as "Utilities & Water", then I want the trigger to go to the Custom Setting to find the appropriate value for that industry and put it in the field LOB, which in this example would be "Utilities & Communications". I started off not using a loop, and just using getInstance(), like below but then I realized some of my industry values are more than 40 characters which won't work with the Custom Setting name field.
trigger MapLOBTrigger on Account (before update, before insert) {

     for(Account a1: Trigger.new){
 
         if(MappingLOB__c.getInstance(a1.Industry) != null){
            a1.Industry=MappingLOB__c.getInstance(a1.Industry).LOB__c;
         }
     }
}


So now I have tried added a custom field called Industry on my custom setting to use instead of the name field. But I think I've been told I can't use getInstance() and I have to instead use getAll() and a loop to sort through all the values in the Custom Setting? Maybe a List?


User-added image

 
I am writing a trigger for Accounts that I only want to run when the Account is created via data.com, as opposed to: the user through the GUI, the user through API.

How can I write my trigger to detect whether the account is coming from data.com or not? Is there a "best practice" way of doing this?
I've got the following trigger working, to map the value of an industry to a different industry:
 
trigger MapDataCOMIndustry on Account (before insert, before update) {
    for(Account a1: Trigger.new){
        if(a1.industry=='Government'){
           a1.industry='Emergency Services';
        }
    }  
}

Now I have to do that for a long list of industries, see below. What is the best way to write this in the trigger? Can I use something like a "case" method? Or does it need to be a bunch of else if statements?
 
trigger MapDataCOMIndustry on Account (before insert, before update) {
    for(Account a1: Trigger.new){
    
        if(a1.industry=='Government'){
           a1.industry='Emergency Services';
        }
        
        else if(a1.industry=='Agriculture'){
           a1.industry='Agriculture & Fisheries';
        }
        
        else if(a1.industry=='Apparel'){
            a1.industry='Other';
        }
        
        else if(a1.industry=='Banking'){
            a1.industry='Finance';
        }
    }  
}



User-added image

 
Flow newbie here, need some guidance. I figure I've got the basics working, now I need to design it for various situations.

Goal: When opportunity ownership is transfered and the "Keep Opportuntiy Teams" box is selected, then I want the flow to automatically delete the opportunity team member for the previous owner. Because we have Splits enabled, the owner is always added as an opporutnity team member. And as soon as the owner becomes the previous owner, I want the corresponding team member to be automatically deleted. For example, Joe owns the opp, Joe and Mary are team members. The opp is transfered to Bob, and the desired result should be that Bob and Mary are the only team members.

So far, I've got a single step in my flow that deletes the team member nicely. But it only works when "Keep Opportunity Teams" is selected. If I don't select "Keep Opportunity Teams", then the flow throws an error. Presumably because the team member has already been deleted and the flow doesn't know what to do? I'm not sure how to modify my flow to deal with this.

After I get that sorted out, then I need to make sure it can delete any splits it needs to. 

User-added image
I understand we can now use Developer Console to find and delete reports from the users' personal report folders. I need help writing that query. At least to view the reports, and then later to delete.

I want it to show me report id, report name, user name, user role for all users where role contains "abc". And then I would like to do the same query, but for users that are inactive instead of based on their role.

The example floating around in the documentation is below, but not sure how to incorporate the changes I want:
 
SELECT Id FROM Report USING SCOPE allPrivate WHERE LastRunDate < LAST_N_DAYS:365

 
Can we control the URL when using a visual force page? Disclaimer, don't know much about visual force myself. I'd settle for a yes or no, but if it's easy change maybe you can outline how it would be done.

For example, we have a visual force page for our opportunities. The first thing it's doing that I don't like, is its using the 18 character ID instead of the 15. Can we change it to use the 15 character ID? The second thing it's doing that I don't like, is its appending this thing at the end "?nooveride=1". Can we get rid of that? I guess what I'm saying is I want the URL to look exactly like it does for opportunities without visual force.
 
Current URL with visual force page:
https://intergraph.my.salesforce.com/0065700000misnKAAQ?nooverride=1

If I erase the last 3 characters of the ID and everything after it, the link still takes me to the opportunity, so I guess those things aren't really necessary? Then it's just a matter of is there a way to remove them?
 
https://intergraph.my.salesforce.com/0065700000misnK

 

Why does it only send an email the first time there is an unhandled exception? Is there some logic to explain this behavior?

This guy describes the same behavior here, but this was from 5 years ago:
https://developer.salesforce.com/forums/ForumsMain?id=906F00000008yXMIAY

I am actually testing something about the exception emails, so I want to keep receiving the actual email everytime my trigger throws an unhandled exception. I've tried adding my name to the Apex Exception Email list, but that didn't help with the frequency of emails.

I need a trigger that will throw an unhandled exception. I'm new to writing triggers, can someone help me whip one up? I'm testing the emails that SF sends out to the last modified user on the trigger, when there is an unhandled exception.
 

It can be really simple. I just want to be able easily fire the trigger in SF and for it to throw an unhandled exception. 

So apparently when there's an unhandled exception in a trigger, SF always sends an email to the person who is the Last Modified By person on the trigger/class? My question is, can we stop it from emailing anyone at all?

Disclaimer: Salesforce Admin here, not a developer. 

The reason I don't want it to try and send an email is, we have Email Deliverability set to System Only in our test and dev environments. And sometimes when an action leads to a trigger failing, the error displayed is about the "NO_MASS_MAIL_PERMISSION" instead of the underlying cause. If I turn Email Deliverability to All Emails, then a more relevant error message then shows in its place, and we can then figure out the problem and deal with it. The triggers I'm referring to are in a managed package, so rewriting the trigger to perhaps handle exceptions better is not in our control. So for now, I want to see if we can simply stop SF from trying to email anyone at all...

When unhandled Apex exceptions occur, emails are sent that include the Apex stack trace and the customer’s org and user ID. No other customer data is returned with the report. Unhandled exception emails are sent by default to the developer specified in theLastModifiedBy field on the failing class or trigger.

What Happens When an Apex Exception Occurs?
https://help.salesforce.com/HTViewHelpDoc?id=code_apex_exceptions.htm

Error when Email Deliverability is set to System Only
User-added image


Error when Email Deliverability is set to All Emails
User-added image
I'm getting the following error everytime I click the "Add/Remove..." button on the Metadata Components window in Eclipse. Is there something I can fix to make it stop giving me this message?
 
Package Manifest Content Warning

Exception happened when resolving component type(s), so no component will be added to package manifest editor for these types.
*ExternalDataSource
See log for detail exception messages.

User-added image


I'm not a developer, so I don't know much about eclipse. I'm using eclipse as a way to download the reports my users are using. So I can see what columns and criteria they're using. I just need to be able to pull this information from Salesforce, I won't be pushing any changes from Eclipse back to Salesforce.
I only had one user in my dev environment, the kind you can sign up for for free, and I seem to have locked myself out. How do you unlock yourself when you're the only user?
Can you reference a custom setting in a process builder process? For example, upon insert of a new Account, take the value in textfield1, look it up in the custom setting, take the corresponding field value in the cusotm setting, and write it back to textfield1.
Can someone help me with the for loop I'm trying to put in my trigger?

I want to use a custom setting to hold mapping for a field. For example, if the user selects the Industry field as "Utilities & Water", then I want the trigger to go to the Custom Setting to find the appropriate value for that industry and put it in the field LOB, which in this example would be "Utilities & Communications". I started off not using a loop, and just using getInstance(), like below but then I realized some of my industry values are more than 40 characters which won't work with the Custom Setting name field.
trigger MapLOBTrigger on Account (before update, before insert) {

     for(Account a1: Trigger.new){
 
         if(MappingLOB__c.getInstance(a1.Industry) != null){
            a1.Industry=MappingLOB__c.getInstance(a1.Industry).LOB__c;
         }
     }
}


So now I have tried added a custom field called Industry on my custom setting to use instead of the name field. But I think I've been told I can't use getInstance() and I have to instead use getAll() and a loop to sort through all the values in the Custom Setting? Maybe a List?


User-added image

 
I am writing a trigger for Accounts that I only want to run when the Account is created via data.com, as opposed to: the user through the GUI, the user through API.

How can I write my trigger to detect whether the account is coming from data.com or not? Is there a "best practice" way of doing this?
I've got the following trigger working, to map the value of an industry to a different industry:
 
trigger MapDataCOMIndustry on Account (before insert, before update) {
    for(Account a1: Trigger.new){
        if(a1.industry=='Government'){
           a1.industry='Emergency Services';
        }
    }  
}

Now I have to do that for a long list of industries, see below. What is the best way to write this in the trigger? Can I use something like a "case" method? Or does it need to be a bunch of else if statements?
 
trigger MapDataCOMIndustry on Account (before insert, before update) {
    for(Account a1: Trigger.new){
    
        if(a1.industry=='Government'){
           a1.industry='Emergency Services';
        }
        
        else if(a1.industry=='Agriculture'){
           a1.industry='Agriculture & Fisheries';
        }
        
        else if(a1.industry=='Apparel'){
            a1.industry='Other';
        }
        
        else if(a1.industry=='Banking'){
            a1.industry='Finance';
        }
    }  
}



User-added image

 
Flow newbie here, need some guidance. I figure I've got the basics working, now I need to design it for various situations.

Goal: When opportunity ownership is transfered and the "Keep Opportuntiy Teams" box is selected, then I want the flow to automatically delete the opportunity team member for the previous owner. Because we have Splits enabled, the owner is always added as an opporutnity team member. And as soon as the owner becomes the previous owner, I want the corresponding team member to be automatically deleted. For example, Joe owns the opp, Joe and Mary are team members. The opp is transfered to Bob, and the desired result should be that Bob and Mary are the only team members.

So far, I've got a single step in my flow that deletes the team member nicely. But it only works when "Keep Opportunity Teams" is selected. If I don't select "Keep Opportunity Teams", then the flow throws an error. Presumably because the team member has already been deleted and the flow doesn't know what to do? I'm not sure how to modify my flow to deal with this.

After I get that sorted out, then I need to make sure it can delete any splits it needs to. 

User-added image

I need a trigger that will throw an unhandled exception. I'm new to writing triggers, can someone help me whip one up? I'm testing the emails that SF sends out to the last modified user on the trigger, when there is an unhandled exception.
 

It can be really simple. I just want to be able easily fire the trigger in SF and for it to throw an unhandled exception. 

So apparently when there's an unhandled exception in a trigger, SF always sends an email to the person who is the Last Modified By person on the trigger/class? My question is, can we stop it from emailing anyone at all?

Disclaimer: Salesforce Admin here, not a developer. 

The reason I don't want it to try and send an email is, we have Email Deliverability set to System Only in our test and dev environments. And sometimes when an action leads to a trigger failing, the error displayed is about the "NO_MASS_MAIL_PERMISSION" instead of the underlying cause. If I turn Email Deliverability to All Emails, then a more relevant error message then shows in its place, and we can then figure out the problem and deal with it. The triggers I'm referring to are in a managed package, so rewriting the trigger to perhaps handle exceptions better is not in our control. So for now, I want to see if we can simply stop SF from trying to email anyone at all...

When unhandled Apex exceptions occur, emails are sent that include the Apex stack trace and the customer’s org and user ID. No other customer data is returned with the report. Unhandled exception emails are sent by default to the developer specified in theLastModifiedBy field on the failing class or trigger.

What Happens When an Apex Exception Occurs?
https://help.salesforce.com/HTViewHelpDoc?id=code_apex_exceptions.htm

Error when Email Deliverability is set to System Only
User-added image


Error when Email Deliverability is set to All Emails
User-added image
I'm getting the following error everytime I click the "Add/Remove..." button on the Metadata Components window in Eclipse. Is there something I can fix to make it stop giving me this message?
 
Package Manifest Content Warning

Exception happened when resolving component type(s), so no component will be added to package manifest editor for these types.
*ExternalDataSource
See log for detail exception messages.

User-added image


I'm not a developer, so I don't know much about eclipse. I'm using eclipse as a way to download the reports my users are using. So I can see what columns and criteria they're using. I just need to be able to pull this information from Salesforce, I won't be pushing any changes from Eclipse back to Salesforce.
I only had one user in my dev environment, the kind you can sign up for for free, and I seem to have locked myself out. How do you unlock yourself when you're the only user?