Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

CRM 365 web resource and javascript issue.

Posted on by

Hello All Experts,

This could be not the correct plateform but it's related with CRM and Javascript.

i want to dynamically generate the below structure using javascript.

var dataSet = [

    "Tiger Nixon""System Architect""Edinburgh""5421""2011/04/25""$320,800" ],
    "Garrett Winters""Accountant""Tokyo""8422""2011/07/25""$170,750" ],
    "Ashton Cox""Junior Technical Author""San Francisco""1562""2009/01/12""$86,000" ]
                         ];
do anyone assist me in creating the same .

*This post is locked for comments

  • Suggested answer
    Shaminderpal Singh Profile Picture
    Shaminderpal Singh 1,565 on at
    RE: CRM 365 web resource and javascript issue.

    function datasetgeneration(){

    var masterset = [];

    for (var i = 0; i < 3; i++) {

       var rowData = [];

       for (j = 0; j < 3; j++) {

           rowData.push('Random' + j);

       }

       masterset.push(rowData);

    }

    console.log(masterset);

    }

    I have created a sample for you.Replace the random value and loop max value with your requirement.

    Here is the screenshot of result when you execute it

    37614.Capture.PNG

    -Shaminder

  • Suggested answer
    ashlega Profile Picture
    ashlega 34,475 on at
    RE: CRM 365 web resource and javascript issue.

    Hi,

     you need to use JSON.stringify:

    developer.mozilla.org/.../stringify

     var lines = [];

     lines[0] = [];

     lines[0][0] = "Tiger Nixon";

     lines[0][1] = "System Architect";

     lines[0][2] = "Edinburgh";

     lines[0][3] =  "5421";

     lines[0][4] =  "2011/04/25";

     lines[0][5] =  "$320,800";

     Do the same for other lines.

     Then

     var s = JSON.stringify(lines);

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans