How to get programmatically(via plugin) CRMWRPCToken & CRMWRPCTokenTimeStamp in CRM 2011?

浪尽此生 提交于 2019-12-10 11:32:16

问题


guys!:) I work with CRM 2011 & I need to automatically generate download link for attachments in entities records with C# plugin via attachment GUID.

This link looks like this:

/SERVER/ORGANIZATION_NAME/Activities/Attachment/download.aspx?AttachmentType=5& AttachmentId={GUID}&IsNotesTabAttachment=1&CRMWRPCToken=8oi054LNEeOd7QAVXZNIANwO8jNsflfFQ75fqPK2zC4Az6I2yWatX71ugBe7bgHy&CRMWRPCTokenTimeStamp=635273624756233624

But I haven't got any idea, how to get these CRMWRPCToken&CRMWRPCTokenTimeStamp. Could anybody help me? Thanks.


回答1:


You cannot generate the CRMWRPCToken & CRMWRPCTokenTimeStamp values. You shouldn't need to as these will be handled by CRM itself when the URL is called. The user making the call will need to authenticate to CRM - if they are to be anonymous users you'll need to put a proxy site between the caller and CRM that can support anonymous users - CRM can't support anonymous users directly.

The best, and most easily supported way to do this, is to direct the user to an HTML WebResource with the annotation's guid in the URL. Then in the WebResource take the URL and call Xrm.Utility.openEntityForm("annotation", annotationid) to open a dialog to download the file. Assuming the user is authenticated to CRM this will work great and you never need to worry about it breaking.



来源:https://stackoverflow.com/questions/21624351/how-to-get-programmaticallyvia-plugin-crmwrpctoken-crmwrpctokentimestamp-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!