Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CRM 2011 - Reference Javascript Web Resource from another Javascript Web Resource

Posted on 2012-04-06
4
Medium Priority
?
1,803 Views
Last Modified: 2012-04-06
I have download a XrmServiceToolkit.js and create a Web resource called XrmServices.
I would like to call the function of XrmService within another JavaScript Web Resource?
Can it be done? Or any reference you can suggest for a step by step how to do this.  Thanks.
0
Comment
Question by:tommym121
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 27

Assisted Solution

by:Chinmay Patel
Chinmay Patel earned 2000 total points
ID: 37817582
Hi tommym121,

It can be easily done.

First, refer to this article : http://blogs.msdn.com/b/lezamax/archive/2010/10/21/crm-2011-web-resources-simulating-directories-and-the-importance-of-relative-paths.aspx

Basically all you need to do is refer to XrmServiceToolkit's features in your scripts and html files and make sure that on the form where you call your web resource, xrmservicetoolkit.js is also available.

Just make sure that you use $webresource directive so that you can always track component dependencies.

Regards,
Chinmay.
0
 

Author Comment

by:tommym121
ID: 37817816
Chinmay,

I am not 100% sure what I need to do.  I have created the web resource for XrmServiceSdk.
It has a function to retrieve the field value by calling XrmServiceSdk,GetFieldValue('LogicalName')
What I am trying to create another function (not in XrmServiceSdk Web Resource but rather another Web resource) that will combine the values from FirstName and LastName.  Something like below
Function combineFieldsValue (val1, val2)
{
       combineFieldsValue = val1 + ' ' + val2;
}
This function will be call in the OnChange event of a field in the form.

Can I do that?  Or I really have to add a function into the XrmServiceSdk since Javascript do not allow #include type.

Hope you can clear up my confusion.  Thanks.
0
 
LVL 27

Accepted Solution

by:
Chinmay Patel earned 2000 total points
ID: 37817850
Hi tommym121,


Sure. Basically, you call this function as if it is already available to you.
Just on the form where you add your script libraries, make sure to add XrmServiceSDK's js also.

Regards,
Chinmay.
0
 

Author Closing Comment

by:tommym121
ID: 37818058
Thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

On Sep 22nd 2014 Microsoft released Update Rollup 1 for Microsoft Dynamics CRM 2013 Service Pack 1 and back in July Update Rollup 3 was released.  So we now have:   Update Rollup 1Update Rollup 2Update Rollup 3Service Pack 1Update Rollup 1 for S…
Desired Skill Set for Microsoft Dynamics CRM Technical Resources – Part II
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question