07.09.2011, 17:11 | #1 |
Участник
|
Gareth Tucker: Utilising some of Microsoft CRM 2011’s Hidden Functions
Источник: http://gtcrm.wordpress.com/2011/09/0...den-functions/
============== I stumbled across this today. Not sure if this is common knowledge. It is likely not supported. It is however interesting. Today I wanted to save an Activity record as completed and close the form all via java script. i.e. I wanted to be able to do the same thing that clicking this button does: I wondered whether the CRM ribbon definition would reveal what this button does. Sure enough it does. Looking in… \sdk\samplecode\cs\client\ribbon\exportribbonxml\exportedribbonxml\phonecallribbon.xml … I found that the “Mark Complete” button calls a command called: "Mscrm.SavePrimaryActivityAsComplete" As you can see below: This Command is a Ribbon Command and a quick ctrl-F in that same file quickly located the definition of the Command: As you can see the button calls a Function called “SaveAsCompleted” which resides in a java script library called activity.js. I wondered whether I could call this function from my java script. Sure enough I can: Works exactly as I hoped. Does this mean I have java script access to lots of additional functionality? I hope so! p.s. Another approach that might work here and may be a little more supported is to programmatically click the Ribbon button. I haven’t tried that. p.p.s If you are curious as to what the code behind this function is you can locate it on your CRM server under: \CRMWeb\_static\Activities Here it is: function SaveAsCompleted(){if(!crmForm.IsValid())return;crmForm.SubmitCrmForm(58,true,true,false)} Regards, Gareth Источник: http://gtcrm.wordpress.com/2011/09/0...den-functions/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|