• Angie Shona
  • NEWBIE
  • 20 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 6
    Replies
Can someone explain how the we services architecture and API works in salesforce, Is it same like java??? Kindly provide with example and links.
Hi everyone,

I am learning Salesforce from April 2017. I learned Apex and VF. I wrote triggers. But still I am feeling like I am lacking somewhere. I lost many interviews. 
I can read codes and undestand the meaning.I paid money for online classes for salesforce but all waste(may be my wrong) also i learned from plural website but that also couldnt help. I believe just to learn few codes is not enough to crack the inetrview. As I am from non coding background(even though I am a btech in IT) I understand I will take time to learn and understand things. If I get new a question interview with diferent conditions I couldn't map the things properly. 

Still I want to learn, can anybody direct me how to design the condition in mind to code and if there is a way I can learn online I am ready to do so.

I hoping for best helping answers here because I know in this community we have sound developers and coders. In the begining they may be facing same issues. Waiting for your helps.

Thanks in Advance.
Wish you all a very happy & prosperous new year 2018.
Regards,
Anjali
I am new to salesforce, I heard about Chargify framework. We need http call outs and lots of thing. Can anybody explain what excatly it is and what do we need to set it up. Please provide a simple example to describe it.
trigger DeDupeLead on Lead (before insert)

 {  //get the data quality queue record            
     GROUP DataQualityGroup = [SELECT Id 
                                       FROM GROUP
                                       WHERE DeveloperName= 'Data_Quality'
                                       LIMIT 1];
    for(Lead myLead:Trigger.new) {
            
        //Searching for matchingContacts

        List<Contact> matchingContacts = [SELECT Id
                                       FROM Contact
                                       WHERE Email = :myLead.Email];

         System.debug (matchingContacts.size() + 'contact(s) Found.');

        //If MatchingContacts Found...

        If (!matchingContacts.isEmpty()) {
        //Assign the lead to Data quality queue

        myLead.OwnerId  = DataQualityGroup.Id;

        
        //Add the dupe contacts Ids into lead descriptons

        String dupeContactMessages = 'Duplicate Contacts Found: \n';
        for( Contact matchingContact : matchingContacts) {
         dupeContactMessages += matchingContact.FirstName +''
                               +matchingContact.LastName + ''
                               +matchingContact.Account.Name +''
                               +matchingContact.Id; 
    }
    myLead.Description = dupeContactMessages + '\n'+ myLead.Description;
    }

    }
    }
 
Can someone explain how the we services architecture and API works in salesforce, Is it same like java??? Kindly provide with example and links.
Hi everyone,

I am learning Salesforce from April 2017. I learned Apex and VF. I wrote triggers. But still I am feeling like I am lacking somewhere. I lost many interviews. 
I can read codes and undestand the meaning.I paid money for online classes for salesforce but all waste(may be my wrong) also i learned from plural website but that also couldnt help. I believe just to learn few codes is not enough to crack the inetrview. As I am from non coding background(even though I am a btech in IT) I understand I will take time to learn and understand things. If I get new a question interview with diferent conditions I couldn't map the things properly. 

Still I want to learn, can anybody direct me how to design the condition in mind to code and if there is a way I can learn online I am ready to do so.

I hoping for best helping answers here because I know in this community we have sound developers and coders. In the begining they may be facing same issues. Waiting for your helps.

Thanks in Advance.
Wish you all a very happy & prosperous new year 2018.
Regards,
Anjali
I am new to salesforce, I heard about Chargify framework. We need http call outs and lots of thing. Can anybody explain what excatly it is and what do we need to set it up. Please provide a simple example to describe it.
trigger DeDupeLead on Lead (before insert)

 {  //get the data quality queue record            
     GROUP DataQualityGroup = [SELECT Id 
                                       FROM GROUP
                                       WHERE DeveloperName= 'Data_Quality'
                                       LIMIT 1];
    for(Lead myLead:Trigger.new) {
            
        //Searching for matchingContacts

        List<Contact> matchingContacts = [SELECT Id
                                       FROM Contact
                                       WHERE Email = :myLead.Email];

         System.debug (matchingContacts.size() + 'contact(s) Found.');

        //If MatchingContacts Found...

        If (!matchingContacts.isEmpty()) {
        //Assign the lead to Data quality queue

        myLead.OwnerId  = DataQualityGroup.Id;

        
        //Add the dupe contacts Ids into lead descriptons

        String dupeContactMessages = 'Duplicate Contacts Found: \n';
        for( Contact matchingContact : matchingContacts) {
         dupeContactMessages += matchingContact.FirstName +''
                               +matchingContact.LastName + ''
                               +matchingContact.Account.Name +''
                               +matchingContact.Id; 
    }
    myLead.Description = dupeContactMessages + '\n'+ myLead.Description;
    }

    }
    }
 

I am attempting to implement a trigger that prevents duplicate contacts from being added.

 

Being a non developer (mere admin) I have download the app from the AppEx and although this gets me 90% of the way, I need to enhance the logic to include "Account Name". I have used a bit of trial and error (blantent guess work) but to no avail.

 

Below is the the apex trigger, but how do I include "Account"??

 

 

trigger ContactDuplicateTrigger on Contact (before insert) {
   for (Contact c : Trigger.new){
      
      Contact[] contacts= [select id from Contact where FirstName = :c.FirstName and LastName = :c.LastName and Email = :c.Email];
      
      if (contacts.size() > 0) {
          c.LastName.addError('Contact cannot be created - Contact already exists');
      }    
   }
}

 

Additionally I know that you need to test the trigger using an Apex Class, which of course I have, but wouldn't know how to tie in the changes above with below....if that makes sense.?!"

  

public class DuplicateContactTestClass {
   
   public static testMethod void testContactDuplicateTrigger() {
    Contact existingContact = new Contact(FirstName = 'John', LastName = 'Smith', Email = 'js@gmail.com');
    insert existingContact;
    
    Contact duplicateContact = new Contact(FirstName = 'John', LastName = 'Smith', Email = 'js@gmail.com');
    try {
       insert duplicateContact;
    }
    catch (Exception e) {
       System.debug('We want to see this.  This means the trigger is working.');
    } 
   }
}

 

 Help!!!

  • July 13, 2010
  • Like
  • 0

I am getting the error "Loop must iterate over a collection type: SOBJECT: ROI__c" coming from the second loop in the excerpt below.

 

Not sure how to resolve...

 

 

Set <id> studentListIds = new set <id> ();

for (Student__c aa :studentList) {
     studentListIds.add (aa.id);
}
	
ROI__c roiStudentList = [select Id, Related_Student__c from ROI__c where Related_Student__c in :studentListIds];
		
for(ROI__c xx : roiStudentList) {
     System.assertNotEquals(null, xx.Related_Student__c);
}

 

 

 

 

  • April 06, 2010
  • Like
  • 0