You need to sign in to do that
Don't have an account?
Zoom_V
Trying to use a Today() on a Date field
I have the following class which I am using with an Email Service. I decided to put Today() into one of the fields in the object which would be receiving the InboundEmail, but I am getting a "Compile Error : Method does not exist or incorrect signature : Today()"
Here is the code :
Anybody have any ideas ....?
Thank you very much for any help.
Here is the code :
global class VendorEmail implements Messaging.InboundEmailHandler { Vendor_Notes__c[] NewVendorNotes = new Vendor_Notes__c[0]; global Messaging.InboundEmailResult handleInboundEmail( Messaging.InboundEmail email, Messaging.InboundEnvelope envelope) { Messaging.InboundEmailResult result = new Messaging.InboundEmailresult(); // Captures email info String emailAddress = envelope.fromAddress; String fName = email.fromname.substring( 0,email.fromname.indexOf(' ')); String lName = email.fromname.substring( email.fromname.indexOf(' ')); String[] emailBody = email.plainTextBody.split('\n', 0); String phoneNumber = emailBody[0].substring(6); //Associates email to proper Vendor Profile //var today = new Date(0); Vendor_Profile__c venpro; venpro = [select ID,ACH_Status__c from Vendor_Profile__c where name = :email.subject limit 1]; ID jobId = venpro.ID; venpro.Date_of_Latest_Compliance_Certificate__c = Today(); Update venpro; try { NewVendorNotes.add(new Vendor_Notes__c(Sender__c = emailAddress, Vendor__c = jobId, Routing_Number__c = lName, Account_Number__c = phoneNumber )); insert NewVendorNotes; //Save any Binary Attachment if (email.binaryAttachments != null) { for(Messaging.Inboundemail.BinaryAttachment bAttachment : email.binaryAttachments) { Attachment attachment = new Attachment(); attachment.Name = bAttachment.fileName; attachment.Body = bAttachment.body; attachment.ParentId = venpro.Id; insert attachment; } } } catch (System.DmlException e) { //Save any Binary Attachment if (email.binaryAttachments != null) { for(Messaging.Inboundemail.BinaryAttachment bAttachment : email.binaryAttachments) { Attachment attachment = new Attachment(); attachment.Name = bAttachment.fileName; attachment.Body = bAttachment.body; attachment.ParentId = venpro.Id; insert attachment; } } } return result; } }
Anybody have any ideas ....?
Thank you very much for any help.
Andy Boettcher
Use "System.Today()".
Zoom_V
Thanks Andy !