web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Adding new record to subgrid using javascript

(0) ShareShare
ReportReport
Posted on by

Hi,

I would like to add new record to Subgrid using javascript. I debug subgrid and see that has add function like this:

6278.Untitled.png

But I don't know constructor of parameter "item". Please help me to use it to add new record to subgrid. (maybe example).

Thanks

Nguyen

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Emre GULCAN Profile Picture
    2,379 on at

    Hi,

    If I understand correctly your problem, subgrids display/contain related records. So you should create relation (parent-child) with your existing records (or create a new one) and then refresh subgrid.

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at
  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    Hi,

    You can create record for subgrid entity and set parent lookup, you can write request using editor: community.dynamics.com/.../crm-rest-builder-2-4-0-0

    you can also look our sample code himbap.com/blog

  • Community Member Profile Picture
    on at

    In Entity A, I have subgrid with data ( I got them ) and now I want to get all data from subgrid of Entity A and put them to subgrid of Entity B. All subgrids are the same view. Sorry for my English.

  • Suggested answer
    Rajkumar Rajaraman Profile Picture
    on at

    You can use Webapi. Refer this:

    crmjavascripts.blogspot.in/.../create-record-in-crm-2016-using-web-api.html

  • Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi ,

    do you know how to write custom workflow? this can easily achieve via custom workflow compare to JS.

  • Suggested answer
    Preeti Sharma Profile Picture
    2,678 on at

    Hi,

    You can fetch all records from subgrid on Entity A(by retrieving related data using sdk.rest or webapi) and then create duplicate data but with lookup of Entity B this time.

    Hope this helps:)

  • Community Member Profile Picture
    on at

    Could you show me example about it.  Thanks

  • Verified answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    Not sure which version of CRM you are on, but if you download CRM Rest Builder you can generate code with it create a new record.

    github.com/.../CRMRESTBuilder

    Hope this helps.

  • Verified answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    Take a look on below post or video. You can learn it from there.

    Custom workflow or Plugin

    1. Construct your retrieve query

    [View:https://msdn.microsoft.com/en-us/library/gg328117.aspx:750:50]

    2. How to create a plugin

    - [View:https://msdn.microsoft.com/en-us/library/gg594416.aspx:750:50]

    3. How to create a custom workflow

    -

    JavaScript

    1. Retrieve data through webapi ( JS)

    - [View:https://arvindcsit.blog/2018/01/10/retrieve-data-using-web-api-and-fetchxml/:750:50]

    2. Create record through webapi ( JS)

    -[View:http://crmjavascripts.blogspot.com/2016/03/create-record-in-crm-2016-using-web-api.html:750:50]

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans