Refined Search default

Could we get a default refined search value.

As an example, I have a field which indicates the record type (open order headers, closed order header, archived order etc,
Most users usually just want to see open order record types, and would like it to open with this option chosen and change it only if required.

This one is tricky, some field in nm_proc_int_search() are different depending of the configuration, check the value with inspect

//onApplicationInit

[RefinedSearchFirstPass] = true;

//onRecord

if ([RefinedSearchFirstPass] == true) {
?>
	<script>
   	$(document).ready(function() {
		nm_proc_int_search('link','tx','Title','YourField','BDValue##@@ScreenText', 'YourField', '');		
    });
</script>
<?php
	[RefinedSearchFirstPass] = false;
}

Field of nm_proc_int_search

1 - Always ‘link’
2 - ‘tx’ for text, ‘nm’ for number (value of field in the database)
3 - Field title
4 - Your field name in lower case and replace . by _ if present. ex. u.Active put u_active
5 - Concanate the BD value with ##@@ and the text on screen. ex. Y##@@Yes will default to Yes if it’s value in the database is ‘Y’
6 - Repeat field 4
7 - Leave empty

So in this example it will be nm_proc_int_search('link','tx','Active','u_active','Y##@@Yes', 'u_active', '');

2 Likes

Finallygot around to it and it works… now will implement across the system

TY

Thank you @jlboutin60 this works perfectly! in my case I had a number and I actually had to use “nn” not “nm”.
Thank you again!

Muchas gracias!!
Pongo el ejemplo que yo usé, en que el empezaba el grid con búsqueda refinada con un campo Estado == a Pendiente:
nm_proc_int_search(‘link’,‘tx’,‘Estado’,‘estado’,‘Pendiente##@@Pendiente’, ‘estado’, ‘’);

Hola a todos,
pongo un nuevo desafío que no pude resolver:

¿como hacer cuando es más de una condición? por ejemplo, que la factura tenga estado=“Pendiente” y estado=“Sin entregar”.

Gracias de antemano!!