Default sort in new module

subramani
Mega Contributor

Hi,

I have created a new module which contains record from Task table.harishkumardeepakbkanavikar

Can anyone help to change the default sort as mentioned below:

1. priority starts 1 to 5,

2. Escalation is yes to no.

3. Type is incident to Request.

4. Opened is oldest to new

8 REPLIES 8

shloke04
Kilo Patron

Hi,



You can write a Before Query Business Rule on your required Table with the below script as:



Script:



var query = 'ORDERBYDESCopened_at';


  current.addEncodedQuery(query);



Hope this helps.mark the answer as correct/helpful based on impact.



Regards,


Shloke


Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hi Srivas,



I need to apply this sort for the Module.


Can you please advice me on which table do I need to write this BR.



Could you please explain the above script.




Thanks,


Subramani.


Hi,



Instead of writing a BR you can simple try the below steps:



1) Navigate to "Modules" under System Definition.


2) Search for your Module with title field.


3) Navigate to Argument Field under Link and give the query Tab as shown below:



find_real_file.png



You can also use the above Business Rule, in order to get the table Open your respective module as mentioned above and you can find the table name there in the module itself as shown below:



find_real_file.png


So you can write your Before Query business Rule on this table to get the previous code working:)



Hope this helps.mark the answer as correct/helpful based on impact.



Regards,


Shloke


Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hi Srivas,



If we write a BR for this Document table (fr this case). It will reflect where ever we refer the same table right ?



Thanks,


Subramani.