How do I override a reference field in extended table

PN5
Mega Contributor

I have table2 extended from base table1 where the reference column gets inherited. Is it possible to override the reference field value in table2 and refer to some other table than what is used in table1? I have tried dictionary override but that seems to have options only for the reference qualifier which I do not use. I have tried "calculated" option in the dictionary of the column to dynamically assign the value based on the table name but that does not seem to be working. When I change the reference field value it gets changed in both eh base and extended table.

1 ACCEPTED SOLUTION

Geoffrey2
ServiceNow Employee
ServiceNow Employee

You can't do that with a Reference field.


But you should be able to get the same kind of functionality with a Document ID field.   A Document ID field requires a dependant field which has to contain a table name so that Document ID field knows what table to point to.   So you would have u_document_id, and u_source_table fields on the base table. Edit the Dictionary Entry of the Document ID field and set u_source_table as the dependant field (you need to switch to Advanced view to do this).   Then you would set the default value of the u_source_table field to one value on the base table, and a different value on the extended table.


View solution in original post

2 REPLIES 2

Geoffrey2
ServiceNow Employee
ServiceNow Employee

You can't do that with a Reference field.


But you should be able to get the same kind of functionality with a Document ID field.   A Document ID field requires a dependant field which has to contain a table name so that Document ID field knows what table to point to.   So you would have u_document_id, and u_source_table fields on the base table. Edit the Dictionary Entry of the Document ID field and set u_source_table as the dependant field (you need to switch to Advanced view to do this).   Then you would set the default value of the u_source_table field to one value on the base table, and a different value on the extended table.


PN5
Mega Contributor

This is an interesting approach. I will try it out. Thank you for the quick help!!