• Erica Cox
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 11
    Questions
  • 3
    Replies
Suddenly all users are getting an Insufficient Privileges error when trying to access a VF page in our org. Even sys admins. The page hasn't changed, the controller hasn't changed, all profiles still have access to the page and controller, and all static resources referred to in the page are accounted for. Nothing in the setup audit trail since yesterday when things were running normally.
My client is migrating to SF from a legacy system.  We need to migrate about 200K files into ContentVersion.  I have started using DataLoader and a csv file as described in the SF documentation, with about 10K records per file, but it is going REALLY slowly,  Also, the DataLoader will occasionally error out on me for various reaons and I'm havng trouble opening the success files.  Anyone out there had to do something similar and have any tips for me?
Hi,

I am having a problem that I investigated down to this very simple minimalistic example that can be reproduced easily.

1) Create a workflow rule on the Account object that will send an email to the sales team when an account is created

2) Create a Unit Test like this:

static testMethod void Test_TestWS() {
     Account customer = new Account( Name = 'A' );
     INSERT customer;
 
      Test.startTest();
      Test.setMock(HttpCalloutMock.class, new UTest_Mock_HttpResponseGenerator());

       MyClass.CallWebService(customer.Id);
      Test.stopTest();
}

When executing the unit test I get this:
   System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out

What is the best practice to avoid this problem. I am following all guidelines in order to Mock my web service and to make sure that startTest is called AFTER my test data is inserted.

It looks like the workflow rule has some pending update in the DB that is not comitted on the startTest which causes the problem.

If I Deactivate the workflow rule, my test runs fine.

Thanks

Hugo