Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Passing an array to a javascript webresource

(0) ShareShare
ReportReport
Posted on by 3,079

I'm trying to pass an array of field names as a parameter to a javascript web resource.  I followed the suggestion here:

stackoverflow.com/.../dynamics-crm-2011-pass-array-as-parameter

But I get:

"There was an error with this field's customized event."  Followed, usefully, by "Error: undefined"

When I try to do anything with the array (in this test case, just an alert with the length or the first item).

I can't do it as separate parameters, since I want to use this code on many different forms and the number of fields I'm passing in could be quite different fro form to form.  I just want to pass in an array, then iterate through it in my javascript.

Has anyone gotten this to work in 2015 or 2016?  I'm wondering if that code worked for 2011 but changes since have made that method not work anymore?

*This post is locked for comments

  • awalters Profile Picture
    3,079 on at
    RE: Passing an array to a javascript webresource

    Working perfectly.  Thanks again for the very clear write-up!

  • awalters Profile Picture
    3,079 on at
    RE: Passing an array to a javascript webresource

    That looks awesome...thank you!  I'll give it a shot after the weekend and report back.  :-)

  • awalters Profile Picture
    3,079 on at
    RE: Passing an array to a javascript webresource

    The link is broken, but from the screenshot that seems to be for passing parameters to the overall form, not to javascript.  Unless I'm misunderstanding something?  The screen I'm looking at (and using successfully for a single parameter to my script) is this:

    2766.screenshot.jpg

  • Saroj Das Profile Picture
    3,355 on at
    RE: Passing an array to a javascript webresource

    For sending Parameters to Web resource, please see this.

    msdn.microsoft.com/.../gg327945.aspx;MSPPError=-2147217396

     

    If you want to send value to form you can do like the below?

    3618.form.JPG

    msdn.microsoft.com/.../gg334436.aspx;MSPPError=-2147217396

    Thanks,

    Saroj

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
dkrishna Profile Picture

dkrishna 6

Featured topics

Product updates

Dynamics 365 release plans