0

how to get recordtype id from schema i am using this

Id RecType = Schema.SObjectType.Opportunity.getRecordTypeInfoByName().get('Booked Stage Read Only').getRecordTypeId();

//Error is Method does not exist or incorrect signature: [Schema.DescribeSObjectResult].getRecordTypeInfoByName()

if(BigMachinesQuoteMap.get(bigQuote.id).Order_Number__c != null && BigMachinesQuoteMap.get(bigQuote.id).BigMachines__Is_Primary__c == true)
            {
                BigMachinesQuoteMap.get(bigQuote.id).Booked_Order_Amount__c;
                opp[0].StageName = 'Booked';
                opp[0].RecordTypeId=RecType;
            }

            }
            update opp;

1 Answer 1

1

The method name is getRecordTypeInfosByName (has an s in it) not getRecordTypeInfoByName that you have. See e.g. RecordTypeInfo Class for code examples.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .