• Vinod Agrawal
  • NEWBIE
  • 15 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 4
    Replies
Is there a way to publish a Salesforce Library and all the Files underneath to be viewed by unauthenticated/guest users on an external community?
I need to download Contacts Near By component for the trailhead - field sales app project but I am not able to find it on appexchange. Any idea where can I get it from?
While trying to implement following tutotial, I am getting the error below. Any ideas why?

https://developer.salesforce.com/blogs/developer-relations/2015/04/creating-salesforce-lightning-map-component.html?utm_campaign=Lightning&utm_source=Newsletter_041315&utm_medium=Chief_Editor&eid=singlesend

Error while running markup://ltng:afterScriptsLoaded : Cannot read property 'get' of undefined
Hi, I am new to SalesForce Development. I wrote a trigger and a test class for it. Below is the code for the test class. When I execute the test class I get System.QueryException: List has no rows for assignment to SObject. First I thought I had some problem with my query but I executed it using Query Editor and the record returned successfully. I would appreciate if you can help me with this.

@isTest
private class NumberOfAttendeesUpdateTestClass{

    static testMethod void validateNumberOfAttendeesUpdate(){
   
        Contact ctc = new Contact(FirstName='Test',LastName='Contact', Conference__c='a00o0000003jzAwAAI');
        Conference__c cfc = [SELECT Id, Name, Number_of_Attendees__c from Conference__c WHERE Id = 'a00o0000003jzAwAAI' LIMIT 1];
        Double na = cfc.Number_of_Attendees__c;
        System.debug('Number of Attendees in Conference ' + cfc.Name + ' before inserting ' + cfc.Number_of_Attendees__c);
       
        insert ctc;
       
        cfc = [SELECT Id, Name, Number_of_Attendees__c from Conference__c WHERE Id = 'a00o0000003jzAwAAI' LIMIT 1];
        System.debug('Number of Attendees in Conference ' + cfc.Name + ' before inserting ' + cfc.Number_of_Attendees__c);
       
        System.assertEquals(na, na + 1);
   
    }
}
I need to download Contacts Near By component for the trailhead - field sales app project but I am not able to find it on appexchange. Any idea where can I get it from?
Is there a way to publish a Salesforce Library and all the Files underneath to be viewed by unauthenticated/guest users on an external community?
I have written a trigger to count the number of contacts in accounts. Please help me with writing the handler class of it. I have very less knowledge on handler class:
trigger tocountcontactrecords on Contact (after insert) {

set<ID> setID = new set<ID>();
List<Account> ListAccount = new List<Account>();

for(contact con : trigger.new)

{
setID.add(con.AccountID);
}
For(account acc:[select id,name,Numberofcount__c,(select id from contacts) from account where id=:setID])

{

Account Ac1 = new Account();
ac1.Id=acc.Id;
ac1.Numberofcount__c = acc.contacts.size();
Listaccount.add(ac1);

}

update Listaccount;


}
What is the difference between use 'force:showtoast' and 'lightning:notificationsLibrary' showToast method as strategy to displays toast messages?

In developer doc follows this recomendation: We recommend using lightning:notificationsLibrary for displaying messages in the app via notices and toasts. (https://developer.salesforce.com/docs/component-library/bundle/force:showToast/documentation)

I wish to understand why.
Hi, I am new to SalesForce Development. I wrote a trigger and a test class for it. Below is the code for the test class. When I execute the test class I get System.QueryException: List has no rows for assignment to SObject. First I thought I had some problem with my query but I executed it using Query Editor and the record returned successfully. I would appreciate if you can help me with this.

@isTest
private class NumberOfAttendeesUpdateTestClass{

    static testMethod void validateNumberOfAttendeesUpdate(){
   
        Contact ctc = new Contact(FirstName='Test',LastName='Contact', Conference__c='a00o0000003jzAwAAI');
        Conference__c cfc = [SELECT Id, Name, Number_of_Attendees__c from Conference__c WHERE Id = 'a00o0000003jzAwAAI' LIMIT 1];
        Double na = cfc.Number_of_Attendees__c;
        System.debug('Number of Attendees in Conference ' + cfc.Name + ' before inserting ' + cfc.Number_of_Attendees__c);
       
        insert ctc;
       
        cfc = [SELECT Id, Name, Number_of_Attendees__c from Conference__c WHERE Id = 'a00o0000003jzAwAAI' LIMIT 1];
        System.debug('Number of Attendees in Conference ' + cfc.Name + ' before inserting ' + cfc.Number_of_Attendees__c);
       
        System.assertEquals(na, na + 1);
   
    }
}