Coder Social home page Coder Social logo

Comments (21)

ReidCarlberg avatar ReidCarlberg commented on July 28, 2024

Seem like two different issues. #22 is about the 500 record following limit (still 500?). This appears to be that a user can follow anything, let alone more. @brountre is this a real user or one created during testin? Is it a clean dev org or was it populated? I ask b/c i 'm not able to reproduce in a clean org.

from milestones-pm.

tompatros avatar tompatros commented on July 28, 2024

Haven't seen this error come up either in a couple of installs. Crazy question: is Chatter enabled in the org?

from milestones-pm.

brountre avatar brountre commented on July 28, 2024

Interestingly if I disable chatter the test passes.

On Tue, Jan 24, 2012 at 8:49 AM, Tom Patros <
[email protected]

wrote:

Haven't seen this error come up either in a couple of installs. Crazy
question: is Chatter enabled in the org?


Reply to this email directly or view it on GitHub:

#51 (comment)

from milestones-pm.

brountre avatar brountre commented on July 28, 2024

The user is the admin user. It isn't a clean org, it had several classes
unrelated to Milestone PM. The developer org has been around for quite
sometime. I will try a new org and test again.

Thanks,
Bryan

On Tue, Jan 24, 2012 at 7:34 AM, ReidCarlberg <
[email protected]

wrote:

Seem like two different issues. #22 is about the 500 record following
limit (still 500?). This appears to be that a user can follow anything,
let alone more. @brountre is this a real user or one created during
testin? Is it a clean dev org or was it populated? I ask b/c i 'm not
able to reproduce in a clean org.


Reply to this email directly or view it on GitHub:

#51 (comment)

from milestones-pm.

ReidCarlberg avatar ReidCarlberg commented on July 28, 2024

We're you able to reproduce in a new org?

from milestones-pm.

brountre avatar brountre commented on July 28, 2024

No, when I created a new dev org. The test failures went away. I'm
currently stuck on another project at the moment, but I do want to get back
around on this and figure out the root cause.

Thanks for the follow up.

Bryan
On Mon, Feb 6, 2012 at 7:42 PM, ReidCarlberg <
[email protected]

wrote:

We're you able to reproduce in a new org?


Reply to this email directly or view it on GitHub:

#51 (comment)

from milestones-pm.

dostal76 avatar dostal76 commented on July 28, 2024

Hi Reid, I am also experiencing this problem. Getting
"System.DmlException: Update failed. First exception on row 0 with id a0BT00000091A2XMAU; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Insert failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, This user cannot follow any other users or records: []: []"

When I disable Chatter it runs fine, but when enabled, I get the above. Now when trying to deploy anything else, this is stopping me from deploying my code as I can no longer disable Chatter in production.

Any advice on this?

from milestones-pm.

fengxia41103 avatar fengxia41103 commented on July 28, 2024

I encountered the exact problem as dostal76 above.

System.DmlException: Update failed. First exception on row 0 with id a0i40000000wDpxAAE; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Insert failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, This user cannot follow any other users or records: []: []

Class.Milestone1_Task_Chatter_Tst.testChatterTaskReassignment: line 95, column 1

Pasting the code below:

EntitySubscription subscription = [Select Id, ParentId, SubscriberId from EntitySubscription where ParentId =: testTask.Id];
//assert that the user is following this object
system.assertEquals(UserInfo.getUserId(),subscription.SubscriberId);
system.debug('Other User Id == ' + otherUser.Id + 'Task Assigned Id ==' + testTask.Assigned_To__c);
testTask.Assigned_To__c = otherUser.Id;
update testTask;

This is also blocking us from deploying a new application. Any advice would be highly appreciated.

from milestones-pm.

ReidCarlberg avatar ReidCarlberg commented on July 28, 2024

What's the sharing model on Milestone1_Milestone__c?

from milestones-pm.

fengxia41103 avatar fengxia41103 commented on July 28, 2024

Reid, How to look that up?

from milestones-pm.

fengxia41103 avatar fengxia41103 commented on July 28, 2024

If you are referring to "API Name Milestone1_Milestone__c", then there isn't Apex Sharing Reasons or Apex Sharing Recalculation.

Milestone PM has been deployed and in production for 3-4 months without issues. During deployment I remember checking the "ignore error" option. We have recently deployed another application successfully. So only now the test is blocking us from deploying a new class and a page.

Is there any workaround that we can deactivate this test? edit and comment out the offending lines?

from milestones-pm.

ReidCarlberg avatar ReidCarlberg commented on July 28, 2024

You can definitely edit the test. What version do you have installed? Current is 1.51

from milestones-pm.

fengxia41103 avatar fengxia41103 commented on July 28, 2024

I don't see there is an "edit" option in production.

Version is 1.53, deployed 10/28/2011 to be exact.

How should I proceed? Please advise.

from milestones-pm.

ReidCarlberg avatar ReidCarlberg commented on July 28, 2024

You won't have an edit in prod. Needs to be in the sandbox. Should be able to edit in sandbox and push over. Alternatively, if you don't have a sandbox, you could push from a dev edition.

from milestones-pm.

fengxia41103 avatar fengxia41103 commented on July 28, 2024

Interesting, the same test passed in Sandbox. This makes me thinking that it has something to do with data limit.

I commented out the "assert" line in Sandbox and put the class in a changeset. But it got blocked when validating in production. How to override the one in production? This is the first time we deploy in-house developed application in SF, so apologize ahead for asking SF questions here.

from milestones-pm.

fengxia41103 avatar fengxia41103 commented on July 28, 2024

This is what I ultimately did to remove the test failure in production:

  1. Force.com IDE to create a new project and pull by application "Milestone PM". This will pull all components, classes, .... to the project.
  2. Edit class Class.Milestone1_Task_Chatter_Tst.testChatterTaskReassignment:

a. commented out these two lines:
//testTask.Assigned_To__c = otherUser.Id;
//update testTask;

b. Changed this line actual from 0 to 1.
system.assertEquals(1,subscriptionList.size());

Save to server. The test passed, 52% coverage.

from milestones-pm.

ReidCarlberg avatar ReidCarlberg commented on July 28, 2024

Cool. Are you up and running now?

from milestones-pm.

fengxia41103 avatar fengxia41103 commented on July 28, 2024

Yes. At least now there is a way to update classes in Production.

I'll spend sometime to look into the error once this deployment is all done. If there is anything I'll let you know. Thanks for the app. It's really nice.

from milestones-pm.

ToddAH avatar ToddAH commented on July 28, 2024

we are running the Managed Package version 1.57 and are getting the same test failure in our sandbox.

LABSMPM.Milestone1_Task_Chatter_Tst.testChatterTaskReassignment 512.0 System.DmlException: Update failed. First exception on row 0 with id a0kV0000000MFcwIAG; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Insert failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, This user cannot follow any other users or records: []: []

Schedule to try this installation into our production org this week. Is there a way I can update the managed package to verify it will install and not block other change set deployments?

from milestones-pm.

ReidCarlberg avatar ReidCarlberg commented on July 28, 2024

April 2012 Milestone work-- ensure the code isn't selecting a random user. That's guaranteed to be a flapper test. Replace the code that is selecting a random user with code that is creating a specific type of user.

Example of error in Partner Dev org -- https://skitch.com/reidcarlberg/8u1ig/salesforce.com-developer-edition -- this is after install, with simple initialization and then a run all tests from the Apex Classes screen.

Here's the offending code -- it's basically just grabbing any old user (in this case it get's a portal user) and should create a new test user instead. Add this code to the Milestone1 Test Utilities class and use it to create users instead. https://github.com/ForceDotComLabs/ActionPlans/blob/master/src/classes/ActionPlansTestUtilities.cls

      return; //chatter is disabled - we can't run this test. 
    List<User> otherUserList = [Select Id from User where Id <> :UserInfo.getUserId() and IsActive = true limit 1];
    User otherUser = null;
    if(otherUserList.size() == 0)
    {
        List<Profile> prof = [Select Id from Profile limit 1]; 
        otherUser = new User(Alias='testxyz1',emailencodingkey='UTF-8', languagelocalekey='en_US',timezonesidkey='America/Los_Angeles',  CommunityNickname='XYZTEST12301', FirstName='Test Account', LastName='LastName', Email='[email protected]', username='[email protected]',localesidkey='en_US', ProfileId=prof.get(0).Id);
        insert otherUser;

from milestones-pm.

kbentsen avatar kbentsen commented on July 28, 2024

I am also having issues with these errors. I replicated @fengxia41103 fixes, but now I am receiving different errors:

Failure Message: "System.QueryException: invalid ID field: null", Failure Stack Trace: "Class.Milestone1_Task_Chatter_Tst.testChatterTaskFollows: line 50, column 1"

I am also receiving the following error that I would not know how to address:

Failure Message: "System.AssertException: Assertion Failed: Expected: 3418.99000000000000000000000000000000000196, Actual: 3418.990000000000000000000000000000000003", Failure Stack Trace: "Class.Milestone1_Test_Field_Values.testFieldValues: line 278, column 1"

I've done both editing the classes in my Sandbox as well as in the Force.com IDE and attempting to deploy to production, but to no avail. I really want to get these resolved as it is holding up some changes I'm looking to add to my production.

Thanks

from milestones-pm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.