Why after business rule on text_search table on working ?

Kavyashri Naval
Tera Contributor

Hi Community,

 

I got a requirement to track what users are searching on Workspace global search. There is OOB 'text_search' table which is storing all these records from global search.

KavyashriNaval_0-1694410559733.png

 

We have a custom 'u_audit' table & have a after -insert BR which is on text_search table.  So when record created in text_search table, it should create a new record in audit table. However BR is not working. Below is the BR:-

 

KavyashriNaval_1-1694411015705.png

 

Note:- text_search is on global scope & custom 'u_audit' table is on Custom scope. Also same script when ran from background script is working & creating new audit record. This is weird. Can someone please help on this?

 

Thanks,

Ankita

 

 

1 ACCEPTED SOLUTION

Hi@Kavyashri Naval , the global search was the missing information for me - this is also not working in my PDI. It seems that this is internally built without executing Business Rules, I assume to avoid performance issues.  My recommendation is here, that you should build a scheduled job (running once a hour), which collects all text_search entries created or updated (maybe update is not needed) last hour and insert them in u_audit. 

 

 

Greets
Daniel

Please mark reply as Helpful/Correct, if applicable. Thanks!

View solution in original post

8 REPLIES 8

Daniel Borkowi1
Mega Sage

Hi @Kavyashri Naval , please check if you did set Application Cross-Scope Access and on your  u_audit table (sys_db_object) the privilege that other scopes can insert. I'm quite sure that the scope is the issue. 

 

DanielBorkowi1_0-1694411921994.png

Also check the scope of the BR, it should be in your custom scope.

 

Greets
Daniel

Please mark reply as Helpful/Correct, if applicable. Thanks!

 

Hi @Daniel Borkowi1 ,

 

Thank you for your response.

I have checked insert check box, still the same issue. Also, I have an after BR on search event table that is successfully creating record in u_audit table but I'm wondering why it's not working for text_search table.

 

Note:- There are no other business rule on text_search table.

Daniel Borkowi1
Mega Sage

Hi @Kavyashri Naval , did you also checked Application Cross-Scope Access with source scope global and target scope your custom scope? I'm quite sure that this is a Scoping issue. It's not usual, that global scope things do something in custom scope tables. Btw. which scope is your BR? Maybe try to switch to custom scope with your BR.

Greets
Daniel

Please mark reply as Helpful/Correct, if applicable. Thanks! 

@Daniel Borkowi1 ,

Please have a look on both the tables & BR:-

 

KavyashriNaval_0-1694586502660.png

 

KavyashriNaval_1-1694586552264.png

 

KavyashriNaval_2-1694586586723.png

Sorry my bad, both the tables are in global scope.

 

The weird part is when I'm creating record from form, this BR is working & creating record in audit table. But when I'm searching from global workspace, it's not working.