You need to sign in to do that
Don't have an account?
kunal kaushik 13
I have a SOQL Query in String form and i want to get the Object name on which the query is running. How can i do so?
Example : String str = ' SELECT Name,Id FROM Account LIMIT 10';
Now i want to retrieve "Account" from this query for further use.
Now i want to retrieve "Account" from this query for further use.
String objectName = objectId.getSobjectType().getDescribe().getName();
if it helps please mark as correct, it may help others
Use the below Code.
Mark, It as best answers If it helps you
Thanks,
Foram Rana