Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I created a custom button in the ribbon menua bar in CRM 2011 and now I want to call a webresource js. This is what I have now:

<Actions>
    <JavaScriptFunction FunctionName="functionName"
       Library="$webresource:opportunity_ribbon.js" />
</Actions>

But when I click the button, no response at all. Any idea what's wrong?

Update: The problem seems to be the js I'm calling. The line

locAddActTo(4207);

fails and its says the value of locAddActTo is null. Any ideas about how to fix this?

share|improve this question
The XML looks good to me. I would only double check the function name and the name of the library, then debug the code with IE F12 developer tools to see if the code gets executed at all. – Peter Majeed Jul 25 '12 at 15:42
Thanks for your reply. When I debug using F12, I found the js function is indeed called, but there is a null reference. My js only has one line: locAddActTo(4207);. I'm not very familiar with locAddAct. How does it work and what is 4207? – user1486691 Jul 25 '12 at 15:54
4207 may be the ObjectTypeCode for the Letter entity. Is there a specific reason you're using locAddActTo(4207) in your code? And at this point, it might make more sense to detail what you want your code to accomplish. – Peter Majeed Jul 25 '12 at 16:57
I'm actually debugging other people's code. I guess they just want to open up a new letter..? Whatever they want to accomplish, I don't understand why locAddActTo is null. From the examples I saw on various websites, I failed to see why this line dies. – user1486691 Jul 25 '12 at 17:04
According to this website: adaptds.com/issuetrackingblog/2009/02/27/… the locAddActTo cases.js. I would work on trying to figure out why that file isn't getting loaded – Daryl Jul 25 '12 at 17:25

1 Answer

up vote 0 down vote accepted

It works after I changed locAddActTo to locAddRelatedTo, but I don't know why is it. Anyone?

share|improve this answer
We'd need to see the contents of that web resource to answer that – glosrob Jul 26 '12 at 13:16
The webresource only has this one line: function xx() {locAddRelated(4207);} This is called by <JavaScriptFunction> under <RibbonDiffXml> in isv.config of the form – user1486691 Jul 26 '12 at 17:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.