Saturday 26 March 2016

Hide Div using jQuery


Description:



In this example we explain that how to hide DIV when click outside the DIV tag using JQuery in asp.net or how to show or hide (close) Div when mouse is out or click outside using jQuery.
JQuery to Hide element when click anywhere in webpage using jQuery.

Sometime we have requirement like Hide popup when click outside the document using jQuery.
Below is the code to hide or close the element or popup if click outside using jQuery.

jQuery Hide Div when Clicked Outside or Anywhere

Hide Div using jQuery


Description:



In this example we explain that how to hide DIV when click outside the DIV tag using JQuery in asp.net or how to show or hide (close) Div when mouse is out or click outside using jQuery.
JQuery to Hide element when click anywhere in webpage using jQuery.

Sometime we have requirement like Hide popup when click outside the document using jQuery.
Below is the code to hide or close the element or popup if click outside using jQuery.

Thursday 10 March 2016

get the Sales Team Member List of the Opportunity of Dynamic CRM

Description:

In this example we explain that how to Retrieve all the Access Team members for all Accounts in Dynamic CRM. Or how to get all the Sales Team Grid Member of the Opportunity of the Dynamics CRM.

SQL Query to get the Sales Team Member List of the Opportunity of Dynamic CRM.

To solve above all question first you have to understand the following Table in CRM.

·         PrincipalObjectAccess
·         TempBase
·         TeamMemberShip
·         TeamTemplate
·         SystemUser

Use the below query to retrieve all Team Member for Particular Accounts

SELECT    a.Name AS AccountName,a.AccountId, t.Name AS TeamName, u.FirstName, u.LastName, tt.TeamTemplateName
FROM        Account AS a INNER JOIN
PrincipalObjectAccess AS poa ON a.AccountId = poa.ObjectId INNER JOIN
TeamBase AS t ON poa.PrincipalId = t.TeamId INNER JOIN
TeamMembership AS tm ON t.TeamId = tm.TeamId INNER JOIN
SystemUser AS u ON tm.SystemUserId = u.SystemUserId INNER JOIN
TeamTemplate AS tt ON t.TeamTemplateId = tt.TeamTemplateId

Use the below query to retrieve all Sales Team Member for Particular Opportunity

select OpportunityId,
dbo.fn_new_GetSalesTeamForOpportunity(OpportunityId)  as 'Sales Team',
from Opportunity

below is the function that returns list of Sales Team member for particular Opportunity

CREATE FUNCTION fn_new_GetSalesTeamForOpportunity
(
    @OpportunityId UniqueIdentifier   
)
RETURNS VARCHAR(MAX)
AS
BEGIN
   return (SELECT STUFF((SELECT ',' + u.FirstName+u.LastName
FROM Opportunity AS a INNER JOIN
PrincipalObjectAccess AS poa ON a.OpportunityId = poa.ObjectId INNER JOIN
TeamBase AS t ON poa.PrincipalId = t.TeamId INNER JOIN
TeamMembership AS tm ON t.TeamId = tm.TeamId INNER JOIN
SystemUser AS u ON tm.SystemUserId = u.SystemUserId INNER JOIN
TeamTemplate AS tt ON t.TeamTemplateId = tt.TeamTemplateId where a.OpportunityId = @OpportunityId
FOR XML PATH('')), 1, 1, '') as 'Sales Team')
END
GO




Retrieve all the Access Team members for all Accounts in Dynamic CRM

get the Sales Team Member List of the Opportunity of Dynamic CRM

Description:

In this example we explain that how to Retrieve all the Access Team members for all Accounts in Dynamic CRM. Or how to get all the Sales Team Grid Member of the Opportunity of the Dynamics CRM.

SQL Query to get the Sales Team Member List of the Opportunity of Dynamic CRM.

To solve above all question first you have to understand the following Table in CRM.

·         PrincipalObjectAccess
·         TempBase
·         TeamMemberShip
·         TeamTemplate
·         SystemUser

Use the below query to retrieve all Team Member for Particular Accounts

SELECT    a.Name AS AccountName,a.AccountId, t.Name AS TeamName, u.FirstName, u.LastName, tt.TeamTemplateName
FROM        Account AS a INNER JOIN
PrincipalObjectAccess AS poa ON a.AccountId = poa.ObjectId INNER JOIN
TeamBase AS t ON poa.PrincipalId = t.TeamId INNER JOIN
TeamMembership AS tm ON t.TeamId = tm.TeamId INNER JOIN
SystemUser AS u ON tm.SystemUserId = u.SystemUserId INNER JOIN
TeamTemplate AS tt ON t.TeamTemplateId = tt.TeamTemplateId

Use the below query to retrieve all Sales Team Member for Particular Opportunity

select OpportunityId,
dbo.fn_new_GetSalesTeamForOpportunity(OpportunityId)  as 'Sales Team',
from Opportunity

below is the function that returns list of Sales Team member for particular Opportunity

CREATE FUNCTION fn_new_GetSalesTeamForOpportunity
(
    @OpportunityId UniqueIdentifier   
)
RETURNS VARCHAR(MAX)
AS
BEGIN
   return (SELECT STUFF((SELECT ',' + u.FirstName+u.LastName
FROM Opportunity AS a INNER JOIN
PrincipalObjectAccess AS poa ON a.OpportunityId = poa.ObjectId INNER JOIN
TeamBase AS t ON poa.PrincipalId = t.TeamId INNER JOIN
TeamMembership AS tm ON t.TeamId = tm.TeamId INNER JOIN
SystemUser AS u ON tm.SystemUserId = u.SystemUserId INNER JOIN
TeamTemplate AS tt ON t.TeamTemplateId = tt.TeamTemplateId where a.OpportunityId = @OpportunityId
FOR XML PATH('')), 1, 1, '') as 'Sales Team')
END
GO




This entry was posted in : ,

Wednesday 9 March 2016

 get Microsoft Dynamics CRM Option set values in SQL Server

Description:-

In this example we explain that how to get Microsoft Dynamics CRM Option set values in SQL Server. There are many question are generated in our mind like where does Microsoft Dynamics CRM store Option Set value in SQL Server?

Or SQL Query to retrieve text of the Option Set of the Dynamics CRM or Get Entity Option set values in Dynamics CRM 2011/2015 etc.

SQL Query to get the option set Label Name of Microsoft Dynamics CRM.

To above all question the solution is that these are stored in StringMapBase table. You will just query via object type code of the entity, option set value and language and that will give you the value of the attribute. Below is query for get Option set text or display label in SQL Server query

how to get Microsoft Dynamics CRM Option set values in SQL Server

 get Microsoft Dynamics CRM Option set values in SQL Server

Description:-

In this example we explain that how to get Microsoft Dynamics CRM Option set values in SQL Server. There are many question are generated in our mind like where does Microsoft Dynamics CRM store Option Set value in SQL Server?

Or SQL Query to retrieve text of the Option Set of the Dynamics CRM or Get Entity Option set values in Dynamics CRM 2011/2015 etc.

SQL Query to get the option set Label Name of Microsoft Dynamics CRM.

To above all question the solution is that these are stored in StringMapBase table. You will just query via object type code of the entity, option set value and language and that will give you the value of the attribute. Below is query for get Option set text or display label in SQL Server query
This entry was posted in : ,

Thursday 3 March 2016

The columns in table do not match an existing primary key or UNIQUE constraint

Description:-

In this example we explain that how to create composite key in SQL Server. How to reference foreign key to different child table with composite primary key. Or how to create many too many relationship in SQL Server. For example DemoTable1 have primary key (col1, col2, col3) so how to create a foreign key in DemoTable2 which will referred only (col1, col2) field of DemoTable1?

This scenario is not possible because error is generated like “The columns in table do not match an existing primary key or UNIQUE constraint.”  So to achieve this you have to define (col1, col2) are unique in a table then you can easily define a foreign key relationship, but it must be on a separate unique key, and not on the primary key

how to create composite key in Table of SQL Server.

The columns in table do not match an existing primary key or UNIQUE constraint

Description:-

In this example we explain that how to create composite key in SQL Server. How to reference foreign key to different child table with composite primary key. Or how to create many too many relationship in SQL Server. For example DemoTable1 have primary key (col1, col2, col3) so how to create a foreign key in DemoTable2 which will referred only (col1, col2) field of DemoTable1?

This scenario is not possible because error is generated like “The columns in table do not match an existing primary key or UNIQUE constraint.”  So to achieve this you have to define (col1, col2) are unique in a table then you can easily define a foreign key relationship, but it must be on a separate unique key, and not on the primary key

This entry was posted in :

Tuesday 1 March 2016








Description:-

In this example we explain that how to get current user Business Unit Details in CRM 2015 using C# plugin. Or how to get details of the Business Unit in CRM plugin using C#.or how to get Business unit from Dynamic CRM 2015 plugin.

That is live issue that I have faced the requirement was that like when we create Lead in CRM then that’s Lead data are Insert/transferred into Dynamics AX automatically. For that requirements we have create one plugin that is called when new Lead is created and in which plugin we define the logic that will fetch the Last inserted Lead data and insert/transfer into Dynamic AX database.
But the finally problem was that we cannot get the Business Unit (Company name) of the current logged in user in CRM that we want to transfer in AX because requirement was that if current logged in users business unit is suppose “CRMAhmedabad” then in AX databases Lead Table Company field have value “CRMAhmedabad” when new Lead is insert same like if business unit is “CRMRajkot” then company field of the Lead table in AX Database have value “CRMRajkot”.

How to get current user Business Unit Details in CRM 2015 using C# plugin








Description:-

In this example we explain that how to get current user Business Unit Details in CRM 2015 using C# plugin. Or how to get details of the Business Unit in CRM plugin using C#.or how to get Business unit from Dynamic CRM 2015 plugin.

That is live issue that I have faced the requirement was that like when we create Lead in CRM then that’s Lead data are Insert/transferred into Dynamics AX automatically. For that requirements we have create one plugin that is called when new Lead is created and in which plugin we define the logic that will fetch the Last inserted Lead data and insert/transfer into Dynamic AX database.
But the finally problem was that we cannot get the Business Unit (Company name) of the current logged in user in CRM that we want to transfer in AX because requirement was that if current logged in users business unit is suppose “CRMAhmedabad” then in AX databases Lead Table Company field have value “CRMAhmedabad” when new Lead is insert same like if business unit is “CRMRajkot” then company field of the Lead table in AX Database have value “CRMRajkot”.
This entry was posted in : ,