Update customer location
Dear Forum Members,
When my data was ported from the previous PMS customer location was not set. As a result some of the sales reports that split out by customer location don't show the data very well for my one site clinic as they believe most clients have no location and any new ones created in openVPMS do.
In order to remedy this I have concocted the following:
insert into entity_links (version, linkId,arch_short_name, arch_version, `name`, description, sequence, source_id, target_id)
select 0,'randomLinkId','entityLink.customerLocation',1.0,'Customer Location', 'Customer Location', 0, entity_id as source_id, 158
from entities left join entity_links on entity_id=source_id where entities.arch_short_name='party.customerperson' and
target_id is null;
Before I unleash this into the production database I would like to ask someone who knows more than I (just about anyone) what the implications are for the linkId. I have no idea what these do, how they are handled, how they are generated and indeed what they will break if not present.
Constructive criticism appreciated.
Chris
Re: Update customer location
Hi Chris,
Given 158 is your location id.
Cheers
Tony
Re: Update customer location
Thanks Tony, that's brilliant. I now at least understand the linkId is a UUID. Can I ask what they are used for internally? Between the various id fields and archetype names there are other ways of deriving uniqueness. Are these used in the java layers before the *_id fields are assigned by the database?
Chris
Re: Update customer location
The linkId is used to link objects until they can be stored in the database, and to provide support for object equality.