Open anasraf opened 6 years ago
Could you post the link that is being opened compared to the link that you expect to be opened? Thanks!
Hey Guys! I tried this solution and i get the same problem. Analysis : Link by the standard button : https://org.crm4.dynamics.com/crmreports/viewer/viewer.aspx?action=run&context=records&helpID=Bon%20de%20commande%20parent.rdl&id=%7baad4ac08-4c7b-e711-80fe-5065f38b4641%7d&records=%7bEA75A694-7A20-E811-8115-5065F38BE571%7d&recordstype=10059 Link opened by ur smart button : https://org.crm4.dynamics.com/crmreports/viewer/viewer.aspx?action=run&id=%7baad4ac08-4c7b-e711-80fe-5065f38b4641%7d&records=%7b{EA75A694-7A20-E811-8115-5065F38BE571}%7d&recordstype=10059
After some testing : When i execute the smart button i have a report on an other record (but not random, it seem to be the same everytime). Using the link opened by smart button, we just have to add "&context=records" and remove the "{" in the Guid's value "records=" . We dont really need to specify the "helpID=", it works without.
Solution : btw u have to apply some changes on lines 2096 in SmartButtons.ClientHooks.js : '/crmreports/viewer/viewer.aspx?action=run&id=%7b'+encodeURIComponent($1_2)+'%7d&records=%7b'+recordId+'%7d&recordstype='+etc;
Hope that will help you and many thanks about your works ! Best Regards,
Note : You can use this function for replace the "{" in the recordId's var function formatId(entityId) { if (entityId != null) { return entityId.replace("{", "").replace("}", ""); } return null; }
Hello Allan, I am receiving the same issue. I tried to amend the SmartButtons.ClientHooks.js file as mentioned in your comment but without any luck. Could you please send me your SmartButtons.ClientHooks.js file. Thank you.
What we have to do is replace the Ribbon Javascript.
Create a new solution and add the JS named "dev1_/js/SmartButtons.ClientHooks.js". Then change the report URL in line 2096:
OLD LINE: '/crmreports/viewer/viewer.aspx?action=run&id=%7b'+encodeURIComponent($1_2)+'%7d&records=%7b'+recordId+'%7d&recordstype='+etc;
NEW LINE: '/crmreports/viewer/viewer.aspx?action=run&context=records&id='+encodeURIComponent($1_2)+'&records='+recordId+'&recordstype='+etc+'&helpID='+reportName;
That solved my problem!
Your solution solved my problem...Many Thanks!
Hi there,
I used your solution in running workflows and quick javascript it works fine. but when i try to run a report from a smart button it doesn't run on the current record it just executing on a random record i checked the passed parameters and it looks everything is fine. Thank you in advance for your time.