Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Popup open hook
#1
I tested the wiki example for using a popup hook to filter the popup list of Assets based on a given Product's name. This is about the behavior of that popup list and the fact that it works, but if the result is split in more pages, when you go to the next page it reverts to the original 'all' list.
So in more detail, i can't be sure if I'm doing it entirely right and that procedure might be deprecated now with the business actions but:
-i did saved the js file
-i did execute the php that contains the addlink instruction
-i did insert in Products.php the condition(before the existing one in that function)
The hook did not work until i defined a business action stating what was in the addlink php. But then it worked, at least for the first page. It shows the correct number of results and the button for 'show all' but if you move to another page it loses the whole list and reverts to the default all list.
Reply
#2
Hi.

You have to add cbcustompopupinfo like a paremeter in the url when you open the popup. In this paramter you have to add the field names that you are using to filter.

You can read this on the wiki: http://corebos.com/documentation/doku.php?id=en:devel:corebos_hooks:popup_query_hook

Here you can see examples and you can read a warning with the title: !! NOTE: VERY IMPORTANT !!
Reply
#3
Thumbs Up 
(09-07-2020, 06:04 PM)omarllorens Wrote: Hi.

You have to add cbcustompopupinfo like a paremeter in the url when you open the popup. In this paramter you have to add the field names that you are using to filter.

You can read this on the wiki: http://corebos.com/documentation/doku.php?id=en:devel:corebos_hooks:popup_query_hook

Here you can see examples and you can read a warning with the title: !! NOTE: VERY IMPORTANT !!

Hello Omar Wink

Thanks for the info! I was looking only on open hook, I did not pay attention to the query hook example. It works as described if you toss the required variables in that cbcustompopupinfo. Beers on me!
Reply
#4
But then how do I keep the query between pages(in the popup) when the query hook to product is from modules like quotes and also when you do the capture from related lists(Opportunities for example)? I put the query in the getQueryByModuleField function but those popups do not call the other getvtlib_open_popup_window_function where i could set the cbcustompopupinfo so it only respects the custom query the first time when it opens.
So for that uitype10 like in Assets works but in the other cases the custom query gets lost.
Anyone knows the answer?
Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)