• Vida Yirenkyi
  • NEWBIE
  • 230 Points
  • Member since 2015
  • Certified Salesforce Administrator

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 26
    Questions
  • 46
    Replies
Hi Trailhead, for https://trailhead.salesforce.com/modules/advanced_formulas/units/picklist_formulas, my validation rule is working for both when the Priority is set to High or Medium in my org and yet the challenge checker is marking it as Not yet completed when Priority set to Medium
Hello Experts,

I need help with this code to show only the words in the parent case description in the child case. At the moment the child case description lists all the keywords.
trigger CheckSecretInfo on Case (after insert, before update) {

	String childCaseSubject = 'Warning: Parent case may contain secret info';

	// Step 1: Create a collection containing each of our secret keywords
	Set<String> secretKeywords = new Set<String>();
	secretKeywords.add('Credit Card');
	secretKeywords.add('Social Security');
	secretKeywords.add('SSN');
	secretKeywords.add('Passport');
	secretKeywords.add('Bodyweight');


List<Case> casesWithSecretInfo = new List<Case>();
Set<String> KeyWords = new Set<String>();
for (Case myCase : Trigger.new){
if(myCase.Subject != childCaseSubject){

// Step 2 Loop through secretkeywords and add all offending words to a Set

for(String KeyWord: secretKeywords){
if(myCase.Description != null && myCase.Description.containsIgnoreCase(KeyWord)){
	secretKeywords.add(KeyWord);
    break;
    system.debug('Keywords are: ' + keyword);
}
}

system.debug('cases to create' + casesWithSecretInfo.size());
	//Loop through secretkeywords and if there is any secret keywords add case to be created

List<Case> casesToCreate = new List<Case>();
for(Case caseWithSecretInfo : casesWithSecretInfo){
    Case childCase = new Case();
    childCase.Subject = 'Warning: Parent case may contain secret info';
    childCase.ParentId = caseWithSecretInfo.Id;
    childCase.IsEscalated = true;
    childCase.Priority = 'High';
    childCase.Description = 'The following secret keywords were found: ' + KeyWords;
    casesToCreate.add(childCase);
}
    insert casesToCreate;
}
}

}
Thanks 
 
Hi Trailhead,

I don't have the reply button when I get a response to my question, I only have the answer button and it's when I use that to reply it's marking it as best answer,  could you kindly look into this for me please.

Many thanks

Vida

 
Still can't get the code below to work ,  for some reason I don't have the reply button, only the Answer button and when I use that to respond it's marking my own responses as best answer even the question is not solved yet.
 
trigger LeastCompetitorPrice on Opportunity (before insert, before update) {
    Integer highestPricePosition;
    Decimal highestPrices;
    Decimal lowestPrice;
    for(Opportunity opp : Trigger.new){
        //Add all our prices in a list in order of competitor
        List<Decimal> competitorPrices = new List<Decimal>();
        competitorPrices.add(opp.Competitor_1_Price__c);
        competitorPrices.add(opp.Competitor_2_Price__c);
        competitorPrices.add(opp.Competitor_3_Price__c);
        
        //Add all our competitors in a list in order
        List<String> competitors = new List<String>();
        competitors.add(opp.Competitor_1__c);
        competitors.add(opp.Competitor_2__c);
        competitors.add(opp.Competitor_3__c);
        
        //Loop through all competitors to find the position of the highest price
                   
        for(integer i = 0; i<competitorPrices.size();i++){
           Decimal currentPrice = competitorPrices.get(i);
           if(highestPrices == null || currentPrice > highestPrices){
                  opp.HighestPrice__c = highestPrices;
			system.debug(highestPrices);
                     opp.HighestPrice__c = competitorPrices.get(highestPrices);
              if(lowestPrice == null || currentPrice > highestPrices)
                  highestPricePositions = i;
                             
           }
        }
         //Populate the leading highestPrice field with the highest price
         // matching the highest price position
        // opp.Leading_Competitor__c = competitors.get(highestPricePosition); 
        
        
        
    }}

 
Ladies and Gentlemen,

Could you help fix this code please and show me where the unexpected token is please, the error Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger LeastCompetitorPrice caused an unexpected exception, contact your administrator: LeastCompetitorPrice: execution of BeforeUpdate caused by: System.ListException: List index out of bounds: 7000: Trigger.LeastCompetitorPrice: line 36, column 1

trigger LeastCompetitorPrice on Opportunity (After insert, after update) {
    Integer highestPricePosition;
    Integer highestPrice;
    for(Opportunity opp : Trigger.new){
        //Add all our prices in a list in order of competitor
        List<Decimal> competitorPrices = new List<Decimal>();
        competitorPrices.add(opp.Competitor_1_Price__c);
        competitorPrices.add(opp.Competitor_2_Price__c);
        competitorPrices.add(opp.Competitor_3_Price__c);
        
        //Add all our competitors in a list in order
        List<String> competitors = new List<String>();
        competitors.add(opp.Competitor_1__c);
        competitors.add(opp.Competitor_2__c);
        competitors.add(opp.Competitor_3__c);
        
        //Loop through all competitors to find the position of the lowest price
        Decimal lowestPrice;
        Decimal highestPrices;
                Integer lowestPricePosition;
        for(integer i = 0; i<=competitorPrices.size(); i++){
            Decimal currentPrice = competitorPrices.get(i);
            if(lowestPrice == null || currentPrice > lowestPrice){
                  highestPrices = currentPrice;
                  lowestPricePosition = i;                
                            }
           if(highestPrices == null || currentPrice > highestPrices)
               highestPrices = currentPrice.intvalue();
                if(lowestPrice == null || currentPrice < highestPrices)
                  highestPricePosition = i;
               }
           }
        }
        //Populate the leading competitor field with the competitor
         // matching the lowest price position
         //opp.Leading_Competitor__c = competitors.get(lowestPricePosition);
         opp.Least_Competitor__c = competitorPrices.get(lowestPricePosition);
         opp.HighestPrice__c = competitorPrices.get(highestPrices.intvalue());

I am trying to insert the price of the highest competitor in the HighestPrice__c field.
Thank you
Vida



 
Hi,
In user debug:
DateTime currentTime = DateTime.now();
system.debug(currentTime);

The time output is an hour late but the time stamp value is correct. my locale is BST UK.
How can I get the debug log to give me the correct uk time.

Thank you

Vida

 
Hello Force.com IDE pros,

I have sucessfully installed my Java 7, elclipse and force.com IDE 
When I create a new project, on right click src, Force.com, 'add remove metadata components' is greyed out.
I am using windows 10. I want the option of being able to only add the specific objects that I am going to be working on.
Your help and advice is much appreciated.
Thanks
Vida
Hello all,

I need help to get mavensmate to work with my windows 10. How can I get mm to use chrone instead of IE to open the UI when I create a new project. I am getting; "The local MavensMate server did not respond properly. This likely means it is not running or it is malfunctioning. Try restarting your text editor and MavensMate.app", etc

I have reset setting in chrome under advanced settings and I have restarted many times.
Hello all,

I need help to get my mavensmate to work with my windows 10. How can I get mm to use chrone instead of IE to open the UI when I create a new project. I am getting; The local MavensMate server did not respond properly. This likely means it is not running or it is malfunctioning. Try restarting your text editor and MavensMate.app,

I have reset setting in chrome under advanced settings and I have restarted many times.
Hi,
why is the below test class not working, please?
@istest
public class HelloWorldTest
{
    @istest
    public static void TestHelloWorldFunction()
    {
        HelloWorldClass hello = new HelloWorldClass();
        Test.StartTest();
        hello.HelloWorld();
        Test.StopTest();
    
    }


}
Error: Compile Error: Method does not exist or incorrect signature: [HelloWorldClass].HelloWorld() at line 9 column 9
Hi all, help

I thought I had successfully installed Eclipse, but when I go to connect to the Force.com IDE in the open perspective it is not listed.
What can I do?User-added image
 Hi All,
I need help to install Eclipse. I am getting for attached message, what do I need to do? I am new to this, I need to start working on the Force.com IDE. They said it sits on Eclipse so I must have it.Eclipse install problems
I have tested with several accounts and its working, but I am still getting "challenge not yet complete... here's what's wrong: 
An update to an account record failed to update the mailing address fields of all child contact records. Make sure that the process is correct and that it is activated."

My process is activated and I have deactivated the previous validation rule that may affect it. I have gone through the record types and the profiles that use them etc.. where do I need to check please?
 
I don't have the "Set object variables" in my Process builder options. I don't have the icons for picklists... please help thanks.User-added image
Hello Trailhead,
Please find attached, I don't have the icons to switch from text entry to field picker for the above challenge. Please help
In the Value for Account ID, click  [The Text Entry icon]  to switch from the text entry field to the field picker ( [The Field Picker icon] ).

Many thanks

VidaOpportunity management challenge for Process Builder
In utilities | REST Explorer
I pasted this in the event monitoring query but I keep getting an error.

/services/data/v <API version> .0/query?q=SELECT+Id+,+EventType+,+LogDate+,+LogFileLength+,+LogFile+FROM+EventLogFile+WHERE+EventType+=+'ReportExport'.

Service not found at: /q=SELECT+Id+,+EventType+,+LogDate+,+LogFileLength+,+LogFile+FROM+EventLogFile+WHERE+EventType+=+'ReportExport'
I have enabled inline editing in my org but in testing I don't have the check boxes to select records in the list view.
Setting up business hours, when I uncheck 24-hour check boxes for Saturday and Sunday it keeps reverting back to 24 hours. To try to resolve it, I have created a holiday for Weekend and associated it to the group Business hours but I would rather have the weekend showing as 0 hours. Solutions please.
1. In DE under manage users | users, I don't have the option to login as the user for testing.
2. When setting up business hours, when I uncheck 24 hours boxes for Saturday and Sunday it keeps reverting back to 24 hours. To try to resolve it, I have created a holiday for Weekend and associated it to the group Business hours but I would rather have the weekend showing as 0 hours.
Hi Trailhead,
Could you kindly send me the steps for displaying my badges on linkedIn, please?  I have checked the boxes for share on social networks, but I think I am missing a step.

Thank you

 
Hi Trailhead, for https://trailhead.salesforce.com/modules/advanced_formulas/units/picklist_formulas, my validation rule is working for both when the Priority is set to High or Medium in my org and yet the challenge checker is marking it as Not yet completed when Priority set to Medium
Hi Trailhead, for https://trailhead.salesforce.com/modules/advanced_formulas/units/picklist_formulas, my validation rule is working for both when the Priority is set to High or Medium in my org and yet the challenge checker is marking it as Not yet completed when Priority set to Medium
Hello Experts,

I need help with this code to show only the words in the parent case description in the child case. At the moment the child case description lists all the keywords.
trigger CheckSecretInfo on Case (after insert, before update) {

	String childCaseSubject = 'Warning: Parent case may contain secret info';

	// Step 1: Create a collection containing each of our secret keywords
	Set<String> secretKeywords = new Set<String>();
	secretKeywords.add('Credit Card');
	secretKeywords.add('Social Security');
	secretKeywords.add('SSN');
	secretKeywords.add('Passport');
	secretKeywords.add('Bodyweight');


List<Case> casesWithSecretInfo = new List<Case>();
Set<String> KeyWords = new Set<String>();
for (Case myCase : Trigger.new){
if(myCase.Subject != childCaseSubject){

// Step 2 Loop through secretkeywords and add all offending words to a Set

for(String KeyWord: secretKeywords){
if(myCase.Description != null && myCase.Description.containsIgnoreCase(KeyWord)){
	secretKeywords.add(KeyWord);
    break;
    system.debug('Keywords are: ' + keyword);
}
}

system.debug('cases to create' + casesWithSecretInfo.size());
	//Loop through secretkeywords and if there is any secret keywords add case to be created

List<Case> casesToCreate = new List<Case>();
for(Case caseWithSecretInfo : casesWithSecretInfo){
    Case childCase = new Case();
    childCase.Subject = 'Warning: Parent case may contain secret info';
    childCase.ParentId = caseWithSecretInfo.Id;
    childCase.IsEscalated = true;
    childCase.Priority = 'High';
    childCase.Description = 'The following secret keywords were found: ' + KeyWords;
    casesToCreate.add(childCase);
}
    insert casesToCreate;
}
}

}
Thanks 
 
Still can't get the code below to work ,  for some reason I don't have the reply button, only the Answer button and when I use that to respond it's marking my own responses as best answer even the question is not solved yet.
 
trigger LeastCompetitorPrice on Opportunity (before insert, before update) {
    Integer highestPricePosition;
    Decimal highestPrices;
    Decimal lowestPrice;
    for(Opportunity opp : Trigger.new){
        //Add all our prices in a list in order of competitor
        List<Decimal> competitorPrices = new List<Decimal>();
        competitorPrices.add(opp.Competitor_1_Price__c);
        competitorPrices.add(opp.Competitor_2_Price__c);
        competitorPrices.add(opp.Competitor_3_Price__c);
        
        //Add all our competitors in a list in order
        List<String> competitors = new List<String>();
        competitors.add(opp.Competitor_1__c);
        competitors.add(opp.Competitor_2__c);
        competitors.add(opp.Competitor_3__c);
        
        //Loop through all competitors to find the position of the highest price
                   
        for(integer i = 0; i<competitorPrices.size();i++){
           Decimal currentPrice = competitorPrices.get(i);
           if(highestPrices == null || currentPrice > highestPrices){
                  opp.HighestPrice__c = highestPrices;
			system.debug(highestPrices);
                     opp.HighestPrice__c = competitorPrices.get(highestPrices);
              if(lowestPrice == null || currentPrice > highestPrices)
                  highestPricePositions = i;
                             
           }
        }
         //Populate the leading highestPrice field with the highest price
         // matching the highest price position
        // opp.Leading_Competitor__c = competitors.get(highestPricePosition); 
        
        
        
    }}

 
Ladies and Gentlemen,

Could you help fix this code please and show me where the unexpected token is please, the error Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger LeastCompetitorPrice caused an unexpected exception, contact your administrator: LeastCompetitorPrice: execution of BeforeUpdate caused by: System.ListException: List index out of bounds: 7000: Trigger.LeastCompetitorPrice: line 36, column 1

trigger LeastCompetitorPrice on Opportunity (After insert, after update) {
    Integer highestPricePosition;
    Integer highestPrice;
    for(Opportunity opp : Trigger.new){
        //Add all our prices in a list in order of competitor
        List<Decimal> competitorPrices = new List<Decimal>();
        competitorPrices.add(opp.Competitor_1_Price__c);
        competitorPrices.add(opp.Competitor_2_Price__c);
        competitorPrices.add(opp.Competitor_3_Price__c);
        
        //Add all our competitors in a list in order
        List<String> competitors = new List<String>();
        competitors.add(opp.Competitor_1__c);
        competitors.add(opp.Competitor_2__c);
        competitors.add(opp.Competitor_3__c);
        
        //Loop through all competitors to find the position of the lowest price
        Decimal lowestPrice;
        Decimal highestPrices;
                Integer lowestPricePosition;
        for(integer i = 0; i<=competitorPrices.size(); i++){
            Decimal currentPrice = competitorPrices.get(i);
            if(lowestPrice == null || currentPrice > lowestPrice){
                  highestPrices = currentPrice;
                  lowestPricePosition = i;                
                            }
           if(highestPrices == null || currentPrice > highestPrices)
               highestPrices = currentPrice.intvalue();
                if(lowestPrice == null || currentPrice < highestPrices)
                  highestPricePosition = i;
               }
           }
        }
        //Populate the leading competitor field with the competitor
         // matching the lowest price position
         //opp.Leading_Competitor__c = competitors.get(lowestPricePosition);
         opp.Least_Competitor__c = competitorPrices.get(lowestPricePosition);
         opp.HighestPrice__c = competitorPrices.get(highestPrices.intvalue());

I am trying to insert the price of the highest competitor in the HighestPrice__c field.
Thank you
Vida



 
Hi,
In user debug:
DateTime currentTime = DateTime.now();
system.debug(currentTime);

The time output is an hour late but the time stamp value is correct. my locale is BST UK.
How can I get the debug log to give me the correct uk time.

Thank you

Vida