This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
en:devel:corebos_hooks:popup_capture_hook [2014/12/20 19:17] joebordes created |
en:devel:corebos_hooks:popup_capture_hook [2016/09/10 02:01] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Popup capture hook ====== | + | ===== Popup capture hooks ====== |
The action of this hook happens when you select a record in a popup capture screen related with a uitype 10 field. | The action of this hook happens when you select a record in a popup capture screen related with a uitype 10 field. | ||
Line 22: | Line 22: | ||
^value|the text representation of the record that has been selected in the popup| | ^value|the text representation of the record that has been selected in the popup| | ||
^target_fieldname|the destination field name in the form in the browser| | ^target_fieldname|the destination field name in the form in the browser| | ||
+ | ^formname|the form that the destination field is in| | ||
Then you must add a property to your module: **popup_function** with the name of your function. That is all that is needed. | Then you must add a property to your module: **popup_function** with the name of your function. That is all that is needed. | ||
Line 27: | Line 28: | ||
To test this functionality you can try this: add this function to Accounts.js | To test this functionality you can try this: add this function to Accounts.js | ||
- | <code>function myspecialcapture(recordid,value,target_fieldname) { | + | <code PHP>function myspecialcapture(recordid,value,target_fieldname,formname) { |
// first we launch the default functionality | // first we launch the default functionality | ||
- | vtlib_setvalue_from_popup(recordid,value,target_fieldname); | + | vtlib_setvalue_from_popup(recordid,value,target_fieldname,formname); |
alert('This is our special intercepted capture function'); | alert('This is our special intercepted capture function'); | ||
window.close(); | window.close(); |