How do I use the isAvailable() property on the Record Type Metadata Object?

  • 2
  • Question
  • Updated 2 years ago
Trying to filter record types in the record type model based on what the logged in user has access to.  We are trying to accomplish this by querying all record types in the model, then looping through each row in the model and checking to see if the user has access to that particular row.  Can we use isAvailable() in this scenario?  If so, how do we use it?  We haven't had any luck finding an example in the community or online.  

Any help is appreciated! 
Photo of Erick Hollander

Erick Hollander

  • 100 Points 100 badge 2x thumb

Posted 2 years ago

  • 2
Photo of Erick Hollander

Erick Hollander

  • 100 Points 100 badge 2x thumb
We have tried 
for(recordType of recordTypeModel.getRows()){
  if(!recordType.isAvailable){
     recordTypeModel.abandonRow(recordType);
  }
}
Photo of Erick Hollander

Erick Hollander

  • 100 Points 100 badge 2x thumb
in this case recordType.isAvailable is undefined
Photo of and thorough

and thorough

  • 736 Points 500 badge 2x thumb
Hi, Erick.  Did you ever figure this out?  I am also trying to use the isAvailable property (documented here) and getting stuck.