Data Sources are collections of data that you can display in Grid Forms. Following the rules you set on the Data Source, XPOR will collate matching records and present them to the Grid Form as a collection of data.
Data Sources are created and managed in Object Modeller, so you must have the Modeller software installed on your pc, connected to your XPOR.
There are several different types of Data Source, each of which works with XPOR in a different manner. This Help resource focusses on the Object By Type Data Source.
This is perhaps the simplest data source type to understand. When selected the Data Source will simply collate all objects of that type. So, if you have an object type "Car" in your XPOR model, and you want to simply list out all Car objects, no matter where they are in your system, this data source will do this.
You can then apply a "search query" or "order by" to further refine your data source.
It is also worth researching "Inheritance" when considering this data source type. Object Types, such as "Contact" inherit other Object Types - "Contact" inherits "Mailing List Contact". If you configure your Data Source to focus on Mailing List Contact, it will return all Mailing List Contacts AND all Contacts. On the other hand if you focus your Data Source on Contact, it will not return Mailing List Contacts.
The attached video demonstrates how to set up a Data Source - Objects by Type.
Log into Object Modeller and connect to your XPOR. In the top tab menu click on "Data";
Click on the Manage Data Sources tool, to open the complete list of all data sources already in your XPOR. Note, the system uses a lot of Data sources, that you can't edit / damage (so don't worry) - but you can open them to have a look at their settings. The system Data Sources are displayed as Lime Green colour icons.
To create your own Data Source, click the Add Data Source button. This will open a blank Data Source form for you to configure;
Give your data source a relevant name - note, you can change the name of the Data source after its creation, if you so require.
Give you data source a Description. This is particularly useful to recall what your data source is doing in your system. Data sources can be used on many different grids, so it is worth recording the purpose of your data source. Note, you can change the Description of the Data source after its creation, if you so require.
The Guid is an automatically generated unique identifier. It will self populate when you Apply / Save the new Data Source
Select a Category to hold your Data Source against. This is for housekeeping purposes, You are likely to end up with a lot of Data Sources, so best keep them ordered!
Click the dropdown to view the available data source types (each covered by its own Help Resource). When you select a Data Source Type the remainder of the data source configuration form will adjust accordingly.
In this Help resource we are looking at the Object By Type Data Source, which will auto-configure as below;
Your Data Source is going to be focused on a specific object type. This drop down list will present ALL of the object types in your system - that are currently BUILT.
Click / select one for your new Data Source and it will now return ALL objects of that Object Type, when you connect to a Grid Form.
It will also automatically complete the Key Field and Display Field entries. In the Screenshot below we have selected the core Object Type "Contact" as our object Type. Object Modeller has automatically selected the Key Field to be Contact#ObjectId and the Display Field to be Contact#ObjectName.
The Key Field is the principal piece of data that is held against the Data Source. For example, if the above Data source is used to list out contacts on a front end grid form - and you enable the grid with "Delete" - the function will recognise which row have been clicked by the key field set on the data source. In the example above, with the key field set to Contact#ObjectId, the delete function would delete the selected "Contact#ObjectID".
The "Display Field" is the default field that will be displayed to the User if they use the Delete function described above. By default it is set to ObjectName - but you can change this to, say, contact#KnownAs - which will then display this data when you you use the Delete function.
Having collated all of the Objects of the selected Object Type using your Data Source, you can now Order them, by ANY of the Object Type properties, in any combination.
Clicking the three period Icon will open the Order By Designer;
Clicking the + Add button start the process of creating an "order by" - click the purple box, to configure it.
Click the Left Hand Drop down, to present ALL of this Object Types properties and select the property that you want to order by,
Then click the Right hand Drop down to select the order - Ascending / Descending.
The Search Query configuration of a Data Source will filter the data source collated data, to return only the filtered results. For example, in the example above, where we set the data source to return all Contacts, we can then filter the results by any combination of properties of the Contact object type. We may perhaps, want to list out all Female Contacts, whose accounts are Enabled.
Clicking the three periods icon will open the Search Query Designer.
Clicking the Add button will offer three options
You can continue to add items to build your Search Query;
If an Object Type is set to "Is Versionable", the Data Source will, by default, only display the current version of any objects that match its' criteria. If you want to return all versions of those objects, tick this option.
Having Apply / Saved your configured Data Source, you will see it listed in the Data Source Manager, from where you can double click, to open / edit it OR you can right click it and access the Context Menu for Data Sources.
The Delete option will delete the Data Source, with a warning. The View Dependencies option will display the locations that this Data Source is being used - if any! Take good care when deleting Data Sources. It is often the case that a Data Source that has been built (as for the example above) will be used on other forms, perhaps created by different people! The deleted Data Source will no longer be available for any forms using it.