-- Cоздание подвида документа
create ks_kind_description object
set object_name = '<Название нового подвида документа>'
set ka_is_main = 0
set title = object_name
set ka_folder_id = (
select r_object_id from ks_kind_description
where object_name = '<Название вида документа>' and ka_is_main =1
)