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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 08.10.2018, 14:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
crmtipoftheday: Tip #1174: Create dead souls
Источник: https://crmtipoftheday.com/1174/create-dead-souls/
==============

After a short unplanned break we are back! For the past three weeks we’ve been travelling and taking part in Ignite, crafting and teaching BAD Masterclass, and preparing for CRMUG Summit which did leave us with a choice to either breathe or publish CRM Tip of the Day. Good news is that we survived and stashed some juicy tips waiting to be shared. Now, to the tip.

Frequently during the data import we need to preserve historical ownership of the data. Dynamics 365 Online does not allow creating user records in UI. Adding users in Office 365 portal, assigning Dynamics license, and then deleting the users is the only interactive way to create disabled user accounts.

It is possible to create disabled users by importing CSV file, but on odd occasion programmatic creation is required. Challenge is/was to come up with an absolute minimal set of fields required to create a “dead soul”. Here we go:

var user = new Entity("systemuser"); user["firstname"] = "test"; user["lastname"] = "testroni"; user["internalemailaddress"] = "test@samples.com"; user["businessunitid"] = new EntityReference("businessunit", new Guid("deadbeef-0aad-e711-a96d-000d3bb10143")); user["windowsliveid"] = "test@sample.com"; var userid = service.Create(user); Similar code can be used in PowerShell, JavaScript or any other language of your choice.

(Facebook and Twitter cover photo by NeONBRAND on Unsplash)



Источник: https://crmtipoftheday.com/1174/create-dead-souls/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
crmtipoftheday: Tip #1149: Create custom schedule for your flows Blog bot Dynamics CRM: Blogs 0 10.08.2018 19:11
crmtipoftheday: Tip #1148: Use visual controls + calculated fields to create an in-form dashboard Blog bot Dynamics CRM: Blogs 0 08.08.2018 14:11
crmtipoftheday: Tip #1060: Quickly create vector/SVG images for Dynamics 365 Blog bot Dynamics CRM: Blogs 0 24.01.2018 22:11
saurav-nav: NAV 2018 - Lots of New Objects! Blog bot NAV: Blogs 0 04.12.2017 10:11
crmtipoftheday: Tip #1018: Automatically create Dynamics 365 records from Social Engagement Blog bot Dynamics CRM: Blogs 0 08.11.2017 18:11
Опции темы Поиск в этой теме
Поиск в этой теме:

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

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

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

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