• PaulFischerSaaS
  • NEWBIE
  • 5 Points
  • Member since 2013


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
I have a Policy object that has a field called Partner Code. I have an Account object that also has a Partner Code field on it. The Account partner codes are already in the system, and new Policy records are fed in the system with partner codes. 

I have a lookup field on the Policy object called Partner Account, which looks up to the Account. I need to update this field with the matching Account if the partner codes on both records match. What is the best general approach for this? I tried to complete this with process builder without success. 
Hi all

I have an after update Trigger which runs off AgentWork. If the WorkItemId of the AgentWork record is a Case and field AcceptDateTime changes, then the Trigger updates a field on the related Case.

Now, all of that works like a charm. However, writing a Unit Test Class for this has proven slightly tricky and I'm hoping someone in here can help me with that.

I keep getting this error: "System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, The agent's status is not associated with the channel for this work.: [ServiceChannelId]"

The User inserting the AgentWork record in the Unit Test Class has a Profile which is coupled with our ServiceChannel and the AgentWork record I'm trying to insert has ServiceChannelId, WorkItemId (Id of Parent Case) and UserId (of User with correct Profile) set.

What am I missing?

Thanks in advance.

Søren Nødskov Hansen
Something Cloud

Our organization would like to convert all Person Accounts to Contacts. We would like the converted contact to be connect to an account named, "Generic Contact."  I looked into this a little and this is what I found out. 

 

Option 1:

Each Person Account has a record in both the Account table and Contact table.  The Contact table holds all the Person Acount information.  The Contact table has a field called IsPersonAccount which is marked true. I would like to change the IsPersonAccount to false, change the AccountId to that of the "Generic Contact" account and Delete the Account with the old AccountId.

 

Whenever I try to change the IsPersonAccount to false, I get an error "INVALID_FIELD_FOR_INSERT_UPDATE".

 

Option 2:

Now I can export the contacts to a csv file and  filter out all contacts with business accounts leaving the Person Accounts.  Then I can delete all Person Accounts and import the people in my csv file as contacts.  Finally, reconnect all compaigns using the PHP API.  

 

 

I would much rather change the AccountId and IsPersonAccount fields  (much less work).  Is there anyway to do option 1 or is there a better way of converting PersonAccounts to Contacts?