I'm getting the following error in the following method:
Initial term of field expression must be a concrete SObject: Datetime
method:
private Order_Activity__c createOrderActivity(string salesOrderId, string ownerId, string locationId, string recordtypeId, string activity, string status, string separation, string screen,
string ink, string workCenterId, datetime startTime) {
Order_Activity__c oa = new Order_Activity__c();
oa.Sales_Order__c = salesOrderId;
oa.Sales_Order_Owner__c = ownerId;
oa.Location_Number__c = locationId;
oa.RecordTypeId = recordtypeId;
oa.Activity__c = activity;
oa.Activity_Status__c = status;
oa.Separation_Status__c = separation;
oa.Screen_Status__c = screen;
oa.Ink_Status__c = ink;
oa.Work_Center__c = workCenterId;
DateTime dt = startTime;
oa.Start_Time__c = DateTime.newInstance(dt.Start_Time__c.yearGmt(), dt.Start_Time__c.monthGmt(), dt.Start_Time__c.dayGmt(), 12, 0, 0);
return oa;
}
The error occurs on this line:
oa.Start_Time__c = DateTime.newInstance(dt.Start_Time__c.yearGmt(), dt.Start_Time__c.monthGmt(), dt.Start_Time__c.dayGmt(), 12, 0, 0);
Thanks for any help.
dt.Start_Time__c
. I think you mean justdt
– Jeremy Nottingham Apr 30 '15 at 21:01