Updating a react control built from multiple sources - reactjs

I would like to build an editable table that contains columns that are from multiple subtrees of the graphql data returned by relay.
I have a control that creates an intermediate object for each of the rows from the relay data and stores the list in state.
The problem I have is that when the data which I built the intermediate object from changes then the editable table needs to know about it.
Is this correct ? Is there some other way to do this ?
The controls that own the data the table is built from are not related, would the only way to do this then be the global event system solution mentioned in the docs ?
Thanks

Related

Qlik Sense - create a list or graph that will load a table (QVD Object) when clicking the item

I'm very new into Qlik sense and I want to know if this is possible. So I did a data connection load to load a data into QVD objects (for example 60 tables of districts). When editing a sheet, is it possible to create a list that displays all districts and, when i click on a district, it will load that District table (object) which will expand more graphs that associate to that table? I hope this make sense. Please let me know if i should revise it.
If I understand correctly. You want to load new data when some condition is met (in your case when on district value is selected) right?
If this is the case then I think that you can use Dynamic Views.
Dynamic Views allow you to load specific objects from a template app. So the workflow will be:
prepare template app with all the objects that can be used in another apps. Including the script with placeholders where the selections will be passed
in your main app - include these objects and set a threshold (in your case will be something like count(distinct District) = 1
make selection in the District filed
if the threshold is reached Qlik will pass the selections to the template app, it will reload it and the objects will be populated (how fast the objects will be populated depends on the script reload time of the template app)
Documentation
Video demonstration
P.S.0 Just to mention that Dynamic Views are "subset" of On-Demand App Generation (ODAG). The difference here is that ODAG will produce a new temporary app (again based on the template app) that the user can interact with and dispose whenever is needed (or Qlik will delete if after some specified time)
P.S.1 If your data is not too big and you can allow yourself to load all the data for all Districts then you can use calculation condition for the charts that require only one District to be selected

Accessing CustomFieldDefinition metadata via tooling api

So, I've been attempting to gather picklist dependencies per Opportunity record type for my lightning components. I have been able to retrieve Standard Field dependencies by RecordType, but it the Tooling API will not return the custom field dependencies. Standard calls and queries will not work either, as they state that the field has no controlling value or dependency.
Given this information I suspected that there was a table that is hidden somewhere that contains the keys for the RecordType and FieldDefinition, hopefully with a nested Metadata object.
I found an Id in one of the parameters in the setup menu for a Record Type and Id.getSObjectType() on it. The table name is CustomFieldDefinition. However, it is not accessible via SOQL or the Tooling API.
Has anyone accessed this table? Or has anyone been able to retrieve the field-record type picklist dependencies on custom fields AND standard fields?Tooling API ResponseDebug Log with SObject Name
I think you're doing it wrong.
"Controlling field" would be another picklist or a checkbox for example, something you change during same edit action. If you have dependency to record type - in that sense it's not a controlling field. Sure, you change record type and picklist changes - but really everything would change, it should be a different page layout (different fields shown, marked readonly/required etc). There's a reason that record type change is not done on normal edit screen, you do it by clicking special link on detail view and then everything "explodes".
Have a look at "User Interface API" - set of tools meant to help your custom app (mobile? desktop?) steal recreate a normal page layout. This one might be especially useful: https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_picklist_values_collection.htm
There's even a Trailhead: https://trailhead.salesforce.com/en/content/learn/modules/user-interface-api (skim through whole set but especially read last module)
And since you mentioned Lightning Components - are you aware of these ready tools:
https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.reference_ui_api
getPicklistValuesByRecordType
https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.reference_generate_record_input_create
or maybe you don't have to code it all and stuff like <lightning-record-edit-form> with recordtypeid passed to it will solve all your problems
Have a look, if I didn't give you a working solution then at least you have some keywords to Google around. If you're still stuck - try to post a code sample as new question?

in Entity Framework, DbSet.Local remains out of sync

This one is making me crasy : I have an EF model built upon a database that contains a table named Category with 6 rows in it.
I want to display this in a drop down list in WPF, so I need to bind it to the Categories.Local Observable collection.
The problem is that this observable collection never receives the content of the database table. My understanding is that the collection should get in sync with the database when performing a query or saving data with SaveChanges() So I ran the followin 2 tests :
Categories = _db.Categories.Local;
// test 1
Debug.WriteLine(_db.Categories.Count());
Debug.WriteLine(_db.Categories.Local.Count());
// test 2
_categories.Add(new Category() { CategoryName = "test" });
_db.SaveChanges();
Debug.WriteLine(_db.Categories.Count());
Debug.WriteLine(_db.Categories.Local.Count());
Debug.WriteLine(_categories.Count());
The test 1 shows 6 rows in the database, and 0 in local.
The test 2 shows 7 rows in the database, and 1 in local (both versions)
I also atempted to use _db.Category.Load() but as expected, it doesn't work because it is db first, not code first.
I also went through this page https://msdn.microsoft.com/en-us/library/jj574514(v=vs.113).aspx, created an object-based data source and linked my combo box to it, without success.
Does anyone know what I am doing wrong?
Thank you in advance for your help.
The DbSet<T> class is IQueryable<T>, hence DbSet<T>.Count() method maps to Queryable.Count<T> extension method, which in turn is translated to SQL query and returns the count of the records in the database table without loading anything into db context local cache.
While DbSet<T>.Local simply gives you access to the local cache. It contains the entities that you added as well as the ones being loaded by query that returns T instances (or other entities referencing T via navigation property). In order to fully load (populate) the local cache, you need to call Load:
_db.Categories.Load();
The Load is a custom extension method defined in QueryableExtensions class, so you need to include
using System.Data.Entity;
in order to get access to it (as well as to typed Include, XyzAsync and many other EF extension methods). The Load method is equivalent of ToList but without overhead of creating additional list.
Once you do that, the binding will work. Please note that the Local will not reflect changes made to the database through different DbContext instances or different applications/users.

Custom object search in Salesforce Lightning

To create child record, I use e.force:createRecord but when I type the name of parent record into look-up field, it shows nothing even whole name or some letter.
I want to have the functionality as standard object like contact:
Do I need to config somewhere?
I believe Lightning shows only recently accessed records.
To have more flexibility you might need to create a completely custom component which would include custom lookup.
For my case I used custom components with custom lookup with similar approaches to this post or this one

Extjs - How to get displayfields from itemselector?

The Extjs Itemselector component has methods like getValue, getSubmitData, getSubmitValue which will return the keys of the records that are selected.
I am looking for a better way than taking the keys of the records selected from the component and fetching for the record from the store by searching the store in a sequential fashion. This is a very time expensive solution which is not working well for me since the itemselector has a large number of records.
Question : is there a way to retrieve the displayed string/value (in the selected part of the itemselector) along with the keys directly from the component and not as above ?
thanks
Nohsib
This works in my code to get an array of all the records which you can then get the values from, it may not work in yours if you have a different version of Extjs:
itemSelectorField.toField.store.getRange();
Oh and if you want the display values as a string list:
itemSelectorField.toField.store.getRange().collect("display_value_propery_name").join(",");

Resources