Help get this topic noticed by sharing it on Twitter, Facebook, or email.

AccountContactRelation updates fail

I have observed a problem that occurs with Winter 17 and Financial Services Cloud 210.7 (FSC). I have opened a ticket with Salesforce, but I also wanted to consult with DBAmp support because the update failure occurs while updating via DBAmp but is successful using anonymous Apex via the developer console.

What I have done is develop a feed routine to manage our client to household relationships. This data routinely changes over time as clients move or the householding process corrects their address and status. The household reference is updated on both the Contact and Account (Individual) records, and an AccontContactRelation record (ACR) is also required to relate the Contact Id to the Account Id of the Household record. For balance rollups to work in the FSC there must be a primary group, but only 1 active primary group. In earlier editions of the FSC it was not possible to delete the ACR or update the Account Id, so the feed was designed to identify update cases and first update the ACR to set it inactive, and then insert a new ACR to relate the Contact to the revised Household.

The problem is that the updates to set inactive are all failing.This is the DDL for the update table:
CREATE TABLE dbo.AccountContactRelation_HouseholdAssignment_SF_Update (
Queue_Seq_No bigint not null
, Id nchar(18) not null
, Error nvarchar(255)
, IsActive varchar(5) not null
, Index IDX_AccountContactRelation_HouseholdAssignment_SF_Update Clustered (Queue_Seq_No)
)

This is an example output from SF_BulkOps:
08:58:38: DBAmp Bulk Operations. V3.5.7 (c) Copyright 2006-2017 forceAmp.com LLC
08:58:38: Updating Salesforce using AccountContactRelation_HouseholdAssignment_SF_Update (server / database) .
08:58:38: DBAmp is using the SQL Native Client.
08:58:39: SOAP Headers:
08:58:39: Warning: Column 'Queue_Seq_No' ignored because it does not exist in the AccountContactRelation object.
08:58:42: 33 rows read from SQL Table.
08:58:42: 33 rows failed. See Error column of row for more information.
08:58:42: 0 rows successfully processed.
08:58:42: Errors occurred. See Error column of row for more information.

This is the error column from one of the update records:
A contact can have only one primary group.
FinServ.AccountContactRelationTrigger: execution of AfterUpdate
caused by: FinServ.MoiExceptionWrapper.TriggerException: Something's not quite right. Try your action again, and if the issue continues, contact your administrator for help. (FinServ)

This clearly appears to be an FSC change that is preventing the update. However, it does not explain why the following anonymous Apex works:

AccountContactRelation obj;
obj=[
Select Id
From AccountContactRelation
Where Id='07k41000008P0kdAAC'
];

if (obj ==null) {
system.debug('obj is null');
} else {
obj.IsActive=false;
update obj;
system.debug('obj has been updated to inactive');
}

10:14:39:859 USER_DEBUG [13]|DEBUG|obj has been updated to inactive

Note that I am logging into the same instance using the credentials used for the DBAmp account to have the same exact profile / permissions as the automated feed script.

Unfortunately this is causing issues in our production database that cannot wait until the instance is upgraded to Spring 18, Financial Services Cloud 212.3. which does not appear to have this issue.
1 person has
this problem
+1
Reply
  • There is not much DBAmp can do. The error message:

    A contact can have only one primary group.
    FinServ.AccountContactRelationTrigger: execution of AfterUpdate
    caused by: FinServ.MoiExceptionWrapper.TriggerException: Something's not quite right. Try your action again, and if the issue continues, contact your administrator for help. (FinServ)

    comes from the salesforce server and we are merely reporting it.

    Your async test case is not applicable because it is only doing a single record. APEX triggers work in bulk. Most coding errors we see are because the APEX trigger author has not "bulkified" their trigger code. We do not write much trigger code so I am unable to provide more guidance. If you Google "salesforce APEX trigger bulk" you can find a number of articles.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • Update: The same error occurs if using data loader to update a record, so this is not DBAmp specific, but occurs whenever the Force.com API is used.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • I’m thankful
    Thanks Bill, we cannot do anything about the trigger code either as it is part of the FSC managed package. I thought this might be DBAmp specific due to the difference between Apex and DBAmp update results, but Data Loader encounters the same problem, so I will just have to see what the official Salesforce response is. I figured I would try this forum first as it takes several days to get the case escalated to someone who can help out at Salesforce, while DBAmp responses are much faster.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited sad, anxious, confused, frustrated