xTuple.com xTupleU Blog & News Customer Support

Group Comment and Documents

Hi all,

I am using Windows version 6.03

I have created a group screen of our crmaccts. Each of these crmaccts have similar properties related to our business.
So I added a comment and document tab using the core widgets Comments and Documents.

But since the Key ID of the group is the group_id, I need to set the type to “GRP”
But there is no “GRP” in the source table.

So my question is : Is it OK for me to add a row to the source table to handle this issue?

Thank you

I have used different source types then what are originally in xTuple specifically on the Document widget. I know from that, I didn’t need to add anything into to the database. What table are you talking about?

I know if you call setId(group_id); setType('GRP');
You will see those pop up in the database. under the table “comment”.

Its important to note that the table has comment_cmnttype_id and comment_source if you call Comments.setType(int) you will change the cmnttype_id which is not what xTuple filters by. xtuple filters by comment_source which is just text based arround Comments.setType(String)

Documents are the same way. only the table that they will populate is “docass” and ththe column that will have ‘GRP’ in it is docass_source_type

Thank you Caleb

But my issue is as follows:

ERROR: null value in column “docass_source_type” violates not-null constraint
DETAIL: Failing row contains (21805, -1, null, 21805, URL, S, bekosko, 2022-06-22 07:04:47.047633-04, test document).
(23502) QPSQL: Unable to create query

The Query:
INSERT INTO docass ( docass_source_id, docass_source_type, docass_target_id, docass_target_type, docass_purpose, docass_notes) VALUES ( :docass_source_id, :docass_source_type, createurl(:title, :url), ‘URL’::text, ‘S’::bpchar, :docass_notes) RETURNING docass_id, docass_target_id;

even though I set the “docass_source_type” to GRP. xTuple cant find it in the C++ code.

As for the comment widget , the New Button is disabled and I assume it is due to the fact that it cannot find my comment type; comments.setType(“GRP”);

Ok I found the problem,

when I was adding the widgets Comments and Documents , I was using the syntax

var commmentWidget = toolbox.createWidget(“Comments”,this,"_comments");

it should be

var commmentWidget = toolbox.createWidget(“Comments”,mywindow,"_comments");

Thank you Caleb

Glad you found it!
I think you might need to set the Type before you set the ID is the only thing I could Add. I looked back at my custom code and all I had to do was set the type and then pass the new ID’s