OptionalAdditionalAdditional Description has any other information that might be useful for someone (or an LLM) intepreting the contents of this data item
OptionalCodeCodeName - property that is generated by the system to be used as a unique name programmatically within a given data context. This is not used in the API, but can be used in the UI or other places where a unique name is needed for the data context item. This is generated by the system and is not set by the user.
OptionalDataThis field can be used at run time to stash the record ID in the database of the Data Context Item, if it was already saved. For items that haven't/won't be saved, this property can be ignored.
This property is set to true if the data has been loaded for this DataContextItem, and false if it has not been loaded or if there was an error loading the data.
OptionalDataThis property contains an error message if there was an error loading the data for this DataContextItem. If there was no error, this property will be null;
OptionalEntityEntity - the object that contains metadata for the entity being used, only populated if the type is 'full_entity' or 'view' - also this is NOT to be sent to/from the API server, it is a placeholder that can be used within a given tier like in the MJAPI server or in the UI.
OptionalEntityEntityID - the ID of the entity in the system, only used if type = 'full_entity', 'view', or 'single_record' --- for type of 'query' or 'sql' this property is not used as results can come from any number of entities in combination
OptionalEntityThe name of the entity in the system, only used if type = 'full_entity', 'view', or 'single_record' --- for type of 'query' or 'sql' this property is not used as results can come from any number of entities in combination
OptionalQueryQueryID - the ID of the query in the system, only used if type = 'query'
The primary key of the single record in the system, only used if type = 'single_record'. If the Entity has a composite key, this will be a command separated list of the primary key values in order of their definition in the entity.
The name of the view, query, or entity in the system. Not used with type='single_record' or type='sql'
OptionalSingleSingleRecord - the object instantiated that contains the data for the single record being used - only populated if the type is 'single_record' - also this is NOT to be sent to/from the API server, it is a placeholder that can be used in a given tier
OptionalSQLSQL - the SQL statement to execute, only used if type = 'sql'
The type of the item, either "view", "query", "full_entity", or "sql", or "single_record"
OptionalViewViewEntity - the object instantiated that contains the metadata for the UserView being used - only populated if the type is 'view', also this is NOT to be sent to/from the API server, it is a placeholder that can be used within a given tier like in the MJAPI server or in the UI.
OptionalViewViewID - the ID of the view in the system, only used if type = 'view'
This property contains the loaded data for the DataContextItem, if it was loaded successfully. The data will be in the form of an array of objects, where each object is a row of data.
Generated description of the item which is dependent on the type of the item
ProtectedbuildThis method should only be called after this Item has been fully initialized. That can be done by calling LoadMetadata() on the DataContext object, or by calling the static methods FromViewEntity, FromSingleRecord, FromQuery, or FromFullEntity, or finally by manually setting the individual properties of the DataContextItem object. A helper method, Load() at the DataContext level can be called to load the metadata and then all of the data for all items in the data context at once.
the data source to use to execute the SQL statement - specified as an any type to allow for any type of data source to be used, but the actual implementation will be specific to the server side only. For client side use of this method, you can leave this as undefined and the Load will work so long as the Data Context Items you are loading are NOT of type 'sql'
OptionalforceRefresh: boolean(defaults to false) if true, the data will be reloaded from the data source even if it is already loaded, if false, the data will only be loaded if it hasn't already been loaded
OptionalloadRelatedDataOnSingleRecords: boolean(defaults to false) if true, related entity data will be loaded for single record items, if false, related entity data will not be loaded for single record items
OptionalmaxRecordsPerRelationship: number(defaults to 0) for the LoadData() portion of this routine --- if this param is set to a value greater than 0, the maximum number of records to load for each relationship will be limited to this value. Applies to single_record items only.
OptionalcontextUser: UserInfothe user that is requesting the data context (only required on server side operations, or if you want a different user's permissions to be used for the data context load)
If you already have the data loaded for an individual Data Context Item, you can load it into the object using this method. It is your responsibility to ensure that the data object is in the correct format for the DataContextItem object. This method will not validate the data object, it will just load it into the Data property of the object.
ProtectedLoadLoads the data context item data from a full entity (meaning all rows in a given entity). This method is called by the LoadData method if the type of the data context item is 'full_entity'
Optionalprovider: IMetadataProviderProtectedLoadLoads the data context item data from a query. This method is called by the LoadData method if the type of the data context item is 'query'
ProtectedLoadLoads the data context item data from a query. This method is called by the LoadData method if the type of the data context item is 'query'
Optionalprovider: IMetadataProviderProtectedLoadServer-Side only method to load the data context item from a SQL statement
The data source to load the data context item from (this implementation uses mssql ConnectionPool object)
OptionalcontextUser: UserInfoThe user that is requesting the data context
ProtectedLoadLoads the data context item data from a view. This method is called by the LoadData method if the type of the data context item is 'view'
Validates that the Data property is set. Valid states include a zero length array, or an array with one or more elements. If the Data property is not set, this method will return false
OptionalignoreFailedLoad: booleanif true, we will not validate the data if the DataLoaded property is false, if false, we will validate the data regardless of the DataLoaded property
StaticFromCreate a new DataContextItem from a EntityInfo class instance
StaticFromCreate a new DataContextItem from a QueryInfo class instance
StaticFromCreates a new DataContextItem object from a raw data object. This method will return a new DataContextItem object if the raw data was successfully converted, and will return null if the raw data was not successfully converted.
StaticFromCreate a new DataContextItem from a BaseEntity class instance
StaticFromCreate a new DataContextItem from a MJUserViewEntity class instance
Base class and the default implementation for the DataContextItem object, other implementations (sub-classes) can be registered as well with higher priorities to take over for this particular class.