As you know, SageCRM supports multiple addresses to be created against the Company, Person records. We can also select address types etc. However whenever you want to create these records from COM/DOTNET API, first question comes to mind is how to store these values.
The New Stuff: Change Default dedupe behaviour
Let us consider New company screen for better understanding.
When we save these details, Address details don’t go into Company table, rather they are saved in Address table. Their relationship/linking are present in “Address_Link” table. So in order to link Company with Address, you need to first create record in Address table and then create a link in “Address_Link” table.
As you can see below, there is a section called “Type” in Address panel which contains “Check Boxes” under it. Now I will explain you how entries are created in “Address_Link” table based on above “Check Boxes”. Let’s understand it one by one
Case 1:- When nothing is selected from available check boxes. Please refer below screen which explains how data is stored in “Company” ,”Address” and “Address Link” table .
DATA IN COMPANY TABLE:-
DATA IN ADDRESS TABLE:-
DATA IN ADDRESS LINK TABLE:-
Case 2:-When only “Business” type is selected.
Case 3:-When only “Billing” type is selected.
Case 4:-When only “Shipping” type is selected.
Case 5:-When “Business” and “Billing” type is selected.
Case 6:-When “Business” and “Shipping” type is selected.
Case 7:-When “Billing” and “Shipping” type is selected.
Case 8:-When “Business”, “Billing” and “Shipping” type is selected.
You can see throughout the above explanation that 2 records are created in Address_Link table. One entry has only company id and another has Company Id as well as Person Id. You need to write your API methods in such way that you create similar entries in tables as explained above, so that the functionality of SageCRM is not broken in any scenario.
Also Read:
1) Hide Type field in Address panel of Sage CRM
2) How to add the Mobile Phone and Private Phone fields to the views being used by Find screens, Reports and Groups
3) How the address is arranged over multiple lines?
4) 3 Easy Steps to Add Sage CRM Custom Entity in Advanced Find
5) Create Document Template in Sage CRM 7.1 SP2 and SageCRM 7.2