This will be very helpful in getting the object token without making one more describe call if already in the code we have the List of ID's or ID.
Here is the small snippet i ran in new enhanced developer console(Pretty excited about this new console)
Id accid=[Select Id from Account Limit 1].ID; Schema.Sobjecttype inspecttype=accid.getSObjectType(); system.debug('Object Token '+inspecttype);
23:33:30:025 USER_DEBUG [3]|DEBUG|Object Token AccountAs seen above this method works great if your sandbox has been updated
Also this method will help in methods where only primitive types can be passed as a parameter like @future where parameter cannot be sObject.
No comments:
Post a Comment