Customer Insurance Macro
Submitted by EastsideVetEmerg on Sun, 01/03/2015 - 15:31
Hi,
I have been trying to create a macro so I can insert the Customer Insurance name into an email we send to clients when we start to generate a claim for them.
I have been unable to achieve this.
The expression I was using was
openvpms:lookup(openvpms:get(.,"customer.entity"),"customerInsurance.name")
was someone able to help me and let me know what I have been doing wrong?
Thanks,
Adrian
Re: Customer Insurance Macro
Adrian - if you look at the archetype for party.customerPerson, you see: (I sorted this by name by clicking on the Name column header) and then expanded the insurancePlan field to show that it is a lookup (which you could tell from the customer info screen because it has a pull-down):
Hence the field name we need is insurancePlan, and we need to do a lookup.
So our maco can be:
Note that in the above, the name is a simple field so we can just use $customer.lastName, but both the title and the insurance plan are lookups so we need to look them up. If we just use say $customer.insurancePlan we would get the code - something line TIMS_TOTAL_PET_INSURANCE.
and if we call up a customer and create an email we can enter @zzt and get:
Note that the above happens to be done with 1.8 - but 1.7 is exactly the same.
Regards, Tim G
Re: Customer Insurance Macro
hi tim,
thanks for that. working now.