Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Clicking records from Home Grid

Posted on by 790

Hello,

I have a requirement  where the user needs to choose from Home Grid (not Sub Grid residing in a form) records then upon clicking on a custom button theses records will be inserted in another custom entity.

Any idea how can I accomplish this?

Thanks :)

*This post is locked for comments

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Clicking records from Home Grid

    Hi,

    No, Smart button will not be helpful in your situation because with smart button, the workflow will run on all the selected record. You would need to create you own custom button and configure it in such a way that you get the selected Id's of teh records and then you create a header record and then retrieve all these id's in a loop and create new activity record against your header record.

    With that said, you first need to have an entity to store your header record which shoudl be enabled for activities.

    This is not going to be straight forward so you have to do this in chunks. First create the entity to store header recor then follow above suggestion from Nithya/ Goutam to create the record and retrieve the Id's.

    Once you get the id's then you would need some more code basically WEB API to perform the record copying from the selecetd Id's which would a again a task in itself.

    Hope this helps.

  • Suggested answer
    Dynamics365 Rocker Profile Picture
    Dynamics365 Rocker 7,755 on at
    RE: Clicking records from Home Grid

    You have to create 1:N or N:N relationship between "Fueling" and "header' entity.

    Create a web resource and Call int on button click.

    In web resource, write a script to create header and associate selected "fueling" records with it.

  • zmk Profile Picture
    zmk 790 on at
    RE: Clicking records from Home Grid

    Cant I click all the records I want and then press a smart button which triggers a workflow that has a custom code that creates the header and the lines? If yes, how can I get the ids for the selected records in the Workflow activity?

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Clicking records from Home Grid

    Hi ,

    I would recommend following  -

    - Create an button using Ribbon Workbench , in the action you will get the selected records .

      You can take help from below how to get selected items from home grid .

       ribbonworkbench.uservoice.com/.../129783-pass-the-currently-selected-grid-row-s-to-a-custo

    - On click of button an Javascript function will fire which will get all the selected records and create the headers using WEB API.

    - Write a plugin which will create subgrid line items once header will create.

    Hope this helps.

  • Suggested answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,074 on at
    RE: Clicking records from Home Grid

    Hi,

    You can get the all the selected records in the home grid on click of the custom button and create a single custom entity record with these selected records.

    See: ribbonworkbench.uservoice.com/.../129783-pass-the-currently-selected-grid-row-s-to-a-custo

    Place the custom button in the Home Page grid ribbon instead of Subgrid ribbon.

    Hope this helps.

  • zmk Profile Picture
    zmk 790 on at
    RE: Clicking records from Home Grid

    Thanks Ravi for you reply,

    let me explain my requirement.

    I have a custom activity called "Fueling". The user will click from the Home grid for example 10 "Fueling" activities and once he click the custom button one header will be created that includes in a sub grid these 10 "Fueling activities" . So the button should create 1 header and 10 lines.

    Is this doable using your way?

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Clicking records from Home Grid

    Hi,

    Create a workflow on your the entity which you want to copy. Within that workflow, create a record for the entity which you need to create, use the dynamics properties from the main entity to the sub entity. Once you are done with the workflow, use "Run Workflow" smart button can call your workflow. This is the easiest.

    thatcrmblog.wordpress.com/.../using-workflows-for-cloning-records

    www.develop1.net/.../Adding-Ribbon-Workbench-SmartButtons-to-the-Unified-Client

    Hope this helps.

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans