One of my customer complained during a UAT session that, it’s too difficult for her to add new record using + button in a sub-grid, as it takes her to a new record window and she has to perform too many navigation. She was happy, when I enabled the quick create forms.
But, I was not happy and I wondered why OOB editable grid is not supporting this. I thought to give it a try using PCF controls, and this is the result.
Initially, it was not easy as we need to query the metadata to get field type for each column in the view. Following are the steps to configure smartgrid.
- Get the solution from here
- Import solution
- Add control to sub-grid
- Give required parameters.
- Primary Lookup: Logical name of the lookup field for the relationship. for example contact sub-grid in the account is “*parentcustomerid_account”.
- Primary Entity Set: Entity set name of the current entity where the sub-grid is added
This is to set the related lookup using Web API, you can use Rest Builder to get these parameter values correctly, for example if contact sub-grid in account form is using parent customer relationship, to set the account lookup in contact following code is used var entity = {}; entity[“parentcustomerid_account@odata.bind“] = “/accounts(xxxxx-xxxx-xxxx)”;
Known bugs.
- Does not support N:N
- Validation for empty rows.
- Does not support composite fields(customer lookup).
- Poor CSS 🙂
Planned enhancements
- Inline editing.
- Validation for mandatory fields
This is not a perfect replacement for Quick create form, but you are always welcome to enhance and add features to Smart Grid Github Repo here.
I tried to import this solution in out Dynamics 365 8.2.13.21 (On-Premise) Version but i failed to do so. Kindly guide me how can i import this solution in our CRM and take benifit of this.
LikeLiked by 1 person
Hi, PCF(Powerapps component framework ) controls are supported in Unitifed interface only. CRM version 9.1 onwards
LikeLike
Hi,
I have imported solution and also added smart grid on form but ‘+’ button is not visible in grid.
Any ideas what I can do?
LikeLike
can you email me a screenshot to nijos@live.com. Please note this basically POC best practices for UI designing is not considered.
LikeLike
Ok. Thanks.
LikeLike
I have imported the solution and implement it in my form. but when I test it, there is an error message shown “An error occurred :(” can you guide me to solve this error. Thanks a lot for making this!
LikeLike
Hi,
Have you given the parameters correctly(static)?
If your grid is on the opportunity form primary dataset should be “opportunities” and primary lookup name can be “opportunity”.
For primary lookup name please select the logical name of the opportunity lookup field in the entity which you are creating, please note it is case sensitive.
LikeLike
Hi, I’m getting an error when trying to create a new entity from the subgrid. From the developer tools I can see that the error is being caused by the POST request and I’m getting a 400 error. Can you help me figure out the issue please? Thank you!
LikeLike
Can you please share the developer tools console to nijos@live.com?
LikeLike
Hi Nijo, I wanted to ask you a question, when I try to add a record from the subgrid, I get a “Bad request” error. I think I’m setting the relationship name wrong. You can help me?
LikeLike
Sure, please mail me the details and screenahotas to nijos@live.com. mention parent and child entity names also
LikeLike
I get that the email does not exist. can you send me another?
LikeLike
Nijos@live.com
LikeLike
I sent you an email, did you receive it?
LikeLike
Can your grid work with Ribbon button?
LikeLike
No, it’s just a PCF dataset only.
LikeLike
Hi, this control is available for “Phone” and “Tablet” also? thks.
LikeLike
It will work but, this was an initial POC to demonstrate the capability of PCFs, there are more advanced control available now
LikeLike
Oh great. the advanced control that you say, is available in your website? can you give me a link?
LikeLike
not on my site, have look on this post: https://www.ameyholden.com/articles/pcf-grids-sub-grids-in-model-driven-apps
LikeLike
Hi,how do you check field,that can be editable?
LikeLike
Hi Nijo, I’m trying to use this for adding Quote Products to a Quote and have set the following parameters but keep getting the “An error occurred :(” message. Are the following paramters correct?
primaryLookupName: quoteid
primaryEntitySet: quotes
Also, can we change the columns that are displayed in the grid?
Thanks!
LikeLike
Hi, can you try QuoteId instead of quoteid.
Columns are displayed based on the view you have selected. To change any column, please update the view in the grid
LikeLike