• xpl0id
  • 0 Points
  • Member since 2011

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 1



I'm writing a small app, that will bulk merge contacts, using partner WSDL.

Here is code that i'm using:


private SObject createSObject(String ID,String type)
        SObject result = new SObject();
        return result;

private void merge(String MasterID,String type, String ChildID)
        connection = Auth.getConnection();
        MergeRequest mReq = new MergeRequest();
        mReq.setMasterRecord(createSObject(MasterID, type));
        mReq.setRecordToMergeIds(new String[] { ChildID });
        MergeRequest[] mergeBatch = new MergeRequest[1];
        mergeBatch[0] = mReq;
        MergeResult[] mRes = connection.merge(mergeBatch)

When i'm trying to merge two contacts, and child has a donation, i get an error:

"Contacts tied to Donations cannot be deleted."

Isn't it suppose to remap donations also? 



  • November 21, 2011
  • Like
  • 0

I have a client who has some code that automatically adds a notes task when a case is closed. It works fine except when a portal user closes their case, then I get this error:


First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, Portal user can't own an activity: []


Is there a way to get around this issue and still insert an activity record when running as a PU? Can I override the user session limitations and add records as a system admin in the class?