You need to sign in to do that
Don't have an account?
Shree K
How to use Opportunity record type name/Developer Name in conditions in an efficient way
Hi Everyone,
I need to use a condition , when ever an Opportunity is created with its stage as 'Won' and recordtype name as 'Global' a record in custom Object has to be created ,i am good till here , what I wonder is , Is there any way that i can use Opportunity Object's record type name without querying RecordType Object, all i am looking for is a condition like below to be built without querying another Object coz i already have a list Opp,
If (Opp.StageName='Confirmed' && RecordTypeName(would like to use this as a string )= 'Global')
Thanks
Ck
I need to use a condition , when ever an Opportunity is created with its stage as 'Won' and recordtype name as 'Global' a record in custom Object has to be created ,i am good till here , what I wonder is , Is there any way that i can use Opportunity Object's record type name without querying RecordType Object, all i am looking for is a condition like below to be built without querying another Object coz i already have a list Opp,
If (Opp.StageName='Confirmed' && RecordTypeName(would like to use this as a string )= 'Global')
Thanks
Ck
You can create a map to store the RecordType id vs the RecordTypeInfo.
Then in the trigger use like below.
There is no SOQL used.
Thanks
Anupama
All Answers
You can use recordType.Name inside you same SOQL query like this: And you can use it inside you if condition with Opp.RecordType.Name=='Global'
Regards
Gulshan Raj
You can create a map to store the RecordType id vs the RecordTypeInfo.
Then in the trigger use like below.
There is no SOQL used.
Thanks
Anupama