Can we enable SObject dynamically in Salesforce (apex)?

Is dynamic SObject conversion possible?

Example:

I know that we can do this:

(Account) Sobject

But I want to do this as a return type of sObject changes based on specific parameters.

(Dynamically Passing the Name) SObject

Any road around will be useful ... Thanks in advance.

+4
source share

All Articles