Hi Artur
I'll start with the Error - it's caused due to wrong filter on the HR View.
Those filters are translated by WEBCON to SQL queries, you can look how the query looks like for example with using diagnostics*, but for now it's not required.
With that in mind we can compare it to what happens under the hood, the query looks something like this (it's very rough, there is much more, but that is the part which we have to focus on):
SELECT * FROM V_WFElements WHERE {QM_Parent_ID}
It's missing an equality operator, it should be more like this:
SELECT * FROM V_WFElements WHERE {QM_Parent_ID} = {WFD_ID}
So you should make some kind of a comparsion when filtering, and you most certainly want to compare value from form attribute QM Parent ID with Data Source Columns (attachment) - ID should be what you are looking for.
At this moment you are copying subworkflow ID into a field on parent workflow - this works fine, when you are sure that there will be only one subworfklow - creating new subworkflows will override this value.
If there is a possibility that more subworkflows of same type will be created, then I'd suggest creating a field on subworkflow, which will contain ID of parent - this way, you can also handle one to many relations.
This is also something that webcon does when you set start mode as 'subworkflow of current instance', it saves the ID of parent into WFD_WFDID column of child element - available as 'Instance ID from parent workflow' in Values tab of business rules/filters etc. From what i know this is required to make step Wait for subworkflows work - you can't achieve it with custom relations.
Sometimes you might want to have your own relation though, for ease of use.
*https://community.webcon.com/posts/post/diagnostics-and-form-behavior-registration-mechanism/215/40