none
Error Out When Loading Assignments Using JSOM API RRS feed

  • Question

  • The Application page running on SharePoint 2013, is using JSOM API to load current resource's assignments. Most of the time the page works fine. When project manager saves the draft task and publish on project client tool, sometimes the error message pop up. Does anyone know why this error pop up and how to fix it? 


    Error message:
    "Failed to get assignemnts. Error: PJClientCallableException: GeneralUnhandledException GeneralUnhandledException = System.Data.Constraints.One or more rows contain values violating non-null, unique, or foreign-key constraints.at System.Data.DataSet.EnableConstraints()...."

    projUser = pwaWeb.get_currentUser();
    currentResource = PS.EnterpriseResource.getSelf(projContext); 
    assignments = currentResource.get_assignments();  
    projContext.load(assignments,'Include(Id, Name, RegularWork, ActualWork, PercentComplete, RemainingWork, Start, Finish)');
    projContext.executeQueryAsync(onGetAssignmentsSuccess,
    function (sender, args) {
                alert('Failed to get assignments. Error: ' + args.get_message());
            });
    

    Friday, May 1, 2015 10:20 PM