it seems result.prefix.generatedkey will be missing on primary key insert, so just use the inserted primary key for result.primarykey