Click here to Skip to main content
15,892,737 members
Articles / Programming Languages / C#

How To Detect a Duplicate Entry in Microsoft CRM 3.0

Rate me:
Please Sign up or sign in to vote.
4.00/5 (1 vote)
9 Oct 2009CPOL2 min read 34.7K   97   12  
How to detect a duplicate entry in Microsoft CRM 3.0
<%@ Page language="c#" Codebehind="TestBed.aspx.cs" AutoEventWireup="false" Inherits="CheckDuplicateAccounts.TestBed" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > 

<html>
  <head>
    <title>TestBed</title>
    <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
    <meta name="CODE_LANGUAGE" Content="C#">
    <meta name=vs_defaultClientScript content="JavaScript">
    <meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
  </head>
  <body MS_POSITIONING="GridLayout">
	

		<script>
			debugger;
			var url = "http://localhost/CheckDuplicateAccounts/CheckDuplicateAccount.aspx?AccountNumber=" + crmForm.all.accountnumber.DataValue;
			var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			xmlhttp.open("POST", url, false);
			xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
			xmlhttp.send("");
			
			var result = xmlhttp.responseText;
			
			if(result != "0")
			{
				if(confirm("This account number already exists in the system, would you like to open the EXISTING account?"))
				{
					document.location = "http://"+document.domain+":5555/sfa/accts/edit.aspx?id=" + result;
				}
			
			}
			
			
		
		</script>
		
		


  </body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer MTS Allstream
Canada Canada
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions