Вернуться   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Blogs
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

Опции темы Поиск в этой теме Опции просмотра
Старый 10.10.2018, 16:11   #1  
Blog bot is offline
Blog bot
21,916 / 759 (69) +++++++
Регистрация: 28.10.2006
crmtipoftheday: Tip #1176: Handling the Primary Field

Sometimes inspiration comes from unlikely sources. In this case it was not having written a tip for a few weeks and knowing George would meter out Spießrutenlaufen if I did not post soon. Thoughts of such things give one time to reflect and so I am going back to basics and addressing one of the great mysteries of Dynamics: the Primary Field.

Surprisingly, the TOTD crew have never tackled this one, other than as a step in Tip 646 but we are all familiar with its ways. If you are not familiar, the Primary Field is a text field created automatically whenever you create a new entity. Why it is necessary to create a default text field whenever we create a new entity? An excellent question and one that will not be answered as part of this Tip. No one knows. I can confirm that this behaviour has been there since the beginning, back when the product was known as Microsoft CRM. However, like decaffeinated coffee, the reason for its existence is a mystery.

By default the name of the Primary Field is ‘_name’ with a display name of ‘Name’. If this name is not appropriate, as per Tip 646, change it, ideally before saving the entity, otherwise, like all saved fields, you are stuck with the system name. You can always edit the display name by finding the field in the entity’s field list and modifying it like any other field. However, you cannot modify it through the Primary Field tab of the entity’s Information screen. That would be too easy.

Where possible, try to work the Primary Field into your list of fields for the entity but make sure it is a field which will be populated each time a new record is created and is generally unique for each record. If there is no text field which fits the bill you are better off making it non-compulsory and hiding it/removing it from the form. To make it non-compulsory, edit it through the fields list. The next question is whether you should auto-populate this field if you have removed it from the form and made it optional.

In my opinion, the answer is “usually yes”. The problem we have is if another record has a lookup to this entity, the value displayed in the lookup field is the Primary Field. We cannot change this so if we leave it blank, even if our lookup is pointing to a valid record, if the Primary Field is blank we will not readily know it. I am pretty old school in populating it and just use a workflow but there are so many ways to populate a field with a default value these days, take your pick. If there is no obvious role for the Primary Field for the entity, create a short description field for the record by concatenating key field values. Your lookups will thank you for it.

Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
crmtipoftheday: Tip #1127: Don’t update auto number field Blog bot Dynamics CRM: Blogs 0 05.07.2018 17:11
crmtipoftheday: Tip #1054: Hiding Field Service fields Blog bot Dynamics CRM: Blogs 0 16.01.2018 01:12
german_nav_developer: Upgrade Tips & Tricks Teil 3 Blog bot NAV: Blogs 0 17.03.2017 13:11
CRM DE LA CREME! Some more useful javascripts for MS CRM Blog bot Dynamics CRM: Blogs 0 04.05.2010 11:05
wiki.dynamicsbook: Changes Made in Navision Attain 3.60 Blog bot Dynamics CRM: Blogs 0 02.09.2008 13:23
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Часовой пояс GMT +3, время: 02:09.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.