Skip to main content
added 157 characters in body
Source Link
Doug B
  • 11.5k
  • 1
  • 37
  • 44

The question is, why do you want the record type id? Is it so that you can limit your query? In that case

Select Id
From account
where RecordType.developername = 'Business'

and you have saved a query :)

You can also use it on related objects

Select Id
From case
where account.RecordType.developername = 'Business'

And if you really need the ID for some reason, maybe you can get it while you are getting your data?

Select Id, RecordTypeID
From account

The question is, why do you want the record type id? Is it so that you can limit your query? In that case

Select Id
From account
where RecordType.developername = 'Business'

and you have saved a query :)

You can also use it on related objects

Select Id
From case
where account.RecordType.developername = 'Business'

The question is, why do you want the record type id? Is it so that you can limit your query? In that case

Select Id
From account
where RecordType.developername = 'Business'

and you have saved a query :)

You can also use it on related objects

Select Id
From case
where account.RecordType.developername = 'Business'

And if you really need the ID for some reason, maybe you can get it while you are getting your data?

Select Id, RecordTypeID
From account
Source Link
Doug B
  • 11.5k
  • 1
  • 37
  • 44

The question is, why do you want the record type id? Is it so that you can limit your query? In that case

Select Id
From account
where RecordType.developername = 'Business'

and you have saved a query :)

You can also use it on related objects

Select Id
From case
where account.RecordType.developername = 'Business'