Does anyone know how I can add autofill for the select popup in a custom module, similar to how pressing the select button on the contact subpanel while looking at a case detailview will autofill the account?
You will find some things if you search for “sqs” here in these forums.
I have been searching for a hour and not found anything useful
Is it possible to conditionally fill? For example my custom module has relationship to accounts twice (reseller account and end user account), is it possible to autofill only one or the other field based on some arbitrary criteria?
I don’t think by this method, you could however write a “customcode” in the vardef array. Or, if you want it to get populated on save, and not live on the screen, you can write an on save logic hook and populate it with whatever you like.
Here’s what you can use in the vardef (example) to filter the search popup. So for example the below is for a contact and will only show contacts in the popup filter based on that they are related to the current account.
'initial_filter' => '&account_name_advanced="+this.form.{$fields.billing_account.name}.value+"',
I’m not sure if this works in the subpanel though, never tried. You might have to write custom code for the button.