You need to sign in to do that
Don't have an account?
Dave The Rave
Some of the fields are picklist fields and some are boolean, maybe this is the issue.
There is also a standard field 'type' but when I add it too the code, the text is always purple.
Error is line 2 unexpected token 'acct'
DML code to create case record not working
// Create the case record sObject Case acct = new Case(type='Sample' RecordTypeID='0122o000000tZzcAAE' origin='Web', optinemail__c=TRUE, optinperson__c=TRUE, webcountry__c='GB', description='test David ', websiteorigin__c='service.nl'); // Insert the account by using DML insert acct; // Get the new ID on the inserted sObject argument ID acctID = acct.Id; // Display this ID in the debug log System.debug('ID = ' + acctID);All, I would like to create 1 case record using a DML statement, but I keep getting errors, can you see what is wrong with my code?
Some of the fields are picklist fields and some are boolean, maybe this is the issue.
There is also a standard field 'type' but when I add it too the code, the text is always purple.
Error is line 2 unexpected token 'acct'
You missed "," in few places.
// Create the case record sObject Case acct = new Case(type='Sample' ,
RecordTypeID='0122o000000tZzcAAE' ,
origin='Web',
optinemail__c=TRUE,
optinperson__c=TRUE,
webcountry__c='GB',
description='test David ',
websiteorigin__c='service.nl');
insert acct;
Id acctID = acct.Id;
System.debug('ID = ' + acctID);
Please Like it if this would leads to problem solves.
Thanks,
Naresh
Try The Below Code
Please Don't Forget To Mark It As best Answer If it Helps Please Don't Forget To Mark It As best Answer If it Helps
Thank You!