You need to sign in to do that
Don't have an account?
Frances Allen
Update failed. First exception on row 0; first error: MISSING_ARGUMENT, Id not specified in an update call: []
I know that this error is referring my user update in line 14, but appears to be a mistake that is actually masking another mistake as I've already identified the user id with contact id in my code.
My full error upon deployment is :
System.DmlException: Update failed. First exception on row 0; first error: MISSING_ARGUMENT, Id not specified in an update call: []
Stack Trace: Class.IncompleteWorkshopLogsTest.testOnlyIncompleteWorkshopsReturned: line 14, column 1
Line 14 is
Tests have been a major roadblock in getting things deployed here, so any assistance would be appreciated.
Thanks,
Frances
My full error upon deployment is :
System.DmlException: Update failed. First exception on row 0; first error: MISSING_ARGUMENT, Id not specified in an update call: []
Stack Trace: Class.IncompleteWorkshopLogsTest.testOnlyIncompleteWorkshopsReturned: line 14, column 1
Line 14 is
update u;The controller is here:
@isTest public class IncompleteWorkshopLogsTest { @isTest private static void testOnlyIncompleteWorkshopsReturned() { //create contact Contact c = new Contact(FirstName='Test', LastName = 'Test'); insert c; User u = new User(); u.ContactId = c.Id; update u; //tie teaching to a volunteer and contact id Workshop_Signup__c incompleteLog = new Workshop_Signup__c( Volunteer__c = c.Id ); insert incompleteLog; Workshop_Signup__c completeLog = new Workshop_Signup__c( Volunteer__c = c.Id ); insert completeLog; //create and insert a workshop log that would indicate one finished vs. unfinished Workshop_log__c unfinished = new Workshop_log__c(RCM_A9__c = ''); Workshop_log__c finished = new Workshop_log__c(RCM_A9__c = 'Complete'); // tie workshop log to teaching record incompleteLog.Id = unfinished.Id; completeLog.Id = finished.Id; insert unfinished; insert finished; insert new List<Workshop_Signup__c> { completeLog, incompleteLog }; Test.startTest(); IncompleteWorkshopLogs controller = new IncompleteWorkshopLogs(); List<Workshop_Signup__c> results = controller.getTeaching(); update results; Test.stopTest(); System.assertEquals(1, results.size()); System.assertEquals('Complete', results[0].Workshop_Log_Status__c); } }
Tests have been a major roadblock in getting things deployed here, so any assistance would be appreciated.
Thanks,
Frances
Is it required to update the user, then question is which user should update?
If trying to crete new community user then use insert after putting mandatory field instead of update at line 14.