• Jon Skinner
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
Hi,
We are a charity based in the UK, and I think we need some alternative to the standard integration app from Mailchimp.  We don't have a problem with Mailchimp as such, but the sychronisation app it provides as standard doesn't meet our needs.
Our main requirements are:
  1. Ability to link to more than one Mailchimp account.  We have three accounts already (and no, we can't  merge them), and may have more in future.  The standard app will only link to one account.
  2. A way to get unsubscribe notifications, as well as new subscriptions, and get both in a timely fashion.
  3. We have several lists in Mailchimp, and our contacts have a tendency to subscribe to different ones with different email addresses.  We need to avoid duplication of contacts as a result of multiple subscription notices from the same contact using different email addresses. We also have multiple contacts who will share the same emails address (e.g. married couples), and we need to be able to know which of them an email in Mailchimp corresponds to.  This would actually be a useful thing for all our contacts.
We are thinking we may need to get some development work done, but before we do I wondered if anyone else had ever needed this sort of thing doing, or if it is even possible (especially linking third party integrations to Mailchimp), or if there is something that will do this already? And failing that, if anyone knows and alternative to Mailchimp that does, or could be made to, do this?
Hi,

Bear with me, I'm new to this and I expect it's a simple problem, but it has stumped me.

I'm trying to write a unit test for a trigger that fires after inserting a record in a custom object, and updates some data from the custom object into the standard Contact object.  The trigger works fine when I test it in the sandbox, and updates everything as I want, but I can't manage to write the unit test so I can deploy it to production!

In order to write the test I assume I need to create a test contact record for the trigger to update, and have written code to do this.  However, when I run the test, it fails at the point of inserting the test contact record with the folowing errors:

Class.SBCopyResToContactTest.TestContUpdate: line 13, column 1
and
System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Failed to create Account for Contact null TestName. Record Type ID: this ID value isn't valid for the user: 012b0000000DiUUAA0: []

The code in question is:

12: Contact testCon = new Contact(LastName = 'TestName');
13: insert testCon;

The infuriating thing is that if I run those two lines of code in the 'execute anonymous' window they work fine, and create the contact record no problem, in the sandbox and in the production org.  But in the apex unit test they fail.

We are a non-profit organization, and are using the Non Profit Success Pack with Household account types.  From what I can make out from that error message it looks as if it may be trying to create the account with the wrong record type (that I'd is certainly not the correct one for the account records.  But as I said, if I exceute the code outside the unit test it runs, and the account is created with the correct record type.  The other, worse case, scenario is that it's a custom code or validation (we've had some outside development done).

Any suggestions would be much appreciated, even a hit as to why it works 'anonymously' and not in the test would help!
Hi,

Bear with me, I'm new to this and I expect it's a simple problem, but it has stumped me.

I'm trying to write a unit test for a trigger that fires after inserting a record in a custom object, and updates some data from the custom object into the standard Contact object.  The trigger works fine when I test it in the sandbox, and updates everything as I want, but I can't manage to write the unit test so I can deploy it to production!

In order to write the test I assume I need to create a test contact record for the trigger to update, and have written code to do this.  However, when I run the test, it fails at the point of inserting the test contact record with the folowing errors:

Class.SBCopyResToContactTest.TestContUpdate: line 13, column 1
and
System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Failed to create Account for Contact null TestName. Record Type ID: this ID value isn't valid for the user: 012b0000000DiUUAA0: []

The code in question is:

12: Contact testCon = new Contact(LastName = 'TestName');
13: insert testCon;

The infuriating thing is that if I run those two lines of code in the 'execute anonymous' window they work fine, and create the contact record no problem, in the sandbox and in the production org.  But in the apex unit test they fail.

We are a non-profit organization, and are using the Non Profit Success Pack with Household account types.  From what I can make out from that error message it looks as if it may be trying to create the account with the wrong record type (that I'd is certainly not the correct one for the account records.  But as I said, if I exceute the code outside the unit test it runs, and the account is created with the correct record type.  The other, worse case, scenario is that it's a custom code or validation (we've had some outside development done).

Any suggestions would be much appreciated, even a hit as to why it works 'anonymously' and not in the test would help!
I was solving this challenge and my VF code is:

<apex:page standardController="Account" recordSetVar="Accounts" >
    <apex:pageblock>
        <apex:repeat var="a" value="{!Accounts}" rendered="true"  id="account_list">
            <li>
                <apex:outputLink value="https://ap1.salesforce.com/{!a.ID}" >
                    <apex:outputText value="{!a.Name}"/>
                </apex:outputLink>
            </li>
        </apex:repeat>
    </apex:pageblock>
</apex:page>

I am getting the list of accounts as required and on clicking on any of the accouts, it redirects to that accounts detail page.
Still I am getting following error from trailhead:

"The page does not bind to the record ID value (in order to link to the record detail page)"