Can the List component be used in an edit form? - input

I want to be able to bring a dataset into an edit/create form because I need the respective resource in order to associate it to the main model.
Say, a store has many employees. I want , from an ui perspective, to be able to add employees to the store.
I am able to to this via a custom component, however I want to know if I am able to use the List component to fetch a certain resource, ,because I have a feeling that I'm not doing this properly now. Adminonrest has the tools to render a paginated list of resources, so how can I make better use of these tools ? Then make a custom iterator to represent the model anyway I want to (maybe even use the datagrid component). I can then attach custom actions.
What would the best pattern for this situation be ? Thanks.

No, this feature is not supported. You can display employees, using the ReferenceManyField but we don't support creating them from the Edit page.

Related

Custom field in a new ticket creation by agent: Dropdown list that its values are live updated

I want to create a custom field in the agent new ticket screen.
I want the field to be shown as a dropdown list where the values in the dropdown list will be values taken from an API of other service.
I know Zendesk custom fields have an option to upload a csv file with options but since I want to the values to be live updated it won't work for me.
I'm wondering whether I need to create a plugin that will do that job or Zendesk have a solution for this need.
I am not sure this is a suitable stackoverflow questions, but if you have control over the backend of the other service, it is better to automate a call from it to Zendesk custom fields API whenever there are changes to the drop down options.
However, this is a bad idea in the first place because drop down options are associated to tags. There might be conflicts with other field options or other tags used by agents. This will be a nightmare for the data analysts who rely on tags for Zendesk Explore reports, especially if you delete an options and its associated tags.

Searching through big DataList from API

I have an app in which I want to show a list of around 19000 products. You can search this list and you can filter it by categories. I added paging for my API where the data comes from and I plan on using LoadMore for React FlatList. Now, when I type a search-query inside the search-bar, I want to search within all the data, not the filtered data. Where should I perform the search then? Should i either load all 19000 Items from the API, store them locally and search it? Then the paging would be kind of unnecessary.. Or should I send the search-term to the API and handle the search there? The latter also seems kind of inperformant, because It would send an API-Request every moment I type a letter to the search-bar. Or is there a third approach? What would be the proper way for this?
Thanks in Advance.

Is it possible to include multiple resources in one component in react-admin?

Sometimes we want to see multilple business objects at once in an admin panel. For instance, I might want to display an customer profile along side with his/her list of accounting records. Or may be I want to keep an eye on both list of new cutomers and list of recent comments.
Is it possible to achieve with react-admin?
Yes. Have a look at the Demo's dashboard.
Get data from various sources with await dataProvider.getList(RESOURCE, PARAMS) and pass that data to various components that can be displayed on one page.

What's the optimal way to filter a set of entities in a lookup?

I've got a lookup field on Account entity called something. Each such Something has a reference to an account. When my users click the magnifying glass, I want them to see a list of available Something records but filtered to view only such instances that link to the currently treated entity.
Also, I'll need to design such a filtration for Contact instances to only show the Something records that are related to the account that the currently regarded contact is a member of.
I can't decide between a plugin on Retrieve and some JS in OnLoad registering a fetchXML. All such operations will be done client-side. The solution needs only to work in CRM13 (and if possible apply some cool functionality in that version).
Suggestions?
JavaScript & FetchXml are your best option here as with a Retrieve plugin you're taking the performance hit of executing on every retrieve regardless of whether the entity is being retrieved for the lookup. A filtered lookup in JS only applies for those scenarios that require a change to the field on Account.
Another other good reason for using a filtered lookup in Js is they are now a supported feature in CRM 2013 as opposed to the "hack" that was required in 2011.
Some more info on addPreSearch and addCustomFilter can be found on MSDN and there's a decent blog post providing examples here.

Content Permissions in Orchard

In an OrchardCms site, I need to create a hierarchical menu where I can show and hide menu items by user role. What is the best way to approach this?
One possible way would be to create and manage two menu's, each pertaining to a different layer where the layer rule species the respective Role. However, this means managing two Menu's which is not ideal. Many items in each menu would need to be duplicated.
Another way would be to create a custom Menu Part. The downside here is it seems like overkill.
Or am I on the wrong track completely, should I be looking more at filtering content items by role instead? In this scenario, I believe I would still need a way to specify menu filters.
I think Advanced Menu (available from the gallery) does menu trimming based on permissions.
Update: my bad. Try Quanta instead (part of the Science project). Should work well with Cartography.
I was able to create multiple menus filtered by role in layers with this simple PCG.RoleLayer module. You will still have to make separate menus though, and it doesn't restrict url access unless you change permissions.
After enabling the module, you can create rules for roles. For example,
role("Administrator")
Would make that layer only visible to those with the administrator role.