function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
azu.shaik1.3965080575576013E12azu.shaik1.3965080575576013E12 

Required sample code to create the new record in account based on the record type using the rest api

I was new i writting the rest api . i have gone through google and find some useful links in writing the rest api , but i was stuck to create the new record based on the record type in account .(eg : i have two recordtypes buyer and seller . i need create record in account object under buyer record ).

can some can help. It will be more great help to me
Tony TannousTony Tannous
Hello,

Go to developer console 

and run this soql 
select id,name

from recordtype

Once you have the resultat , select the id of the recordtype you want ,

and while creating the account using the restapi,set the field name recordtypeId with the id of the recordype .

Good Luck


Andy BoettcherAndy Boettcher
RecordTypeId is a field on your object - use Tony's comment to get your Ids, and then just enter your value in your object just as you would a text value in a text field.