How to extend Task table after Custom table creation?

Nikita28
Mega Guru

Hi,

I want to extend the Task table on a Custom table after its creation.
I have tried executing below code to create extension from Task table to my custom table(x_272304_green_fol_gf_document_status).
But, now system has created a new table(z_x_272304_green_fol_gf_document_status) which extends 'Task' table.


var table = 'x_272304_green_fol_gf_document_status';
var old_parent = '';
var new_parent = 'task';
var changer = new GlideTableParentChange(table);
changer.change(old_parent, new_parent);

Old Custom Table: 'x_272304_green_fol_gf_document_status' is not extended.
New Auto created Table: 'z_x_272304_green_fol_gf_document_status' is extended with Task table.

My all customizations are with the old table. Hence, I am unable to use an old table to create Visual Task Board from the Task table.

Can anyone please suggest a better approach to extend a table after its creation?

Thanks in advance!

1 ACCEPTED SOLUTION

Alok Das
Tera Guru

Hi Nikita,

It is restricted to extend any table after table creation.

However I, saw numbers of threads remained unanswered and numbers of them asked to use background script which results in a duplicate table creation.

Looking up into the issue. I came across an OOB business rule which restricts to extend any table after table creation.


Business Rule: "Table Field Validation"

Disable the piece of code mentioned below:

 

//super class is enter once
if (previous.super_class != current.super_class) {
current.setAbortAction(true);
current.super_class.setError(gs.getMessage('Cannot change what a table extends after it is created'));
gs.addErrorMessage(gs.getMessage('Cannot change what a table extends after it is created'));
}

Now in list layout you can add the task table in the Extends table field.

 

Note: You are modifying the OOB functionality by editing Business Rule: "Table Field Validation", however this is the only possible way.

This will resolve your issue.

 

Kindly mark my answer correct and close the thread.

 

Regards,

Alok

View solution in original post

7 REPLIES 7

Alok Das
Tera Guru

Hi Nikita,

It is restricted to extend any table after table creation.

However I, saw numbers of threads remained unanswered and numbers of them asked to use background script which results in a duplicate table creation.

Looking up into the issue. I came across an OOB business rule which restricts to extend any table after table creation.


Business Rule: "Table Field Validation"

Disable the piece of code mentioned below:

 

//super class is enter once
if (previous.super_class != current.super_class) {
current.setAbortAction(true);
current.super_class.setError(gs.getMessage('Cannot change what a table extends after it is created'));
gs.addErrorMessage(gs.getMessage('Cannot change what a table extends after it is created'));
}

Now in list layout you can add the task table in the Extends table field.

 

Note: You are modifying the OOB functionality by editing Business Rule: "Table Field Validation", however this is the only possible way.

This will resolve your issue.

 

Kindly mark my answer correct and close the thread.

 

Regards,

Alok

Hi Alok,

 

Thanks for the quick response!

It works and I am able to create Visual Task Board on it.

Hi Alok

 

I have this similar issue as well .

I am carrying out the instructions provided by you but it is not working in my case .

Can you please suggest something .

 

Thanks in advance 

Ashish

Hi Alok,

 

I tried disabling the code you mentioned, but it is not working for me. Please help.