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
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.
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.
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?
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.
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.
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?
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.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156