• Venkat Test
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Hi All,

Is anyone using aside.io?. In aside.io there is a option called "manage local code history".  And it is asking for "number of file versions to store in local history". Which location this local history is storing. Is it storing our local systems or some other place. If I want get code change history , where I can get it. Please help me.

Hi Guys,

I am trying to merge two contacts. Class is using the keyword  "without sharing". So the the class is running in system admin mode. I have checked the system admin profie, the profile is having all permissions(DELETE contact, MODIFY ALL DATA on contact).

I am calling this class on another class , that parent class is also using the keyword "without sharing". But still I am getting below error:
Merge failed. First exception on row 0 with id 0031100000XXYfRAAX; first error: INSUFFICIENT_ACCESS_OR_READONLY, cannot merge with entity that is not accessible: []

Below is class code:

public without sharing class DeleteContact {
    public void deleteContact(String contactId,string email){
        Map<String, Schema.SobjectField> contactfields = Schema.SObjectType.contact.fields.getMap();
        List<Schema.SObjectField> fldObjMapValues = contactfields.values();
        string theQuery1;
        string theQuery2;
        String theQuery = 'SELECT ';
            for(Schema.SObjectField s : fldObjMapValues)
            {
               String theLabel = s.getDescribe().getLabel();
               String theName = s.getDescribe().getName();
               theQuery += theName + ',';
            }
            theQuery = theQuery.subString(0, theQuery.length() - 1);
          
            theQuery1 = theQuery + ' FROM Contact WHERE Id =: contactId';
            theQuery2 = theQuery + ' FROM Contact WHERE Id !=: contactId AND Email =: email';
          
      
        Contact previouscontact=Database.query(theQuery1);
        List<Contact> listContacts=Database.query(theQuery2);
        if(previouscontact!=null && listContacts[0]!=null){
            try{
                merge  previouscontact listContacts[0];
            }
            catch(Exception e){
                system.debug('============='+e.getMessage());
            }
    }
}


Can some one please suggest me why this error is coming?. Urgent Please.

Hi Guys,

I am trying to merge two contacts. Class is using the keyword  "without sharing". So the the class is running in system admin mode. I have checked the system admin profie, the profile is having all permissions(DELETE contact, MODIFY ALL DATA on contact).

I am calling this class on another class , that parent class is also using the keyword "without sharing". But still I am getting below error:
Merge failed. First exception on row 0 with id 0031100000XXYfRAAX; first error: INSUFFICIENT_ACCESS_OR_READONLY, cannot merge with entity that is not accessible: []

Below is class code:

public without sharing class DeleteContact {
    public void deleteContact(String contactId,string email){
        Map<String, Schema.SobjectField> contactfields = Schema.SObjectType.contact.fields.getMap();
        List<Schema.SObjectField> fldObjMapValues = contactfields.values();
        string theQuery1;
        string theQuery2;
        String theQuery = 'SELECT ';
            for(Schema.SObjectField s : fldObjMapValues)
            {
               String theLabel = s.getDescribe().getLabel();
               String theName = s.getDescribe().getName();
               theQuery += theName + ',';
            }
            theQuery = theQuery.subString(0, theQuery.length() - 1);
          
            theQuery1 = theQuery + ' FROM Contact WHERE Id =: contactId';
            theQuery2 = theQuery + ' FROM Contact WHERE Id !=: contactId AND Email =: email';
          
      
        Contact previouscontact=Database.query(theQuery1);
        List<Contact> listContacts=Database.query(theQuery2);
        if(previouscontact!=null && listContacts[0]!=null){
            try{
                merge  previouscontact listContacts[0];
            }
            catch(Exception e){
                system.debug('============='+e.getMessage());
            }
    }
}


Can some one please suggest me why this error is coming?. Urgent Please.