Why am I getting this error when trying to insert a new row in the APEX app?
ORA-00001: exclusive restriction (ASCHEMAXXXXX.Table_name_PK) violated
There is a dynamic action on page load to get the next value for one of the fields.
I tried to create a sequence and use it on the primary key, but got .nextvalue not declared.
You didn't explain what that dynamic action actually does, but - it seems it doesn't do what you meant it would. Besides, what kind of a page is it? Form? Interactive Grid? Something else? Consider posting as many information as possible; otherwise, it is difficult to guess what might be going on.
Saying that you tried to use a sequence, then: if your database version supports it, why wouldn't you switch to an identity column and let database take care about PK values? For example:
Another option is to use sequence + trigger combination: