Page 1 of 1

Custom Fields Required depends on Disposition Selected

PostPosted: Fri Sep 28, 2018 2:24 pm
by arunvsadnikov
Hello Team,

Would like to request for a feature in custom fields module in Lists. Currently we have the option to make custom fields required or not while creating it. We have a hot requirement to have the custom field filled mandatory only when the disposition is specific.

For eg:
If the disposition in SALE then a custom field "Business Name" must be filled in. Appreciate if anyone can release a patch for this requirement.
So when you create a custom field, you can select whether it is required or not, then choose condition if required WHEN DISPO is SALE or something else.

Currently we have achieved by custom code in the script section in the campaign. This is working fine, but we do see intermittent issues like fields not getting updated properly, DISPO URL variables not filled etc..

Thanks
~Arun

Re: Custom Fields Required depends on Disposition Selected

PostPosted: Fri Sep 28, 2018 3:23 pm
by williamconley
This could certainly be coded, but I don't think it will be a spontaneously added feature without a sponsor. I could be wrong, but ...

If you truly need this included, you should consider sponsoring the feature (The Vicidial Group is available on EFLO.net for such requests). If anyone else (eg: PoundTeam Incorporated, where I work) codes this, they would have to provide a DIFF and hope that The Vicidial Group approves it for inclusion. Otherwise, you'd be re-patching the admin.php and agent screen each time you upgrade to maintain any changes.

Note that the privilege of being the sponsor includes being able to custom-create it for your needs. Don't get me wrong, they won't likely include it in the core unless it's useful for everyone, so you may not be able to make it extremely specific to your needs, but something as simple as "required ONLY if status = XXXX" is widely usable based on your description.

Re: Custom Fields Required depends on Disposition Selected

PostPosted: Fri Sep 28, 2018 3:32 pm
by mflorell
One problem with a feature like this is that the custom form is no longer viewable when you get to the dispo screen, so there is no chance for the agent to fill in the required field so they can use that specific disposition.

Another issue is just the complexity in developing something like that to work within the existing custom fields framework, it would not be a simple project.

We have programmed a few custom scripts for clients that did something like this, but the disposition was selected as part of the script, and you could only select the SALE status if the form was filled out entirely, then when you submit the form on the script it would hangup and disposition the call. Forms like these are not managed within custom fields, and they have to be custom programmed.

Re: Custom Fields Required depends on Disposition Selected

PostPosted: Fri Sep 28, 2018 4:00 pm
by williamconley
Perhaps a non-custom method for Vicidial to load custom javascript code, so changes like this could be stored in the DB or in a file to survive upgrade.

Similar to the custom dialplan entries in admin->system settings. But in the custom fields pane. Perhaps even just a "load this .js file" link would suffice.

After that, custom code would be possible by The Vicidial Group OR Third Parties that could survive upgrades (although they would still be dependent upon compatibility with the upgraded screen).

Re: Custom Fields Required depends on Disposition Selected

PostPosted: Fri Sep 28, 2018 6:30 pm
by mflorell
We actually added agc/options.php settings that can insert javascript into several key places for a client a while ago:

$INSERT_head_script = ''; # inserted right above the <script language="Javascript"> line after logging in
$INSERT_head_js = ''; # inserted after first javascript function
$INSERT_first_onload = ''; # inserted at the beginning of the first section of the onload function
$INSERT_window_onload = ''; # inserted at the end of the onload function
$INSERT_agent_events = ''; # inserted within the agent_events function

Re: Custom Fields Required depends on Disposition Selected

PostPosted: Fri Sep 28, 2018 8:05 pm
by williamconley
I forgot about that entirely. So that level is already covered, just has to be CLEAN javascript. Cool. 8-)

Re: Custom Fields Required depends on Disposition Selected

PostPosted: Mon Oct 08, 2018 12:59 am
by arunvsadnikov
Thanks guys, We would like to sponsor this feature. Let me contact your support.

Re: Custom Fields Required depends on Disposition Selected

PostPosted: Wed Oct 10, 2018 1:07 pm
by dspaan
mflorell wrote:One problem with a feature like this is that the custom form is no longer viewable when you get to the dispo screen, so there is no chance for the agent to fill in the required field so they can use that specific disposition.

Another issue is just the complexity in developing something like that to work within the existing custom fields framework, it would not be a simple project.

We have programmed a few custom scripts for clients that did something like this, but the disposition was selected as part of the script, and you could only select the SALE status if the form was filled out entirely, then when you submit the form on the script it would hangup and disposition the call. Forms like these are not managed within custom fields, and they have to be custom programmed.


Can't you code it so when you click the SALE status (or another specified status) so it redirects you back to the custom fields page if that required field is empty and making the label red?

I know that right now required fields already exist but i can't imagine how people use them because the way they work will disallow an agent to go to the dispo screen unless that field is filled but when would that work? What if the call is an answering machine or no answer?

This feature for connecting a disposition code to required fields is very useful. But what vicidial also is missing is some kind of integrated survey questions (like Limesurvey) where the next question is shown depending on which answer was given in the previous question and you can set questions to be required or not.

Re: Custom Fields Required depends on Disposition Selected

PostPosted: Wed Oct 10, 2018 1:44 pm
by mflorell
You can do anything given enough time and money :)

That said, doing what you describe would require some major reworking in how the hangup and disposition processes work in the agent screen. It would affect dozens of other features and is not a simple step to add in.

Re: Custom Fields Required depends on Disposition Selected

PostPosted: Wed Oct 10, 2018 2:37 pm
by dspaan
I know but i don't see another way to achieve this? Anyway, the poster of this thread said he was going to sponsor this so let's see what comes out of this. I did see a very nice custom solution for it in this video:

http://hwdevelopment.com/blog/21-custom ... agent-apis

Re: Custom Fields Required depends on Disposition Selected

PostPosted: Wed Oct 10, 2018 7:50 pm
by mflorell
Yes, custom web forms or custom script tab pages are often the easiest solutions, and it's what we recommend clients do if they want something like this. A custom solution can much more easily allow for conditional dispo availability depending on specific field values or fields being filled in.