locked
custom record creation using asp.net application RRS feed

  • Question

  • Hi friends,

     

    while creating new  Face To Face record and associated note (Annotation) by using asp.net(custom) application which is deployed using ISV.config.

     

    and the CRM server is in IFD mode.

     

     In both records  CreatedBy and ModifiedBy values are SYSTEM , not actual current logged in user.

     

    in on premise deployment I can see both CreatedBy and ModifiedBy values are correct logged in user not SYSTEM.

     

    how can I can see exact loggedin user or created user?

     

     

     

    Thanks inadvance.

     

     

     

    Wednesday, July 6, 2011 2:41 PM

Answers

  • Hi

    A couple of things you need to look out for.

    - you need use pass through autherntication for passing the user id and credentials to MSCRM. In this case, the userid will be correct, but the flip side is if the user doesn't have the required role to create the records, you will get authentication issues.

    - the otehr way is to run your custom application under the system user (which is static and has sys admin role in MS CRM) and this is probably what you are doing. Using this bypasses the user's security and all hassles of pass through autherntication, but since you app is running under the system users, the created by, modified by and audit trail will show the system user. To overcome this, pass the user id along with the record guid to the custom app, and on post create of the record, update the owner field. Audit trail will still show record created by System user, but at least the owner will be correct

    - the Preferred way is to use the first method of pass through authentication and setup the user access properly - alos helps iwth unthorised udates in the system

    Thanks and Regards

    AniMandal

    http://xrmadventures.wordpress.com/

    • Proposed as answer by AniMandal Wednesday, July 6, 2011 7:22 PM
    • Marked as answer by B sreenivasulu Monday, July 18, 2011 11:59 AM
    Wednesday, July 6, 2011 7:22 PM
  • Hi,

    You need to impersonate as other user, for further information you may refer to the following post: http://msdn.microsoft.com/en-us/library/gg334744.aspx


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".

    Friday, July 8, 2011 1:21 PM

All replies

  • Hi

    A couple of things you need to look out for.

    - you need use pass through autherntication for passing the user id and credentials to MSCRM. In this case, the userid will be correct, but the flip side is if the user doesn't have the required role to create the records, you will get authentication issues.

    - the otehr way is to run your custom application under the system user (which is static and has sys admin role in MS CRM) and this is probably what you are doing. Using this bypasses the user's security and all hassles of pass through autherntication, but since you app is running under the system users, the created by, modified by and audit trail will show the system user. To overcome this, pass the user id along with the record guid to the custom app, and on post create of the record, update the owner field. Audit trail will still show record created by System user, but at least the owner will be correct

    - the Preferred way is to use the first method of pass through authentication and setup the user access properly - alos helps iwth unthorised udates in the system

    Thanks and Regards

    AniMandal

    http://xrmadventures.wordpress.com/

    • Proposed as answer by AniMandal Wednesday, July 6, 2011 7:22 PM
    • Marked as answer by B sreenivasulu Monday, July 18, 2011 11:59 AM
    Wednesday, July 6, 2011 7:22 PM
  • Hi AniMandal, 

    can you please suggest me on this  "pass through autherntication for passing the user id and credentials to MSCRM" , how can i achieve?


    Thursday, July 7, 2011 1:14 AM
  • Hi

    first you need to figure out what type of custom application you are using. there can be two types

    - custom website, if you need to display custom aspx pages, data mashups between MS CRM and otehr data sources

    - Dot Net Application - can be console apps, job schedulers, DB scripts, etc, which you are interfacing with CRM using the API, or calling through plugins

     

    If you are using custom website - search for and read up on IIS pass through authertication, and setup and test your website for this

    If you are using Dot Net and Plugins, ensure that you are running your Plugin under the logged in user (this is done in plugin registration). If you are using Dot net app, check the user under whom you are running the app. Obtain the logged in user id from the calling process in MS CRM (most probably this would be a plugin or a JS) and then run the app under this userid. If this is not possible, if you are runnign a server app, and are unable to pass on the user credentials, then update the userid on post create of the CRM record.

    Thanks and Regards

    AniMandal

    http://xrmadventures.wordpress.com/

    Thursday, July 7, 2011 4:03 PM
  • Hi,

    You need to impersonate as other user, for further information you may refer to the following post: http://msdn.microsoft.com/en-us/library/gg334744.aspx


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".

    Friday, July 8, 2011 1:21 PM