locked
ASP Classic Webpage with Microsoft CRM 2011 RRS feed

  • Question

  • Hello there,

    I am attempting to make a webpage that would allow an external user to add their own personal details to the CRM and then return the completed record.

    As I have access to the database it would be simple enough for me to create a record set and insert the data manually, but I have been advised against using this method.

    Could anyone advise the correct way about doing this? It's also important to note that I am not using Visual Studio at all for this.

    Thanks

    Wednesday, September 3, 2014 8:33 AM

All replies

  • You'd be correct in thinking that this is not advisable. You can cause real damage to your system if you get something wrong.

    However, I do have quite a few classic ASP pages that access the database directly. Mostly they just read data but a couple do write as well.

    Wednesday, September 3, 2014 8:38 AM
  • hi thanks for your reply, are you aware of any other method doing this though? What would you recommend going forward?
    Wednesday, September 3, 2014 8:42 AM
  • Just re-reading your post, in your classic ASP page, you will be able to use a SELECT or an UPDATE but not an INSERT or DELETE - these require operations across multiple tables and should only be done with CRM-based methods such as through the browser or web services.

    Essentially, within SQL Management Studio, you'll need to create a log on for this on the database server (Security -> Logins -> New login). You can then write your ASP page with the connection string to connect up to the SQL server with this user account (obviously, make sure this account has the permissions required to do what's needed and, for safety, not much else).

    When it comes to writing your SQL query, I usually do this in SQL Management Studio where I do everything I can to make sure my statement is sound. I then put this into my ASP page and test making sure that the ASP page is on the CRM front end server - I usually create a folder within the CRMWeb folder on the server where I store all of my ASP.

    Wednesday, September 3, 2014 8:54 AM

  • but I have been advised against using this method.

    The advice is right, manual modifications to the SQL database of a CRM instance is not supported.

    However it is supported to READ the data using the Filtered Views (so if you want to read from Account entity you can do for example a SELECT * FROM FilteredAccount)

    For other operations (create,update,delete) you need to use the CRM Web Services. Personally I never see an ASP classic implementation that consume the Dynamics CRM webservices, although is theoretically possible, I suggest to create a proxy web service to interact between you ASP classic and Dynamics CRM. You are also limited to consume this proxy webservices, as ASP classic is not so user-friendly (probably is more convenient to expose the proxy webservice as SOAP), you can also consume the proxy webservice client side using jQuery.


    My blog: www.crmanswers.net - Rockstar 365 Profile

    • Proposed as answer by Guido PreiteMVP Wednesday, September 3, 2014 8:57 AM
    Wednesday, September 3, 2014 8:57 AM
  • Hi there, thanks for your reply - what would you recommend is the best way to produce client services then - as an example allowing an external user the capability of updating their own personal records? Web services with ASP.net?
    Wednesday, September 3, 2014 9:12 AM
  • Hi there, thanks for your reply - what would you recommend is the best way to produce client services then - as an example allowing an external user the capability of updating their own personal records? Web services with ASP.net?

    If you can switch to ASP.net and .NET framework 4.0 you can use the CRM SDK dlls and interact directly with Dynamics CRM from your website.

    @Jon_Evans, if you update a CRM record with SQL, maybe you will not get errors, but for example workflows will not be triggered, this is just one of many issues.


    My blog: www.crmanswers.net - Rockstar 365 Profile

    Wednesday, September 3, 2014 10:01 AM
  • Thanks very much - I appreciate the help :)
    Wednesday, September 3, 2014 10:10 AM