{"id":18,"date":"2016-05-06T08:42:13","date_gmt":"2016-05-06T08:42:13","guid":{"rendered":"http:\/\/symbioticindia.in\/docu\/?p=18"},"modified":"2016-05-06T08:46:41","modified_gmt":"2016-05-06T08:46:41","slug":"sugarcrm-integration-with-custom-vb6-applications","status":"publish","type":"post","link":"http:\/\/symbioticindia.in\/docu\/2016\/05\/06\/sugarcrm-integration-with-custom-vb6-applications\/","title":{"rendered":"SugarCRM integration with custom VB6 applications"},"content":{"rendered":"<table class=\"contentpaneopen\">\n<tbody>\n<tr>\n<td colspan=\"2\" valign=\"top\">\n<table>\n<tbody>\n<tr>\n<td>\n<div>\n<p><span style=\"font-size: medium;\"><strong><span style=\"font-size: small;\">Introduction<\/span><\/strong><\/span><\/p>\n<\/div>\n<p><span style=\"font-size: small;\">Here we are with another article about SugarCRM integration with various languages\/platforms. This time we&#8217;ll discuss interacting with SugarCRM from VB6.<br \/>\nLots of developers and software houses have decided not to migrate their code from VB6 to VB.NET for various reasons, and I&#8217;m constantly being asked for mentoring and consulting by software houses needing integration between their legacy VB6 applications and SugarCRM.<br \/>\nThere are several ways to cope with SOAP in VB6, MS Soap Toolkit being one the best known and used, even if deprecated by Microsoft. We&#8217;ll be using another tool, <a title=\"PocketSoap\" href=\"http:\/\/www.pocketsoap.com\/\">PocketSoap<\/a> , which in my opinion is one of the most complete and easy to use.<br \/>\nPocketSoap is , as stated on its site: &#8220;<em>an Open Source [<a href=\"http:\/\/www.mozilla.org\/MPL\/MPL-1.1.html\" target=\"_blank\">MPL<\/a>] SOAP client COM component for the Windows family<\/em>&#8220;. We&#8217;ll use it to automatically build all the classes we need to interact with our SugarCRM installation.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div><\/div>\n<div><\/div>\n<div>\n<p><span style=\"font-size: medium;\"><span style=\"font-size: small;\"><strong>Building our Proxy classes<\/strong><\/span><\/span><\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<div>\n<div><span style=\"font-size: small;\"><span style=\"font-size: small;\">Easy task, as all the hard work will be done by PocketSoap. Let&#8217;s launch the program &#8220;PocketSOAP Wsdl Wizard&#8221;. All it needs is the URL for the WSDL exposed by SugarCRM.<br \/>\nJust for the lazy people, here is the definition of wsdl taken from <a title=\"Wikipedia\" href=\"http:\/\/en.wikipedia.org\/wiki\/Web_Services_Description_Language\">Wikipedia<\/a>:<br \/>\n&#8220;The <strong>Web Services Description Language<\/strong> (WSDL, pronounced &#8216;wiz-d\u0259l&#8217; or spelled out, &#8216;W-S-D-L&#8217;) is an <a title=\"XML\" href=\"http:\/\/en.wikipedia.org\/wiki\/XML\">XML<\/a>-based language that provides a model for describing <a title=\"Web service\" href=\"http:\/\/en.wikipedia.org\/wiki\/Web_service\">Web services<\/a>.&#8221;<br \/>\nBasically, a wsdl file formally describes the methods(operations) exposed by a web service and all the data types used.\u00a0 Using it, pocketsoap wsdl wizard is able to translate the calls to these methods to proper VB code.<br \/>\nNow, this is more or less what we&#8217;ll input in the first form of the wizard(&#8220;yourhost&#8221; being the IP of your SugarCRM installation):<\/span><\/span>&nbsp;<\/p>\n<div id=\"uoh2\"><span style=\"font-size: small;\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.beanizer.org\/img\/articles\/sugar_vb6\/pocketsoap1.png\" alt=\"PocketSoap sdl wizard 1\" width=\"409\" height=\"385\" \/><\/span><\/div>\n<\/div>\n<\/div>\n<p><span style=\"font-size: medium;\"><span style=\"font-size: small;\">Make sure the directory you indicate exists.<br \/>\nAfter clicking &#8220;Next&#8221;, if everything is correct, we&#8217;ll be shown the services found by the wizard:<\/span><\/span><\/p>\n<p>&nbsp;<\/p>\n<div id=\"m_d9\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.beanizer.org\/img\/articles\/sugar_vb6\/pocketsoap2.png\" alt=\"PocketSoap wsdl wizard 2\" width=\"409\" height=\"386\" \/><\/div>\n<p><span style=\"font-size: medium;\"><span style=\"font-size: small;\"><br \/>\nAgain, let&#8217;s click &#8220;Next&#8221; and we&#8217;ll be shown the list of operations (that is methods) available.<\/span><\/span><\/p>\n<p>&nbsp;<\/p>\n<div id=\"yeqy\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.beanizer.org\/img\/articles\/sugar_vb6\/pocketsoap3.png\" alt=\"PocketSoap wsdl wizard 3\" width=\"410\" height=\"386\" \/><\/div>\n<p>&nbsp;<\/p>\n<p>Make sure they are all selected, and click &#8220;Next&#8221; once again.<br \/>\nAt this point, in the previously selected directory, we&#8217;ll find\u00a0 an &#8220;ActiveX DLL&#8221; VB6 project containing all the classes we need. The generator will automatically add PocketSoap Type Library to the list of references of our project.<br \/>\nNow it&#8217;s time to use the generated code to connect to SugarCRM.<\/p>\n<p>&nbsp;<\/p>\n<div><span style=\"font-size: small;\"><span style=\"font-size: medium;\"><strong>Let&#8217;s login<\/strong><\/span><br \/>\n<\/span><\/div>\n<p>&nbsp;<\/p>\n<p>Let&#8217;s create a VB project(a simple exe project will be just fine) and add our previously generated ActiveX DLL as reference.<br \/>\nThe first lines of code we need are:<\/p>\n<p><span style=\"color: #0033cc;\">Dim<\/span> soap <span style=\"color: #0033cc;\">As<\/span> sugarsoapPortType<br \/>\n<span style=\"color: #0033cc;\">Set<\/span> soap <span style=\"color: #9933ff;\">=<\/span> <span style=\"color: #0033cc;\">New<\/span> sugarsoapPortType<\/p>\n<p>to instantiate the proxy class we&#8217;ll use to call the various operations.<br \/>\nThe first call we&#8217;ll do is\u00a0 &#8220;login&#8221;, to obtain a session id required by most other calls.<br \/>\n&#8220;login&#8221; requires as parameters a &#8220;userauth&#8221; type and a custom application name. &#8220;userauth&#8221; is composed of: a username, an md5 encoded password and a version string. Here is the code:<\/p>\n<p><span style=\"color: #0033cc;\">Dim<\/span> user <span style=\"color: #0033cc;\">As<\/span> userauth<br \/>\n<span style=\"color: #0033cc;\">Dim<\/span> loginresult <span style=\"color: #0033cc;\">As<\/span> setentryresult<\/p>\n<p><span style=\"color: #0033cc;\">Set<\/span> user <span style=\"color: #9933ff;\">=<\/span> <span style=\"color: #0033cc;\">New<\/span> userauth<\/p>\n<p>user<span style=\"color: #9933ff;\">.<\/span>username <span style=\"color: #9933ff;\">=<\/span> <span style=\"color: #7c0000;\">&#8220;<\/span><span style=\"color: #7c0000;\">admin<\/span><span style=\"color: #7c0000;\">&#8220;<\/span><br \/>\nuser<span style=\"color: #9933ff;\">.<\/span>password <span style=\"color: #9933ff;\">=<\/span> <span style=\"color: #7c0000;\">&#8220;<\/span><span style=\"color: #7c0000;\">526ee3641d541a646b4adff94e97dc8d<\/span><span style=\"color: #7c0000;\">&#8220;<\/span><br \/>\nuser<span style=\"color: #9933ff;\">.<\/span>version <span style=\"color: #9933ff;\">=<\/span> <span style=\"color: #7c0000;\">&#8220;<\/span><span style=\"color: #7c0000;\">1.0<\/span><span style=\"color: #7c0000;\">&#8220;<\/span><br \/>\n<span style=\"color: #0033cc;\">Set<\/span> loginresult <span style=\"color: #9933ff;\">=<\/span> soap<span style=\"color: #9933ff;\">.<\/span>login(user, <span style=\"color: #7c0000;\">&#8220;<\/span><span style=\"color: #7c0000;\">test<\/span><span style=\"color: #7c0000;\">&#8220;<\/span>)<br \/>\n<span style=\"color: #0033cc;\">If<\/span> loginresult<span style=\"color: #9933ff;\">.<\/span><span style=\"color: #0033cc;\">Error<\/span><span style=\"color: #9933ff;\">.<\/span>Number <span style=\"color: #9933ff;\">&lt;<\/span><span style=\"color: #9933ff;\">&gt;<\/span> <span style=\"color: #008080;\">0<\/span> <span style=\"color: #0033cc;\">Then<\/span><br \/>\n<span style=\"color: #006600;\">MsgBox<\/span> loginresult<span style=\"color: #9933ff;\">.<\/span><span style=\"color: #0033cc;\">Error<\/span><span style=\"color: #9933ff;\">.<\/span>Description <span style=\"color: #9933ff;\">+<\/span> <span style=\"color: #7c0000;\">&#8220;<\/span> <span style=\"color: #7c0000;\">&#8211;<\/span> <span style=\"color: #7c0000;\">&#8220;<\/span> <span style=\"color: #9933ff;\">+<\/span> loginresult<span style=\"color: #9933ff;\">.<\/span><span style=\"color: #0033cc;\">Error<\/span><span style=\"color: #9933ff;\">.<\/span>Description<br \/>\n<span style=\"color: #0033cc;\">Else<\/span><br \/>\n<span style=\"color: #006600;\">MsgBox<\/span> loginresult<span style=\"color: #9933ff;\">.<\/span>id<br \/>\n<span style=\"color: #0033cc;\">End<\/span> <span style=\"color: #0033cc;\">If<\/span><\/p>\n<p>&#8220;setentryresult&#8221; is the data type we get back from the call. It will contain an error object(with number,name and description properties), and an &#8220;id&#8221; string.<br \/>\nIf the login succeeds, &#8220;loginresult.Error.Number&#8221; wil be &#8220;0&#8221; and &#8220;loginresult.id&#8221; will contain a valid session id we&#8217;ll use later.<br \/>\nTo get the md5 hash of the password, there are plenty of online services, like <a title=\"this\" href=\"http:\/\/md5-hash-online.waraxe.us\/\">this<\/a> . For example the md5 you see in the code corresponds to the word &#8220;adminpassword&#8221;.<br \/>\n&#8220;user.version&#8221; seems not to be relevant,and the second parameter of the &#8220;soap.login&#8221; call (&#8220;test&#8221; in this case) is just a custom name for your application.<br \/>\nNow that we have a valid session id , we can call more interesting methods exposed by SugarCRM Soap interface.<\/p>\n<p>&nbsp;<\/p>\n<div>\n<p><span style=\"font-size: small;\"><strong>Getting data from SugarCRM<\/strong><\/span><\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<p><span style=\"font-size: medium;\"><span style=\"font-size: small;\">We&#8217;ll query SugarCRM&#8217;s &#8220;Contact&#8221; module to get some data. The method involved is &#8220;get_entry_list&#8221; and the parameters it expects are:<br \/>\n<\/span><\/span><\/p>\n<ul>\n<li>a valid session id, the one we obtained with the &#8220;login&#8221; operation<\/li>\n<li>the module name, &#8220;Contacts&#8221; in our case (could be any of SugarCRM modules)<\/li>\n<li>a query, the sql &#8220;WHERE&#8221; clause<\/li>\n<li>the records order, the sql &#8220;ORDER BY&#8221; clause<\/li>\n<li>an offset, used in case of pagination of records, where to start in the recordset<\/li>\n<li>a string array containing the fields required in the returned recordset<\/li>\n<li>the maximun number of records to return<\/li>\n<li>a &#8220;deleted&#8221; flag. If not 0 also deleted records will be returned(SugarCRM doesn&#8217;t physically delete records, it just flags them as deleted)<\/li>\n<\/ul>\n<p><span style=\"font-size: medium;\"><span style=\"font-size: small;\"><br \/>\nJust like before, we first instance the various data type objects we need.<\/span><\/span><\/p>\n<p><span style=\"color: #0033cc;\">Dim<\/span> entrylistresult <span style=\"color: #0033cc;\">As<\/span> getentrylistresult<br \/>\n<span style=\"color: #0033cc;\">Dim<\/span> elist() <span style=\"color: #0033cc;\">As<\/span> entryvalue<br \/>\n<span style=\"color: #0033cc;\">Dim<\/span> nvaluelist() <span style=\"color: #0033cc;\">As<\/span> namevalue<br \/>\n<span style=\"color: #0033cc;\">Dim<\/span> fields(<span style=\"color: #008080;\">0<\/span> <span style=\"color: #0033cc;\">To<\/span> <span style=\"color: #008080;\">3<\/span>) <span style=\"color: #0033cc;\">As<\/span> <span style=\"color: #006600;\">String<\/span><br \/>\nfields(<span style=\"color: #008080;\">0<\/span>) <span style=\"color: #9933ff;\">=<\/span> <span style=\"color: #7c0000;\">&#8220;<\/span><span style=\"color: #7c0000;\">first_name<\/span><span style=\"color: #7c0000;\">&#8220;<\/span><br \/>\nfields(<span style=\"color: #008080;\">1<\/span>) <span style=\"color: #9933ff;\">=<\/span> <span style=\"color: #7c0000;\">&#8220;<\/span><span style=\"color: #7c0000;\">last_name<\/span><span style=\"color: #7c0000;\">&#8220;<\/span><br \/>\nfields(<span style=\"color: #008080;\">2<\/span>) <span style=\"color: #9933ff;\">=<\/span> <span style=\"color: #7c0000;\">&#8220;<\/span><span style=\"color: #7c0000;\">email1<\/span><span style=\"color: #7c0000;\">&#8220;<\/span><\/p>\n<p><span style=\"color: #0033cc;\">Dim<\/span> str <span style=\"color: #0033cc;\">As<\/span> <span style=\"color: #006600;\">String<\/span><\/p>\n<p>And finally we call the &#8220;get_entry_list&#8221; method.<\/p>\n<p><span style=\"color: #0033cc;\">Set<\/span> entrylistresult <span style=\"color: #9933ff;\">=<\/span> soap<span style=\"color: #9933ff;\">.<\/span>get_entry_list(loginresult<span style=\"color: #9933ff;\">.<\/span>id, <span style=\"color: #7c0000;\">&#8220;<\/span><span style=\"color: #7c0000;\">Contacts<\/span><span style=\"color: #7c0000;\">&#8220;<\/span>, <span style=\"color: #7c0000;\">&#8220;<\/span><span style=\"color: #7c0000;\">contacts.last_name<\/span> <span style=\"color: #7c0000;\">&lt;&gt;&#8221;<\/span><span style=\"color: #7c0000;\">&#8220;<\/span>, <span style=\"color: #7c0000;\">&#8220;<\/span><span style=\"color: #7c0000;\">contacts.last_name<\/span> <span style=\"color: #7c0000;\">desc<\/span><span style=\"color: #7c0000;\">&#8220;<\/span>, <span style=\"color: #008080;\">0<\/span>, fields, <span style=\"color: #008080;\">20<\/span>, <span style=\"color: #008080;\">0<\/span>)<br \/>\n<span style=\"color: #0033cc;\">If<\/span> entrylistresult<span style=\"color: #9933ff;\">.<\/span><span style=\"color: #0033cc;\">Error<\/span><span style=\"color: #9933ff;\">.<\/span>Number <span style=\"color: #9933ff;\">&lt;<\/span><span style=\"color: #9933ff;\">&gt;<\/span> <span style=\"color: #008080;\">0<\/span> <span style=\"color: #0033cc;\">Then<\/span><br \/>\n<span style=\"color: #006600;\">MsgBox<\/span> entrylistresult<span style=\"color: #9933ff;\">.<\/span><span style=\"color: #0033cc;\">Error<\/span><span style=\"color: #9933ff;\">.<\/span>Description <span style=\"color: #9933ff;\">+<\/span> <span style=\"color: #7c0000;\">&#8220;<\/span> <span style=\"color: #7c0000;\">&#8211;<\/span> <span style=\"color: #7c0000;\">&#8220;<\/span> <span style=\"color: #9933ff;\">+<\/span> entrylistresult<span style=\"color: #9933ff;\">.<\/span><span style=\"color: #0033cc;\">Error<\/span><span style=\"color: #9933ff;\">.<\/span>Description<br \/>\n<span style=\"color: #0033cc;\">Else<\/span><br \/>\nelist <span style=\"color: #9933ff;\">=<\/span> entrylistresult<span style=\"color: #9933ff;\">.<\/span>entrylist<br \/>\n<span style=\"color: #0033cc;\">For<\/span> t <span style=\"color: #9933ff;\">=<\/span> <span style=\"color: #008080;\">0<\/span> <span style=\"color: #0033cc;\">To<\/span> <span style=\"color: #006600;\">UBound<\/span>(elist)<br \/>\nnvaluelist <span style=\"color: #9933ff;\">=<\/span> elist(t)<span style=\"color: #9933ff;\">.<\/span>namevaluelist<br \/>\nstr <span style=\"color: #9933ff;\">=<\/span> <span style=\"color: #7c0000;\">&#8220;<\/span><span style=\"color: #7c0000;\">&#8220;<\/span><br \/>\n<span style=\"color: #0033cc;\">For<\/span> t1 <span style=\"color: #9933ff;\">=<\/span> <span style=\"color: #008080;\">0<\/span> <span style=\"color: #0033cc;\">To<\/span> <span style=\"color: #006600;\">UBound<\/span>(nvaluelist)<br \/>\nstr <span style=\"color: #9933ff;\">=<\/span> str <span style=\"color: #9933ff;\">+<\/span> nvaluelist(t1)<span style=\"color: #9933ff;\">.<\/span>Name <span style=\"color: #9933ff;\">+<\/span> <span style=\"color: #7c0000;\">&#8220;<\/span> <span style=\"color: #7c0000;\">&#8211;<\/span><span style=\"color: #7c0000;\">&#8220;<\/span> <span style=\"color: #9933ff;\">+<\/span> nvaluelist(t1)<span style=\"color: #9933ff;\">.<\/span>Value <span style=\"color: #9933ff;\">+<\/span> <span style=\"color: #006600;\">Chr<\/span>$(<span style=\"color: #008080;\">10<\/span>) <span style=\"color: #9933ff;\">+<\/span> <span style=\"color: #006600;\">Chr<\/span>$(<span style=\"color: #008080;\">13<\/span>)<br \/>\n<span style=\"color: #0033cc;\">Next<\/span><br \/>\n<span style=\"color: #006600;\">MsgBox<\/span> str<br \/>\n<span style=\"color: #0033cc;\">Next<\/span><br \/>\n<span style=\"color: #0033cc;\">End<\/span> <span style=\"color: #0033cc;\">If<\/span><\/p>\n<p>&#8220;entrylistresult&#8221;, of type &#8220;getentrylistresult&#8221;, contains various data. What we use here is the usual &#8220;error&#8221; object and &#8220;entrylist&#8221;,which is an array of &#8220;entryvalue&#8221;, representing the recordset. Each entryvalue is in turn an array of\u00a0 &#8220;namevalue&#8221; objects, representing the single field as a name\/value pair.<\/p>\n<p>&nbsp;<\/p>\n<div><span style=\"font-size: small;\">\u00a0 <strong>Writing data to SugarCRM<\/strong><br \/>\n<\/span><\/div>\n<p><span style=\"font-size: medium;\"><span style=\"font-size: small;\"><br \/>\nThe last method we&#8217;re going to see is &#8220;set_entry&#8221;. We use it to write a record in SugarCRM. It requires the following parameters:<br \/>\n<\/span><\/span><\/p>\n<ul>\n<li>a valid session id, the one we obtained with the &#8220;login&#8221; operation<\/li>\n<li>the module name, &#8220;Contacts&#8221; in our case (could be any of SugarCRM modules)<\/li>\n<li>a &#8220;namevalue&#8221; array , containing the list of fields of the record as a name\/value pair.<\/li>\n<\/ul>\n<p><span style=\"font-size: medium;\"><span style=\"font-size: small;\"><br \/>\nHere is how we do it:<\/span><\/span><\/p>\n<p><span style=\"color: #0033cc;\">Dim<\/span> sentryresult <span style=\"color: #0033cc;\">As<\/span> setentryresult<\/p>\n<p><span style=\"color: #0033cc;\">Dim<\/span> namevaluelist(<span style=\"color: #008080;\">0<\/span> <span style=\"color: #0033cc;\">To<\/span> <span style=\"color: #008080;\">2<\/span>) <span style=\"color: #0033cc;\">As<\/span> namevalue<br \/>\n<span style=\"color: #0033cc;\">Set<\/span> namevaluelist(<span style=\"color: #008080;\">0<\/span>) <span style=\"color: #9933ff;\">=<\/span> <span style=\"color: #0033cc;\">New<\/span> namevalue<br \/>\nnamevaluelist(<span style=\"color: #008080;\">0<\/span>)<span style=\"color: #9933ff;\">.<\/span>Name <span style=\"color: #9933ff;\">=<\/span> <span style=\"color: #7c0000;\">&#8220;<\/span><span style=\"color: #7c0000;\">first_name<\/span><span style=\"color: #7c0000;\">&#8220;<\/span><br \/>\nnamevaluelist(<span style=\"color: #008080;\">0<\/span>)<span style=\"color: #9933ff;\">.<\/span>Value <span style=\"color: #9933ff;\">=<\/span> <span style=\"color: #7c0000;\">&#8220;<\/span><span style=\"color: #7c0000;\">ppppp<\/span><span style=\"color: #7c0000;\">&#8220;<\/span><br \/>\n<span style=\"color: #0033cc;\">Set<\/span> namevaluelist(<span style=\"color: #008080;\">1<\/span>) <span style=\"color: #9933ff;\">=<\/span> <span style=\"color: #0033cc;\">New<\/span> namevalue<br \/>\nnamevaluelist(<span style=\"color: #008080;\">1<\/span>)<span style=\"color: #9933ff;\">.<\/span>Name <span style=\"color: #9933ff;\">=<\/span> <span style=\"color: #7c0000;\">&#8220;<\/span><span style=\"color: #7c0000;\">last_name<\/span><span style=\"color: #7c0000;\">&#8220;<\/span><br \/>\nnamevaluelist(<span style=\"color: #008080;\">1<\/span>)<span style=\"color: #9933ff;\">.<\/span>Value <span style=\"color: #9933ff;\">=<\/span> <span style=\"color: #7c0000;\">&#8220;<\/span><span style=\"color: #7c0000;\">lllll<\/span><span style=\"color: #7c0000;\">&#8220;<\/span><br \/>\n<span style=\"color: #0033cc;\">Set<\/span> namevaluelist(<span style=\"color: #008080;\">2<\/span>) <span style=\"color: #9933ff;\">=<\/span> <span style=\"color: #0033cc;\">New<\/span> namevalue<br \/>\nnamevaluelist(<span style=\"color: #008080;\">2<\/span>)<span style=\"color: #9933ff;\">.<\/span>Name <span style=\"color: #9933ff;\">=<\/span> <span style=\"color: #7c0000;\">&#8220;<\/span><span style=\"color: #7c0000;\">email1<\/span><span style=\"color: #7c0000;\">&#8220;<\/span><br \/>\nnamevaluelist(<span style=\"color: #008080;\">2<\/span>)<span style=\"color: #9933ff;\">.<\/span>Value <span style=\"color: #9933ff;\">=<\/span> <span style=\"color: #7c0000;\">&#8220;<\/span><span style=\"color: #7c0000;\"> <a href=\"mailto:ppppp@lllll.oo\">ppppp@lllll.oo<\/a><\/span><span style=\"color: #7c0000;\">&#8220;<\/span><\/p>\n<p><span style=\"color: #0033cc;\">Set<\/span> sentryresult <span style=\"color: #9933ff;\">=<\/span> soap<span style=\"color: #9933ff;\">.<\/span>set_entry(loginresult<span style=\"color: #9933ff;\">.<\/span>id, <span style=\"color: #7c0000;\">&#8220;<\/span><span style=\"color: #7c0000;\">Contacts<\/span><span style=\"color: #7c0000;\">&#8220;<\/span>, namevaluelist)<br \/>\n<span style=\"color: #0033cc;\">If<\/span> sentryresult<span style=\"color: #9933ff;\">.<\/span><span style=\"color: #0033cc;\">Error<\/span><span style=\"color: #9933ff;\">.<\/span>Number <span style=\"color: #9933ff;\">&lt;<\/span><span style=\"color: #9933ff;\">&gt;<\/span> <span style=\"color: #008080;\">0<\/span> <span style=\"color: #0033cc;\">Then<\/span><br \/>\n<span style=\"color: #006600;\">MsgBox<\/span> sentryresult<span style=\"color: #9933ff;\">.<\/span><span style=\"color: #0033cc;\">Error<\/span><span style=\"color: #9933ff;\">.<\/span>Description <span style=\"color: #9933ff;\">+<\/span> <span style=\"color: #7c0000;\">&#8220;<\/span> <span style=\"color: #7c0000;\">&#8211;<\/span> <span style=\"color: #7c0000;\">&#8220;<\/span> <span style=\"color: #9933ff;\">+<\/span> sentryresult<span style=\"color: #9933ff;\">.<\/span><span style=\"color: #0033cc;\">Error<\/span><span style=\"color: #9933ff;\">.<\/span>Description<br \/>\n<span style=\"color: #0033cc;\">Else<\/span><br \/>\n<span style=\"color: #006600;\">MsgBox<\/span> sentryresult<span style=\"color: #9933ff;\">.<\/span>id<br \/>\n<span style=\"color: #0033cc;\">End<\/span> <span style=\"color: #0033cc;\">If<\/span><\/p>\n<p>the result of our call is of type &#8220;setentryresult&#8221;, just like we saw in the &#8220;login&#8221; call, and actually it will contain an &#8220;error&#8221; object and the &#8220;id&#8221; of the record.<br \/>\nOne important thing to note is that if one of the &#8220;namevalue&#8221; pair we pass has name &#8220;id&#8221; and the value owns to an existing record, we will be doing an update,otherwise a new record will be created.<br \/>\nThat&#8217;s all for today.<\/p>\n<p>Hasta la proxima.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span class=\"article_seperator\">\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Here we are with another article about SugarCRM integration with various languages\/platforms. This time we&#8217;ll discuss interacting with SugarCRM from VB6. Lots of developers and software houses have decided not to migrate their code from VB6 to VB.NET for various reasons, and I&#8217;m constantly being asked for mentoring and consulting by software houses needing ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"http:\/\/symbioticindia.in\/docu\/2016\/05\/06\/sugarcrm-integration-with-custom-vb6-applications\/\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,2],"tags":[],"class_list":["post-18","post","type-post","status-publish","format-standard","hentry","category-asterisk","category-sugarcrm"],"_links":{"self":[{"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/posts\/18","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/comments?post=18"}],"version-history":[{"count":2,"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/posts\/18\/revisions"}],"predecessor-version":[{"id":20,"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/posts\/18\/revisions\/20"}],"wp:attachment":[{"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/media?parent=18"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/categories?post=18"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/tags?post=18"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}