• NAVEEN KUMAR
  • NEWBIE
  • 34 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 9
    Questions
  • 9
    Replies
hi,
i'm getting below error,

not able to complete the trailhead if anyone identified soluyion please share it..


Amazon Connect resource configuration screen error: 

"We're sorry. While we strive to make AWS’s broad set of products and services available to all customers, some products and services may not be available to customers in India, including customers of Amazon Internet Services Private Limited (AISPL). Currently, AISPL does not provide Amazon Connect."
i have a page with drop down like below,

User-added image

if any one of the drop down value changes i need to higghlight the filter button to some red color.

dropdown change is based on action support function as below,
 
<label class="col-sm-2 control-label">{!$ObjectType.Supply_Level__c.Fields.MCT__c.Label}</label>
                    <apex:outputPanel id="mctList" styleclass="col-sm-2">
                        <apex:selectList value="{!selectedMCT}" size="1" styleClass="form-control input-medium">
                            <apex:selectOptions value="{!mctOptions}" />
                            <apex:actionSupport event="onchange" 
                                action="{!getVarieties}" 
                                rerender="varietyList" 
                                onsubmit="showLoading();"
                                oncomplete="hideLoading(); return false;" />
                        </apex:selectList>
                    </apex:outputPanel>

how we can acheive this using javascript any hint helpful.


 
Hi All,

i want to display  some other web pages or UI pages of some other website in salesforce UI using canvas, any one has knowldge of canvas please share it and help to complete.

 
Hi All,

below is my test data for a class. the class doing some rollups based on created date. but in test class test data inserted and it's giving createddate value as null so it's not covering the lines in the class for Contactrole__c object. please give me the solution for this.
 
Contact_Role__c conrole= new Contact_Role__c();
       conrole.Amount__c= 8000;
       conrole.Contact__c=con.Id;
       conrole.Opportunity__c=income.id;
       conrole.Role__c='Soft Credit';
       conrole.Share__c=2;
      // conrole.CreatedDate =System.today();
       insert conrole;
       system.debug('******+conrole' +conrole.CreatedDate); // Retuns Null
       conrole= [select Id, CreatedById ,CreatedDate  from Contact_Role__c where Id =:  conrole.Id limit 1];
        system.debug('******+conrole' +conrole); //Returns Date

 
hi for below class i started to write test class but i'm struck .. i'm not aware of how to pass the values in test class any one help me on this..
Class:
public  with sharing class EventTriggerHandller {
    
    /**
* @Author
* @return: 
* @parameters: List of event object, list of old event object
* @description:This method will accept the set of new event values and old event values. 
*         When event status is changed from Planned to Schedule, tasks would be created for Gala and donor events. * 
* */
    
    public static void eventTaskCreation(list<Events__c> newEvent, Map<Id, Events__c> oldEvent){ 
        system.debug('INside Handler');
        Date eventStartDate;
        Date onedayBfrEvent;
        String userId = UserInfo.getUserId();
        List<Task> taskList= new List<Task>();
        DKMS_Util dkmsUtil= new DKMS_Util();
        //getting teh record type map from DKMS_Util class method getAllRecordTypes()
        Map<id, RecordType> recType= dkmsUtil.getAllRecordTypes();
        
        for(Events__C eventNew: newEvent){
            system.debug('inside for');
            if(eventNew.Start_Date_and_Time__c != null){
                eventStartDate= date.newinstance(eventNew.Start_Date_and_Time__c.year(), eventNew.Start_Date_and_Time__c.month(), eventNew.Start_Date_and_Time__c.day());
                onedayBfrEvent=eventStartDate.addDays(-1);
                system.debug('onedayBfrEvent-->'+onedayBfrEvent);
                system.debug('eventStartDate-->'+eventStartDate);
            }
            
            system.debug('recType-->'+recType);
            if((eventNew.status__C != oldEvent.get(eventNew.id).status__C) && (eventNew.Status__c =='Scheduled' && oldEvent.get(eventNew.id).status__C =='Planned')){
                if(recType.get(eventNew.recordtypeid) != null){
                    if ((recType.get(eventNew.recordtypeid).Name == 'Gala Event' || recType.get(eventNew.recordtypeid).Name =='Donor Drive')){
                        system.debug('gala & donor -->');
                        Task evtTask = new Task();
                        evtTask.Subject = 'Inform the City Hall';
                        evtTask.status  = 'Not Started';
                        if(recType.get(eventNew.recordtypeid).Name == 'Gala Event' && eventNew.Start_Date_and_Time__c != null){
                            evtTask.ActivityDate = eventStartDate.addDays(-14); // setting the due date for Gala
                        }else if(recType.get(eventNew.recordtypeid).Name == 'Donor Drive' && eventNew.Start_Date_and_Time__c != null){
                            evtTask.ActivityDate = eventStartDate.addDays(-12); // setting the due date for Donor Drive
                        }
                        evtTask.IsReminderset= true;
                        evtTask.ReminderDateTime =  datetime.newInstance(onedayBfrEvent.year(), onedayBfrEvent.month(),onedayBfrEvent.day(), 09, 00,00);                    
                        evtTask.whatId = eventNew.id;
                        evtTask.ownerId = userId; // for now instead of drive manager, its being assigned to logged in user.
                        taskList.add(evtTask);
                    }
                    if (recType.get(eventNew.recordtypeid).Name == 'Gala Event'){
                        system.debug('gala 10 -->');
                        Task evtTask = new Task();
                        evtTask.Subject = 'Call Catering Company';
                        evtTask.status  = 'Not Started';
                        if(eventStartDate != null){
                            evtTask.ActivityDate = eventStartDate.addDays(-10); // setting the due date for Gala
                            evtTask.ReminderDateTime =  datetime.newInstance(onedayBfrEvent.year(), onedayBfrEvent.month(),onedayBfrEvent.day(), 09, 00,00);                        
                        }
                        evtTask.IsReminderset = true;
                        evtTask.whatId = eventNew.id;
                        evtTask.ownerId = userId; // for now instead of drive manager, its being assigned to logged in user.
                        taskList.add(evtTask);
                    }                
                }
            }
            
        }
        system.debug('taskList--->'+taskList.size());
        //Inserting task list..
        insert taskList;
    }
}


and my test class is,,,
 
@isTest 
public class EventTriggerHandller_Test {
 public static testMethod void eventTaskCreationTest() {
        Profile ProfileObj= [SELECT Id FROM Profile WHERE Name='System Administrator' LIMIT 1];
     	 //Inserting data into User
       User UserObj = new User(LastName = 'Test User Account1',Isactive =true,Username = 'testuseraccount1@test.com',Email = 'testuser@test.com',Alias = 'ta1' ,CommunityNickname= 'TestCN1' ,TimeZoneSidKey = 'America/Los_Angeles',LocaleSidKey='en_US',EmailEncodingKey= 'ISO-8859-1',ProfileId = ProfileObj.Id, LanguageLocaleKey = 'en_US');
       insert UserObj ;
       System.assert(UserObj.id!=null);
     System.runAs(UserObj) 
           {
               Map<id,String> mprecordtypeName=new Map<id,String>();
                FOR(RecordType rt:[SELECT Id, Name FROM RecordType WHERE SobjectType = 'Events__c']) {
                    mprecordtypeName.put(rt.id,rt.Name);
                    system.debug('mprecordtypeName---' +mprecordtypeName);
                }
                Events__c evnt = new Events__c();
            	evnt.name = 'Test Gala Event';
                evnt.Start_Date_and_Time__c= system.today();
                insert evnt;              
               //access test data 
               Events__c insertedevnt=[select id,name,Start_Date_and_Time__c from Events__c where id =:evnt.Id];
               System.assertEquals(insertedevnt.Name, 'Test Gala Event');

           
            //Events__c testevntnew = new Events__c( Name = 'Test event new',Start_Date_and_Time__c= system.today());
        	//Events__c testevntold = new Events__c( Name = 'Test event old',Start_Date_and_Time__c= system.today());
            //Events__c.eventTaskCreation(testevntnew, testevntold);
          
			    

	

           }
	}  
}



 
i have an apex class and i need to display one text field in blue color. can any one tell me how we can acheive this. if it's page we can go with style and color. but how we can do it in class..


Code:

 if(ent.Agreement_Type__c != null)
                            act.Description += '\nAgreement Type = '+ ent.Agreement_Type__c;
The result i need in blue color.
the challenge is ,

Create an Apex class that returns an array (or list) of formatted strings ('Test 0', 'Test 1', ...). The length of the array is determined by an integer parameter.The Apex class must be called 'StringArrayTest' and be in the public scope.
The Apex class must have a public static method called 'generateStringArray'.
The 'generateStringArray' method must return an array (or list) of strings. Each string must have a value in the format 'Test n' where n is the index of the current string in the array. The number of returned strings is specified by the integer parameter to the 'generateStringArray' method.


and the code i tried is...
Public class StringArrayTest 
{
public  static void generateStringArray ( String test)
{
String[] testnum = new String{'test 1','test 2'};

for(Integer i=0;i<testnum.size();i++)
 {
   
    System.debug(testnum [i]);

}
return generateStringArray 
}
}


please correct me...
Hi all,

Can someone help me to answer the below question.

 Hiring managers at Universal Containers would like a visual mechanism for determining review score outliers. Review scores are captured as a custom field on a custom Review object and can range from 1 to 10. Any review score that is > 8 should be highlighted in green. Any review score that is < 4 should be highlighted in red.

How would a developer accomplish this?

A. Use matrix reports

B. Use conditional highlight

C. Use custom summary formulas

D. Use charts


and one more Question also confusing ..

How can a developer configure an approval process to prevent a record from being edited by the submitter?
a.        Records are locked by default on submission; no action required
b.        Set an action to lock the record upon submission
c.        Create a Workflow field update action to make the page layout Read-only
d.        Develop a sharing rule that sets the record to Read-only

Which one is correct a or b?


 
i'm getting below error for one of the challenge in trailhead. 

 ERROR:

Challenge not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Contact_must_be_in_Account_ZIP_Code: []


CHALLENGE:
Create a validation rule to check that a contact is in the zip code of its account.
To complete this challenge, add a validation rule which will block the insertion of a contact if the contact is related to an account and has a mailing postal code (which has the API Name MailingPostalCode) different from the account's shipping postal code (which has the API Name ShippingPostalCode).Name the validation rule 'Contact must be in Account ZIP Code'.
A contact with a MailingPostalCode that has an account and does not match the associated Account ShippingPostalCode should return with a validation error and not be inserted.
The validation rule should ONLY apply to contact records with an associated account. Contact records with no associated parent account can be added with any MailingPostalCode value. (Hint: you can use the ISBLANK function for this check)


And i used below formula in validation Rule: 
 
AND(ISBLANK( Account.Name ),  MailingPostalCode <>  Account.ShippingPostalCode )
 
I am creating Amazon connect instance for trailhead challenge 'Build an amazon connect integration' but getting an error 'We're sorry. While we strive to make AWS’s broad set of products and services available to all customers, some products and services may not be available to customers in India, including customers of Amazon Internet Services Private Limited (AISPL). Currently, AISPL does not provide Amazon Connect.'Please help me here
Hi All,

i want to display  some other web pages or UI pages of some other website in salesforce UI using canvas, any one has knowldge of canvas please share it and help to complete.

 
Hi All,

below is my test data for a class. the class doing some rollups based on created date. but in test class test data inserted and it's giving createddate value as null so it's not covering the lines in the class for Contactrole__c object. please give me the solution for this.
 
Contact_Role__c conrole= new Contact_Role__c();
       conrole.Amount__c= 8000;
       conrole.Contact__c=con.Id;
       conrole.Opportunity__c=income.id;
       conrole.Role__c='Soft Credit';
       conrole.Share__c=2;
      // conrole.CreatedDate =System.today();
       insert conrole;
       system.debug('******+conrole' +conrole.CreatedDate); // Retuns Null
       conrole= [select Id, CreatedById ,CreatedDate  from Contact_Role__c where Id =:  conrole.Id limit 1];
        system.debug('******+conrole' +conrole); //Returns Date

 
hi for below class i started to write test class but i'm struck .. i'm not aware of how to pass the values in test class any one help me on this..
Class:
public  with sharing class EventTriggerHandller {
    
    /**
* @Author
* @return: 
* @parameters: List of event object, list of old event object
* @description:This method will accept the set of new event values and old event values. 
*         When event status is changed from Planned to Schedule, tasks would be created for Gala and donor events. * 
* */
    
    public static void eventTaskCreation(list<Events__c> newEvent, Map<Id, Events__c> oldEvent){ 
        system.debug('INside Handler');
        Date eventStartDate;
        Date onedayBfrEvent;
        String userId = UserInfo.getUserId();
        List<Task> taskList= new List<Task>();
        DKMS_Util dkmsUtil= new DKMS_Util();
        //getting teh record type map from DKMS_Util class method getAllRecordTypes()
        Map<id, RecordType> recType= dkmsUtil.getAllRecordTypes();
        
        for(Events__C eventNew: newEvent){
            system.debug('inside for');
            if(eventNew.Start_Date_and_Time__c != null){
                eventStartDate= date.newinstance(eventNew.Start_Date_and_Time__c.year(), eventNew.Start_Date_and_Time__c.month(), eventNew.Start_Date_and_Time__c.day());
                onedayBfrEvent=eventStartDate.addDays(-1);
                system.debug('onedayBfrEvent-->'+onedayBfrEvent);
                system.debug('eventStartDate-->'+eventStartDate);
            }
            
            system.debug('recType-->'+recType);
            if((eventNew.status__C != oldEvent.get(eventNew.id).status__C) && (eventNew.Status__c =='Scheduled' && oldEvent.get(eventNew.id).status__C =='Planned')){
                if(recType.get(eventNew.recordtypeid) != null){
                    if ((recType.get(eventNew.recordtypeid).Name == 'Gala Event' || recType.get(eventNew.recordtypeid).Name =='Donor Drive')){
                        system.debug('gala & donor -->');
                        Task evtTask = new Task();
                        evtTask.Subject = 'Inform the City Hall';
                        evtTask.status  = 'Not Started';
                        if(recType.get(eventNew.recordtypeid).Name == 'Gala Event' && eventNew.Start_Date_and_Time__c != null){
                            evtTask.ActivityDate = eventStartDate.addDays(-14); // setting the due date for Gala
                        }else if(recType.get(eventNew.recordtypeid).Name == 'Donor Drive' && eventNew.Start_Date_and_Time__c != null){
                            evtTask.ActivityDate = eventStartDate.addDays(-12); // setting the due date for Donor Drive
                        }
                        evtTask.IsReminderset= true;
                        evtTask.ReminderDateTime =  datetime.newInstance(onedayBfrEvent.year(), onedayBfrEvent.month(),onedayBfrEvent.day(), 09, 00,00);                    
                        evtTask.whatId = eventNew.id;
                        evtTask.ownerId = userId; // for now instead of drive manager, its being assigned to logged in user.
                        taskList.add(evtTask);
                    }
                    if (recType.get(eventNew.recordtypeid).Name == 'Gala Event'){
                        system.debug('gala 10 -->');
                        Task evtTask = new Task();
                        evtTask.Subject = 'Call Catering Company';
                        evtTask.status  = 'Not Started';
                        if(eventStartDate != null){
                            evtTask.ActivityDate = eventStartDate.addDays(-10); // setting the due date for Gala
                            evtTask.ReminderDateTime =  datetime.newInstance(onedayBfrEvent.year(), onedayBfrEvent.month(),onedayBfrEvent.day(), 09, 00,00);                        
                        }
                        evtTask.IsReminderset = true;
                        evtTask.whatId = eventNew.id;
                        evtTask.ownerId = userId; // for now instead of drive manager, its being assigned to logged in user.
                        taskList.add(evtTask);
                    }                
                }
            }
            
        }
        system.debug('taskList--->'+taskList.size());
        //Inserting task list..
        insert taskList;
    }
}


and my test class is,,,
 
@isTest 
public class EventTriggerHandller_Test {
 public static testMethod void eventTaskCreationTest() {
        Profile ProfileObj= [SELECT Id FROM Profile WHERE Name='System Administrator' LIMIT 1];
     	 //Inserting data into User
       User UserObj = new User(LastName = 'Test User Account1',Isactive =true,Username = 'testuseraccount1@test.com',Email = 'testuser@test.com',Alias = 'ta1' ,CommunityNickname= 'TestCN1' ,TimeZoneSidKey = 'America/Los_Angeles',LocaleSidKey='en_US',EmailEncodingKey= 'ISO-8859-1',ProfileId = ProfileObj.Id, LanguageLocaleKey = 'en_US');
       insert UserObj ;
       System.assert(UserObj.id!=null);
     System.runAs(UserObj) 
           {
               Map<id,String> mprecordtypeName=new Map<id,String>();
                FOR(RecordType rt:[SELECT Id, Name FROM RecordType WHERE SobjectType = 'Events__c']) {
                    mprecordtypeName.put(rt.id,rt.Name);
                    system.debug('mprecordtypeName---' +mprecordtypeName);
                }
                Events__c evnt = new Events__c();
            	evnt.name = 'Test Gala Event';
                evnt.Start_Date_and_Time__c= system.today();
                insert evnt;              
               //access test data 
               Events__c insertedevnt=[select id,name,Start_Date_and_Time__c from Events__c where id =:evnt.Id];
               System.assertEquals(insertedevnt.Name, 'Test Gala Event');

           
            //Events__c testevntnew = new Events__c( Name = 'Test event new',Start_Date_and_Time__c= system.today());
        	//Events__c testevntold = new Events__c( Name = 'Test event old',Start_Date_and_Time__c= system.today());
            //Events__c.eventTaskCreation(testevntnew, testevntold);
          
			    

	

           }
	}  
}



 
i have an apex class and i need to display one text field in blue color. can any one tell me how we can acheive this. if it's page we can go with style and color. but how we can do it in class..


Code:

 if(ent.Agreement_Type__c != null)
                            act.Description += '\nAgreement Type = '+ ent.Agreement_Type__c;
The result i need in blue color.
This is my code for the Trailhead  Displaying Records, Fields, and Tables challenge:

Code for challedge

This is my output:
output

They challenge fails but I am displaying all content.. Please let me know what is wrong.


 
Hi all,

Can someone help me to answer the below question.

 Hiring managers at Universal Containers would like a visual mechanism for determining review score outliers. Review scores are captured as a custom field on a custom Review object and can range from 1 to 10. Any review score that is > 8 should be highlighted in green. Any review score that is < 4 should be highlighted in red.

How would a developer accomplish this?

A. Use matrix reports

B. Use conditional highlight

C. Use custom summary formulas

D. Use charts


and one more Question also confusing ..

How can a developer configure an approval process to prevent a record from being edited by the submitter?
a.        Records are locked by default on submission; no action required
b.        Set an action to lock the record upon submission
c.        Create a Workflow field update action to make the page layout Read-only
d.        Develop a sharing rule that sets the record to Read-only

Which one is correct a or b?


 
i'm getting below error for one of the challenge in trailhead. 

 ERROR:

Challenge not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Contact_must_be_in_Account_ZIP_Code: []


CHALLENGE:
Create a validation rule to check that a contact is in the zip code of its account.
To complete this challenge, add a validation rule which will block the insertion of a contact if the contact is related to an account and has a mailing postal code (which has the API Name MailingPostalCode) different from the account's shipping postal code (which has the API Name ShippingPostalCode).Name the validation rule 'Contact must be in Account ZIP Code'.
A contact with a MailingPostalCode that has an account and does not match the associated Account ShippingPostalCode should return with a validation error and not be inserted.
The validation rule should ONLY apply to contact records with an associated account. Contact records with no associated parent account can be added with any MailingPostalCode value. (Hint: you can use the ISBLANK function for this check)


And i used below formula in validation Rule: 
 
AND(ISBLANK( Account.Name ),  MailingPostalCode <>  Account.ShippingPostalCode )