Referred By Client option
Submitted by lakesidevet on Thu, 15/06/2017 - 13:18
Hi,
When we set up a file for a new client that was referred to us by an existing client, although we can select "Word of Mouth" Type in the Referred By drop down box for the new client info, we have no way of inputting which client it was that referred them. If we could do this we could run a report of our best clients who spread the good word.
Is there any option to do that? We are running v1.9
Thanks
Trev
Re: Referred By Client option
Trev - yes it is possible by tweaking the party.customerperson archetype to add a new field 'Referred by Customer'. Since we want to be a bit sexy and enable the 'referred by customer' to be looked up, we want more than a simple text field.
Here is my test customer with the new field added and set:
To achieve this we need to do two things:
a) add a new archetype to define the customer-to-customer link - I have called this entityLink.customerCustomer.adl (and the file is attached)
b) modify the party.customerperson.adl to include the new field (and the modified version of the standard party.customerperson.adl is attached)
So download the two files and put them where you keep your modified archetypes (so that when you upgrade to the next release of OpenVPMS you know which archetypes you can to check, and if necessary adjust).
Then use Administration|Archetypes|import to import them - import entityLink.customerCustomer.adl first, then the modified party.customerperson.
Log out, and back in again and away you go.
Now I don't really want to build to report you want, but the underlying SQL is as follows:
I must admit that I was somewhat surprised how easy this was. I knew that adding a text field was a piece of cake, but I did not think that adding a linked customer field would be either easy or possible. In fact it also turned out to be a piece of cake also. You must admit that it is impressive that all one does is tweak the archetype and magically it works.
Regards, Tim G
Re: Referred By Client option
Hi Tim,
Indeed that is a bit of magic!
I've never used any SQL to create anything myself. Can you give me the basics of where I enter it and so on? Happy to learn how to do this so can help on my end for the future.
Trev
Dr. Trevor Pavey
Principal
Lakeside Vet Centre
Re: Referred By Client option
Humm - if your server is running on a windows system, then you should should use the MySQL Workbench program. [You can do neat things with this but it does require some technical expertise to use.]
I have cloned a report for you by tweaking the Customer Acquisition Referral Report (from the resource library) to also display the referring customer's name. It is attached.
Running over my test system I get:
The first time you run it, it is worthwhile checking the 'Display Explanation' check box.
Regards, Tim G
Re: Referred By Client option
Thanks Tim!
I've tried it now and it works well. Makes tracking who referred people to us much easier.
Trev
Dr. Trevor Pavey
Principal
Lakeside Vet Centre