Init database Application Folders

Hi Guys,

I am trying to initialize certain application folders on database creation.

What I have so far in my init script is:

--create errors application forlder
    DO $$
    DECLARE  errorsId uuid = newId();
    BEGIN
    insert into sys_folder(id, folder_type, name, sort_order) 
    values (errorsId, 'A', 'Errors', 0);
    insert into sys_app_folder (folder_id, filter_component, visibility_script, quantity_script, apply_default) 
    values (errorsId, 
    '[daryn$ErrorLog.browse].filter', 
    'userSession.currentOrSubstitutedUser.login == ''admin''',
    'def em = persistence.getEntityManager()
    def q = em.createQuery(''select count(o) from daryn$ErrorLog o'')
    def count = q.getSingleResult()
    style = count > 0 ? ''emphasized'' : null
    return count', 
    true);
    END $$;

Is there a better/correct way to do this, as when I try and modify the application folder in the web app I get the following error:

modified%20error

And I think it is causing bugs on something else I am trying to resolveā€¦

Actually never mind,

Just needed to add the create_ts or version values to query.