
Any help is greatly appreciated, thanks in advance!Schema.SObjectType quoType = Schema.getGlobalDescribe().get('quote');
sObject quo = quoType.newSObject();
//This works just fine
quo.put('Email', 'generic@email.com');
//I've tried different variations of this, none seem to work
quo.put('AccountId' , SOME_ID);
quo.put('Account', SOME_ID);
2 answers
This is because the AccountId field is not editable. You have to set the OpportunityId field and then it will pull the AccountId field from the Opportunity. quo.put('OpportunityId', oppId);