Why tableChoicesScript Attribute is not working for me?

Ali Usman
Tera Contributor

I have a simple Document ID Field on form. I added the following script include 

var RelationshipScript = Class.create();
RelationshipScript.prototype = {
    initialize: function() {},
    process: function() {
        var tables = ['incident', 'interaction', 'change_request', 'sc_req_item', 'problem'];
        return tables;
    },
    type: 'RelationshipScript'
};

I added the attribute on my Document ID Field as following 

tableChoicesScript=RelationshipScript

Why I still see all the tables in the list where I should only see the 5 tables I listed above in my script?

This was adapted from the following post 

LINK 

I also tried with/without "Dependent Field". I still see all the tables in the list, Dependent Field just auto-selects the table but all other tables are still available in the dropdown. 

I only want a few tables and not all, how do I achieve that, any ideas?

1 ACCEPTED SOLUTION

Tom Sienkiewicz
Mega Sage

Hi, just 2 quick thoughts:

1. are you sure the attribute is added to the right field? It should not be added to the Document ID field itself, but to the string field on which the Document ID depends, I believe.

2. could you have a cross-scope issue? Perhaps your include or your table are in different scopes? Have you tried adding scope prefix to the include name?

View solution in original post

4 REPLIES 4

Tom Sienkiewicz
Mega Sage

Hi, just 2 quick thoughts:

1. are you sure the attribute is added to the right field? It should not be added to the Document ID field itself, but to the string field on which the Document ID depends, I believe.

2. could you have a cross-scope issue? Perhaps your include or your table are in different scopes? Have you tried adding scope prefix to the include name?

Thanks @Tomasz Sienkiewicz  Your Point 1 was correct. I was applying the attribute on the Document ID Field itself and not on the Dependent. Cheers

Anil Lande
Kilo Patron

Hi,

Can you please share screenshots of your configurations?

Is your field and script include in same application scope?

I hope you have created a field 'Document ID' of type 'Table Name'. This attribute is supported on field of type 'table_name'.

 

Thanks,
Anil Lande

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Thanks Anil, I was applying the attribute on the Document ID Field itself and not on the Dependent. Cheers