Access to the views of CRM through a local SQL user

From EN Ikoula wiki
⧼vector-jumptonavigation⧽ ⧼vector-jumptosearch⧽

fr:Accéder aux vues de CRM grâce à un utilisateur SQL local en:Access to the views of CRM through a local SQL user es:Acceso a los puntos de vista de CRM a través de un usuario local de SQL pt:Acesso aos pontos de vista de CRM através de um usuário local do SQL it:Accesso alle visualizzazioni di CRM attraverso un utente SQL locale nl:Toegang tot de standpunten van CRM door middel van een lokale SQL-gebruiker de:Zugriff auf die Ansichten von CRM durch einen lokalen SQL-Benutzer zh:对视图的 CRM 通过本地 SQL 用户访问 ar:الحصول على آراء CRM عن طريق مستخدم SQL المحلي ja:ローカルの SQL ユーザーを使用して CRM のビューへのアクセス pl:Dostęp do widoków CRM za pomocą lokalnego użytkownika SQL ru:Доступ к представлениям CRM через локальный пользователь SQL ro:Acces la punctele de vedere ale CRM prin intermediul unui utilizator local SQL he:גישה אל הנופים של CRM באמצעות SQL משתמש מקומי en:Access to the views of CRM through a local SQL user he:גישה אל הנופים של CRM באמצעות SQL משתמש מקומי ru:Доступ к представлениям CRM через локальный пользователь SQL ja:ローカルの SQL ユーザーを使用して CRM のビューへのアクセス ar:الحصول على آراء CRM عن طريق مستخدم SQL المحلي zh:对视图的 CRM 通过本地 SQL 用户访问 ro:Acces la punctele de vedere ale CRM prin intermediul unui utilizator local SQL pl:Dostęp do widoków CRM za pomocą lokalnego użytkownika SQL de:Zugriff auf die Ansichten von CRM durch einen lokalen SQL-Benutzer nl:Toegang tot de standpunten van CRM door middel van een lokale SQL-gebruiker it:Accesso alle visualizzazioni di CRM attraverso un utente SQL locale pt:Acesso aos pontos de vista de CRM através de um usuário local do SQL es:Acceso a los puntos de vista de CRM a través de un usuario local de SQL fr:Accéder aux vues de CRM grâce à un utilisateur SQL local

This article has been created by an automatic translation software. You can view the article source here.


Introduction

This article will inform you on how to access the views of CRM (FilteredNameView) by using a local account on the server SQL.

Prerequisites

Need you to be able to access these views, :

  • A user Active Directory dedicated to CRM
  • A local account on SQL Server dedicated to this task
  • Access to the Super Administrator account from SQL Server

Problematic

CRM blocks the use of views if the user does not have the role of reading, so the local user does not, as well as the Super Administrator account for the server SQL. This is a fail-safe to CRM. Must be part of the domain and be inserted in CRM.

Procedure

To have access to views, we must add a procedure SQL.

Here is the procedure :

SET ANSI_NULLS ON 
GB 
SET QUOTED_IDENTIFIER ON 
GB 
CREATE PROCEDURE AccessViewCRMLocal 
AS 
BEGIN 
    EXEC sp_addrolemember do CRMReaderRole ', VOTRE_UTILISATEUR_LOCAL' 
    DECLARE @UID uniqueidentifier 
    SELECT @UID  = SystemUserId FROM dbo. SystemUserBase WHERE FullName  = 'LE_NOM_DU_COMPTE_CRM' 
    SET CONTEXT_INFO @UID 
END

To perform this procedure with the Super Administrator account so that it either creates on the server SQL de CRM.

Example : Access to the content of the views thanks to PHP

This example will allow you to access the stored accounts in CRM via the Framework Yii.

// It stores the connection to CRM via Yii connection handler 
$connexionCrm = Yii::app ()->db_crm ;

// We execute  the procedure to access the views 
$connexionCrm - >createCommand  ("EXECUTE AccessViewCRMLocal ")->execute();

// It retrieves the accounts stored in CRM 
$query  = "SELECT accountid, name, address   1_addresstypecode, address 1_City, address 1_line   1, address1_line2, address1_line3 FROM FilteredAccount "
$accounts = $connexionCrm - >createCommand($query)->queryAll ();

Your client accounts are now in the variable $accounts.

Conclusion

Through this article, you can now access the views in CRM, and thus avoid repeating joins made database.



This article seemed you to be useful ?

0



You are not allowed to post comments.