Refresh Added Column in Data Table by Script

Hi,

I have a Column A in Table B, and this column is controlled by property control. Then I added this Column A from Table B to Table C marked as Column A'

When I change property control input, Coumn A in Table B would automatically changes accordingly, but Column A' in Table C would not change. In order to solve this, I added a refresh button to manually refresh Table C everytime I change Property Control input using script: Document.Data.Tables['tableC'].Refresh() 

The problem is that since Table C data size is very big, it would take very long time to refresh with the script I am using. Is there a script that I could use to only refresh Column A' in Table C, instead of refreshing all columns in Table C? 

It would be even better if there is a way that Column A' in Table C could automatically refresh just like Column A in Table B. 

Thanks!

Heath

7 Comments

Ah I see. Do you have a sample dxp?

tai.nguyen - Aug 25, 2016 - 6:55am ::

Thanks Tai. But I think I can't insert the columns to Table C since these two tables are quite different. Inserting would mess up Table C. Actually my question could be simplied to how to automatically refresh an imported column in Table C.

heawu - Aug 24, 2016 - 9:23pm ::

So, if that is the case, can you insert the other columns in table B needed for the calculation into table C, then insert calculated column (A) into table C then?

I believe the column properties are carried when after inserted so your expression should work.

tai.nguyen - Aug 24, 2016 - 8:32pm ::

Actually Column A is not directly controlled by property control, it is also a calculated column with below expression:

If(Find([yap_type],'${mfg_yap_pca_link}.{yap_type}.{PBselect}')>0 and Find([pca_status],'${mfg_yap_pca_link}.{pca_status}.{StatusSelect}')>0 and Find([fiscal_quarter],'${mfg_yap_pca_link}.{fiscal_quarter}.{FQselect}')>0 and [pca]!='',"ICT PB")

I am controlling [yap_type], [pca_status], [fiscal_quarter] columns in Table B with property control, and then Column A would be calculated based on what I choose for these three columns. So I think I can't directly control A in Table C, because without Table B there would not be Column A in the first place. 

heawu - Aug 24, 2016 - 8:08pm ::

Hi,

Can you share your dxp file?

I am thinking you may have the property control changing value of column A in Table C in addition to column A in Table B.

tai.nguyen - Aug 24, 2016 - 7:10pm ::

Hi, can you explain more about it? I am really not familiar with this...

heawu - Aug 24, 2016 - 6:41pm ::

Any reason you can't have Column A in Table C controlled by the document property directly?

tai.nguyen - Aug 24, 2016 - 9:13am ::
View More Comments + Add a Comment

(1) Answer

Login