Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: integrate sugarcrm with my asp.net application

  1. #1
    pkaminiv is offline Member
    Join Date
    Jul 2007
    Posts
    8

    Default integrate sugarcrm with my asp.net application

    hello


    I Have not any single idea that how to inegrate sugarCRM with asp.net application.............


    just give me idea from where i start ,,,,,,,,,,,,,,,,give me step by step idea what i do,,,,,,,,,,


    and my database is in sql server..


    thanks,
    kamini

  2. #2
    rog211's Avatar
    rog211 is offline Sugar Team Member
    Join Date
    Jun 2005
    Posts
    320

    Default Re: integrate sugarcrm with my asp.net application

    Have you tried using our Web Service to integrate your asp.net application with SugarCRM?
    Roger R. Smith
    Application Architect
    SugarCRM Inc.

  3. #3
    webjive81 is offline Member
    Join Date
    Aug 2007
    Posts
    6

    Default Re: integrate sugarcrm with my asp.net application

    pkaminiv,

    I am in the same situation as you. Unfortunately it's been difficult to find anybody who can give any solid information on how to integrate .net with sugarCRM.

    Like "rog211" previously stated, you need to start out by setting up your web service to your sugarCRM API. If you have Visual Studio, then this should be a breeze since you simply add a web reference. Then you need to enter the URL to the location of your API. It should look something like this - "www.companyhostingsugar.com/yourname/soap.php?wsdl".

    What to do next, I am working on myself. I need to take information from a .Net (C#) webform and insert it into SugarCRM, but I haven't been able to find a prime example or scripts on how to do this. Sadly, most have been reluctant to help. I'll keep you updated if I find out anymore information.

  4. #4
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: integrate sugarcrm with my asp.net application

    Quote Originally Posted by webjive81
    What to do next, I am working on myself. I need to take information from a .Net (C#) webform and insert it into SugarCRM, but I haven't been able to find a prime example or scripts on how to do this. Sadly, most have been reluctant to help. I'll keep you updated if I find out anymore information.
    Have you read the C# sample in the Wiki? http://www.sugarcrm.com/wiki/index.p...SOAP_in_CSharp

    If you do a search for SOAP in the Wiki you'll be able to find a number of other examples that one can translate to whatever desired language.
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  5. #5
    webjive81 is offline Member
    Join Date
    Aug 2007
    Posts
    6

    Default Re: integrate sugarcrm with my asp.net application

    Wow! This is exactly what I needed! Thanks Angel!

  6. #6
    webjive81 is offline Member
    Join Date
    Aug 2007
    Posts
    6

    Default Re: integrate sugarcrm with my asp.net application

    Nuts. I still can't find an example for inserting a contact via SugarCRM API using C#. Any help on this?

  7. #7
    pkaminiv is offline Member
    Join Date
    Jul 2007
    Posts
    8

    Default Re: integrate sugarcrm with my asp.net application

    thanks all of you

    yes..........i have also use soap api web service.........i have also add reference on my site.............and

    also i have read docuent which is on wiki...................

    lets briefly i tell u that i want to integrate my database with sugar database............so that i can found new opportunity

    if i insert any employee in my databse then it shold be insert in sugar database.........

    i have tried that much code.......but i can't do login........i think i have to first make entry in database,,,,,,,,,,,,,but how i do it

    there is no any idea,,,,,,,,,,,,,,,,


    sugarsoap sop = new sugarsoap();
    set_entries_result getsession=new set_entries_result();
    user_auth credintials =new user_auth();
    string strdefault;
    string struserguid;
    protected void Page_Load(object sender, EventArgs e)
    {

    credintials.user_name = "kamini";
    credintials.password="kamini";
    strdefault= sop.test("Test123");
    struserguid=sop.login(credintials.user_name, credintials.password);
    getsession = struserguid;

    strdefault = sop.get_user_id(getsession);
    name_value name = new name_value();
    name.name = "kamini";
    name.value = "1";


    once again thank you


    if i found something new then i will tell u

  8. #8
    pkaminiv is offline Member
    Join Date
    Jul 2007
    Posts
    8

    Default Re: integrate sugarcrm with my asp.net application

    hello webjive81


    thanks........also read this attachment.may be it will help u...........also refer some link

    that may help u

    http://www.sugarcrm.com/wiki/index.p..._Documentation
    Attached Files Attached Files

  9. #9
    webjive81 is offline Member
    Join Date
    Aug 2007
    Posts
    6

    Lightbulb Re: integrate sugarcrm with my asp.net application

    Got it! I was finally able to insert a contact. See below.

    This is how you insert a contact into SugarCRM using ASP.NET (C#). Let me know if you have any questions! If any of you think this would be useful to see in VB.NET, I'd be happy to convert it.

    Angel and pkaminiv - Thanks for your help!

    Code:
    using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Configuration;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Security.Cryptography;
    using System.Text;
    using System.Web.Security;
    using System.Web.SessionState;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    using com.salesaccessmanager.www;
    
    namespace testing
    {
    	/// <summary>
    	/// Summary description for test02.
    	/// </summary>
    	public class test02 : System.Web.UI.Page
    	{
    		private sugarsoap sugarClient;
    		private string sessionId;
    		private string error;
    		private string Username = ConfigurationSettings.AppSettings["SugarUsername"];
    		private string Password = ConfigurationSettings.AppSettings["SugarPassword"];
    
    		private void Page_Load(object sender, System.EventArgs e)
    		{
    			this.sugarClient = new sugarsoap();
    
    			//Set the default value
    			this.sessionId = string.Empty;
    
    			this.Authenticate();
    
    			Response.Write( this.SubmitForm() );
    		}
    
    		public string Error
    		{
    			get{	return this.error;	}
    		}
    
    		public bool Authenticate() //string Username, string Password)
    		{
    			//Create an authentication object
    			user_auth user = new user_auth();
    
    			//Set the credentials
    			user.user_name	= Username;
    			user.password	= this.computeMD5String(Password);
    			user.version	= "1";
    
    			//Try to authenticate
    			set_entry_result authentication_result = this.sugarClient.login(user, "leadcapture");
    
    			//Check for errors
    			if(Convert.ToInt32(authentication_result.error.number) != 0)
    			{
    				//An error occured
    				this.error = string.Concat(authentication_result.error.name, ": ", authentication_result.error.description);
    
    				//Clear the existing sessionId
    				this.sessionId = string.Empty;
    			}
    			else
    			{
    				//Set the sessionId
    				this.sessionId = authentication_result.id;
    
    				//Clear the existing error
    				this.error = string.Empty;
    			}
    
    			//Return the boolean
    			return (this.sessionId != string.Empty);
    		}
    
    		public string SubmitForm()
    		{
    			// Create Name Value Array
    			name_value[] nvl = new name_value[3];
    
    			// Insert Form Values
    			nvl[0] = SetNameValuePair("first_name", "Josy");
    			nvl[1] = SetNameValuePair("last_name",	"Test2");
    			nvl[2] = SetNameValuePair("email",	"Josy@test2.com");
    
    			// Insert into Contacts inside of Sugar CRM
    			set_entry_result ser = this.sugarClient.set_entry( sessionId, "Contacts", nvl );
    				
    			return "sID: " + sessionId.ToString() + "<br />name: " + nvl[1].value;
    		}
    
    		private name_value SetNameValuePair(string nv_name, string nv_value)
    		{
    			name_value nv	= new name_value();
    			nv.name		= nv_name;
    			nv.value	= nv_value;
    			return nv;
    		}
    
    		private string computeMD5String(string PlainText)
    		{
    			MD5 md5 = MD5.Create();
    			byte[] inputBuffer = System.Text.Encoding.ASCII.GetBytes(PlainText);
    			byte[] outputBuffer = md5.ComputeHash(inputBuffer);
    
    			//Convert the byte[] to a hex-string
    			StringBuilder builder = new StringBuilder(outputBuffer.Length);
    			for(int i=0; i<outputBuffer.Length; i++)
    			{
    				builder.Append(outputBuffer[i].ToString("X2"));
    			}
    
    			return builder.ToString();
    		}
    		#region Web Form Designer generated code
    		override protected void OnInit(EventArgs e)
    		{
    			//
    			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
    			//
    			InitializeComponent();
    			base.OnInit(e);
    		}
    		
    		/// <summary>
    		/// Required method for Designer support - do not modify
    		/// the contents of this method with the code editor.
    		/// </summary>
    		private void InitializeComponent()
    		{    
    			this.Load += new System.EventHandler(this.Page_Load);
    		}
    		#endregion
    	}
    }
    Last edited by webjive81; 2007-08-21 at 07:35 PM.

  10. #10
    pkaminiv is offline Member
    Join Date
    Jul 2007
    Posts
    8

    Default Re: integrate sugarcrm with my asp.net application

    Thanks webjiv81

    thank u so much.....for yr help......

    but i have one problem...i got one eror


    user.password = this.computeMD5String(Password);


    in this u pass the value of password ....but i can't undestand what is the value of password...

    and when i am runnig the value of password is null.....so at last in computMD5string function i got error

    give me idea what i am doing now


    thanks

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. integrate sugarCRM with .net application
    By pkaminiv in forum Developer Help
    Replies: 5
    Last Post: 2007-08-09, 05:26 PM
  2. Quick Create not working in Contacts popup
    By pniranjan in forum Developer Help
    Replies: 1
    Last Post: 2007-04-26, 01:10 PM
  3. Replies: 61
    Last Post: 2006-10-22, 08:40 AM
  4. Merge Contacts show sql error
    By hheckner in forum General Discussion
    Replies: 5
    Last Post: 2006-10-04, 01:57 PM
  5. Replies: 16
    Last Post: 2006-07-29, 07:28 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •