Dynamics CRM address in Know more about D?

I am concerned about the ease of micro-channel public letter No: Microsoft Dynamics CRM experts Rayong, 169 or 20,151,105 reply may facilitate access to this article, but you can get the latest information I Bowen released the first time, follow me!

CRM in the address previously not very understanding, my family custom  prime princess Xinjiang specialty shop  CRM system, I noticed the address entered in the contact interface, use the Find function address when the interface is not found in order, do not have to manually re-entry delivery the address of the consignee and telephone and other information it? I did not get to the bottom, but today I'm going under careful study, to share with you, beating my perfect princess prime Xinjiang specialty shop CRM.
 
First we pass MetadataBrowser solutions to see how many entities associated with the address are under, I search for the next addre, see the following results, it seems pretty much related to the physical address, this time we focus on address (CustomerAddress) this entity.
 
The primary information screenshot entity following main attributes be name, or the only key field is customeraddressid, display name in addition to the primary key there is an address that is Composite, this is a complex field, after you enter the respective portions of the address and value. There is also a field type for the field objecttypecode set of options, it can not be customized, and only two options for customers and contacts.
 
That is the address to which the customer or contact belongs to it? It is related to the field by parentid. Contacts are associated with this field, this field is linked to the customer, this behavior is our custom field can not be done.
 
 It is noteworthy that there is a limit address of the entity is unable to establish a relationship with the other, whether it is 1: N, or N: 1, or N: N relationship, such as the Find field, you will find that the establishment of an entity can not be found:
 
We continue to test how to use, to establish a contact with me, and enter the following address.
 
Then the address entered here will enter the address of the entity (CustomerAddress) do? We use SQL directly to see to know:

select CustomerAddressId,ParentId,ObjectTypeCode,AddressNumber,Line1,
City,StateOrProvince,Country,Composite,DATEADD(HOUR,8,CreatedOn) as createdon
from CustomerAddress
where ParentId='A58C6780-8783-E511-80FD-000D3A80A5AB' and ObjectTypeCode=2

The results are as follows, you can know is to enter the address of the entity (CustomerAddress), and a new three lines, which is equal to the line 1 AddressNumber that I entered the address, the main contents of the other two lines are empty.
 
I have a question, if I create a contact entry does not address it, it will automatically create three records you help me? With this question, I created a contact, no entry will verify the results of the address saved, but the main content of the field is empty.
 
I continue to doubt, that if I change the address of the contact interface, the address of the entity recorded values ​​will follow automatically modify it? I put my home address into the address, go take a look and found automatically synchronized, this feature is not bad.
 
There are questions that each customer contact can only have three or address? I can add an address? So I used the following code to do the test:
static void Main(string[] args)
{
try
{
var service = GetOrganizationService();
var custaddr = new Entity("customeraddress");
custaddr["addressnumber"] = 4;
custaddr["parentid"] = new EntityReference("contact", new Guid("A58C6780-8783-E511-80FD-000D3A80A5AB"));
custaddr["Country " ] = " Chinese " ; 
custaddr [ " The StateOrProvince " ] = " Xinjiang " ; 
custaddr [ " City " ] = " Changji " ; 
custaddr [ " line1 " ] = " Hutubi County " ; 
custaddr [ " Composite " ] = " Changji Hutubi County " ; // this field to their own assignments, embarrassing 
custaddr [ " name "] = " Code increased address" ; 
Service.Create (custaddr); 
Console.WriteLine ( " procedure has completed! " ); 
The Console.ReadKey (); 
} 
the catch (Exception EX) 
{ 
Console.WriteLine ( " running experience an exception. " + Ex.Message ); 
the Console.ReadKey (); 
} 
}

 

The answer is to increase the success, we can see that with sql:
 
Of course, a high-level inquiry also can see, I am using the following query
 
Query results are as follows:
 
Double-click the record can be modified and saved, in this advanced query interface also can be deleted, but here there is no way to add. There is a way, just double-click on a record in, click Save and New contacts can be added or current customer's address, the address where the increase of composite fields are of no value, AddressNumber will automatically increase. There is a way, using the back of the order of address lookup function of time, you can also create a new address. The address form is preferably slightly customized look, increase the display 2 street, street 3, the address, the address number increases as column displays read-only field.
 
We created three default contact address lines, the other two do, I guess should correspond to the contact's address. 2 and 3 address field, then put it into the main form of contact above, as follows:
 
Then I went to enter both address information is as follows:
 
 
 You will find the corresponding AddreeNumber field is really his address of the entity to record 2 and 3.
 
 
Of course, if you prefer, you can insert the contact interface in a sub-grid to display the address, so that you can easily add addresses, but also easy to modify the address, after the address entry field name value of the address, the address will Find the address shown in the function (later a note). All I view the customer address here subgrid uses its own custom off, removing all of the filters (filter condition because the default is incorrect), modify the display column.
 
 
Here we next tested whether the order to use the above address, I've created an order, the order of potential customers (this does not translate well, the customer should be a good point of it) is to create a contact in front of me, myself. We used to find the address of the command bar to see:
 
You can see be able to find two addresses, the address of the other why not?
 
From this view we - Find view to start the customer's address bar. Incidentally, if I switch into customers all addresses not only not more, but less, and only address the code name for the increased address this address, the injury can not afford.
 
Open the Customer Address Lookup view filter condition, which under understand, four addresses only two can be seen, because it only shows the address field contains the name of the column address value, so set up a last name address after the address entered. I put this to delete selected conditions delete, save and publish, will show all the address? No, my test result is this, embarrassing.
 
Then we take a look at the filter criteria addresses of all customers view as far as saying an error displaying this condition, hey, bug, my approach is to remove these filter criteria.
 
I select an address to see the effect:
 
Really helped me fill in the address of the delivery address, the effect is as follows:
 
If I change the contact interface to the address, where the order it will react? That is, the order will automatically update the shipping address? The answer is no. Because this value is directly filled in the order entity. Order ShipTo_AddressId documented shipping address from which the address field is mapped to the address associated  ShipTo_City, ShipTo_Composite, ShipTo_Country, ShipTo_Line1, ShipTo_Line2, ShipTo_Line3, ShipTo_PostalCode, ShipTo_StateOrProvince fields.
But the address directly contact ( primarycontactname ) is not mapped to order  ShipTo_ContactName, address the main telephone ( telephone1 ) and not mapped to the order of ShipTo_Telephone field, an address in the Address Name Address ( name ) is not mapped to order the ShipTo_Name field.
I also do not know who developed Dynamics CRM why not leave a few fields corresponding to map it? These fields are not mapped yet more important. How to do? If you want to use real-time workflow or plug-ins to do, we have found that the problem is that monitoring can not  change ShipTo_AddressId this field, engage youngest son, oh. No conditions should create conditions on and see how I solved it.
In fact, the solution is very simple, that is to say the field is not mapped onto the pull-out orders interface on it, as follows
 
There is a small problem is that, if the shipping address selected from the above mentioned, the system will default to hide the following shipping address, contact name and not hide the phone number field of shipping and delivery to places I added, this simple, we use a business rules easily resolved.

Guess you like

Origin www.cnblogs.com/luoyong0201/p/Dynamics_CRM_Customer_Address.html