You need to sign in to do that
Don't have an account?
Igor Androsov 22
Set Record Type on generic SObject
I want to update a Record Types on any Sobject regardless what type it is and seem not able to find correct API in APEX
Did try Describe calls that does not do it like this one
sObject sObj = Schema.getGlobalDescribe().get(ObjectName).newSObject() ;
Code below will be great if it worked, in Winter 18 has Syntax errors and methods are not found.
SObject record = Id.valueOf('a0Ci000000vd7xA').getSObjectType.newSObject();
record.put('RecordTypeId', <place ID object here>);
Any other ideas that do work!
Did try Describe calls that does not do it like this one
sObject sObj = Schema.getGlobalDescribe().get(ObjectName).newSObject() ;
Code below will be great if it worked, in Winter 18 has Syntax errors and methods are not found.
SObject record = Id.valueOf('a0Ci000000vd7xA').getSObjectType.newSObject();
record.put('RecordTypeId', <place ID object here>);
Any other ideas that do work!