function IsObjForm_or_Formset lparameters toSomeObject * returns * 0 - Not form or formset * 1 - Formset * 2 - Form if type("toSomeObject") = "O" ; and !isnull(toSomeObject) ; and toSomeobject.baseclass$"Formset" return iif( toSomeobject.baseclass == "Formset" , 1,2) endif return 0But being frankly I wouldn't keep a function like this (maybe just a more generic one checking if it's Object and !isnull()).