Namespace: Consultingwerk.Util
Class 
DatasetHelper Copy to Clipboard
Parent classes:
Inherits: Progress.Lang.Object

File:DatasetHelper
Syntax:Static methods only, private constructor to disallow
instance creation
Author(s):Mike Fechner / Consultingwerk Ltd.
Created:Tue Jul 14 08:37:47 CEST 2009
Purpose: Protected default constructor.
Notes: There's no need to create instances of the helper classes



Top Method Summary
Options Name Purpose
+ ActivateRelations (handle, character) Enables the given ProDataset relations. Disables all other parent-relations of the relation's child buffer
+ CHARACTER ActiveRelationNames (handle) Returns a comma-delimited list of the names of the enabled relations in the ProDataset
+ AddErrorString (handle, character) Adds an ERROR-STRING to a ProDataset Buffer, and sets the ERROR attribute of the BUFFER and the ProDataset
+ AddErrorString (handle, character, character) Adds an ERROR-STRING to a ProDataset Buffer, and sets the ERROR attribute of the BUFFER and the ProDataset
+ AddErrorString (handle, character, character, character) Adds an ERROR-STRING to a ProDataset Buffer, and sets the ERROR attribute of the BUFFER and the ProDataset
+ CHARACTER AllChildBufferNames (handle) Returns a comma-delimited list of the names of the child buffers of a ProDataset buffer
+ CHARACTER AllChildBuffers (handle) Returns a comma-delimited list of the handles of the child buffers of a ProDataset buffer
+ CHARACTER BufferNames (handle) Returns a list of all buffer names in the ProDataset
+ CHARACTER BufferNamesFromSerializeName (character, handle) Converts a list of SERIALIZE-NAME's of ProDataset temp-tables to buffer names
+ CHARACTER ChildBufferNames (handle) Returns a comma-delimited list of the names of the child buffers of a ProDataset buffer
+ CHARACTER ChildBuffers (handle) Returns a comma-delimited list of the handles of the child buffers of a ProDataset buffer
+ CHARACTER ChildRelationQueryString (handle) Returns the query string matching a DATA-RELATION field pairs
+ CHARACTER ChildRelationQueryStringWithValues (handle) Returns the query string matching a DATA-RELATION field pairs
+ LOGICAL ChildRelationUnique (handle) Returns if the child buffer relation is unique
+ LOGICAL CopyErrorStatus (handle, handle) Copies the error-status from the source dataset to the target dataset
+ CopyReadOnlyTables (handle, handle) Copies the read-only tables (no before table) from the source dataset to the target dataset
+ CopyUnmodifiedRecords (handle, handle) Copies unmodified records from the source into the target dataset
+ Consultingwerk.Util.Enum.DatasetControlStringEnum DatasetControlString (handle) Returns _CANCEL or _QUESTIONS-PENDING when contained in the ERROR-STRING of at least a single record
+ Consultingwerk.RecordIdentifier DatasetErrorRecordIdentifier (handle) Returns the RecordIdentifier identifying the first record in the ProDataset with Errors
+ CHARACTER DatasetErrorStrings (handle) Returns a single CHARACTER string composed of the error-strings of all records (from all tables in the given Dataset instance)
+ LONGCHAR DatasetErrorStringsLong (handle) Returns a single CHARACTER string composed of the error-strings of all records (from all tables in the given Dataset instance)
+ HANDLE DatasetFieldHandle (handle, character, character, character) Returns the buffer-field handle for the given lookup field
+ ROWID DatasetQueryRowids (handle, handle, rowid[]) Extracts the Rowids from an array of ROWID's in order of Buffer-Sequence in a ProDataset to an array of those ROWID's used in a query on buffers of the ProDataset
+ DeleteCascade (handle) Deletes the record from the given ProDataset buffer and recursively deletes all child records
+ DeleteCascade (handle, logical, character) Deletes the record from the given ProDataset buffer and recursively deletes all child records
+ DeleteDatasetAndBuffers (handle) Deletes a ProDataset object handle and all it's buffers
+ DeleteDatasetAndTempTables (handle) Deletes a ProDataset object handle and all it's member temp-table
+ DeleteOrphanedRecords (handle) Deletes orphaned records in the given Dataset or child table
- DeleteOrphanedRecords (handle, logical) Deletes orphaned records in the given Dataset or child table
+ DeleteRestrict (handle) Deletes the record from the given ProDataset buffer only when there is no child record
+ DetachDataSources (handle) Detaches the DATA-SOURCE's of the ProDataset buffer
+ EmptyDataset (handle) Empties a ProDataset
+ HANDLE FindBufferWithField (handle, character, character) Find the first buffer of the list in the given ProDataset that contains a field with the given name
+ HANDLE GetBufferHandles (handle) Returns an Array of the Buffer handles of the given Dataset
+ INTEGER GetBufferIndex (handle, character) Returns the index of the buffer name in the ProDataset
+ HANDLE GetChangesDataset (handle) Builds a dataset containing the changes records from the source dataset.
+ HANDLE GetChildRelation (handle, character) Returns the handle of the child relation of a buffer by name
+ ROWID GetDatasetRowids (handle) Returns an array with the current ROWID's of every ProDataset buffer
+ HANDLE GetDatasetWithCurrentRecord (handle) Creates a Dataset as a copy of another Dataset that only contains the current record in the given ProDataset temp-table buffer
+ HANDLE GetDatasetWithoutRelations (handle) Returns a Dataset with the same schema but no relations
+ HANDLE GetDataSourceQueryHandles (handle) Returns an array of the Query handles of the Data-Sources of the given Dataset
+ CHARACTER GetFillWhereStrings (handle) Returns an array of the FILL-WHERE-STRING's of the Data-Sources of the given Dataset
+ HANDLE GetTableHandles (handle) Returns an Array of the Temp-Table handles of the given Dataset
+ LOGICAL GetTrackingChanges (handle) Returns if the Dataset is currently TRACKING-CHANGES
+ LOGICAL HasBuffer (handle, character) Returns if the the passed in ProDataset handle has a buffer with the given name
+ LOGICAL HasChanges (handle) Tests if a ProDataset has changes
+ LOGICAL HasCreatedRecords (handle) Returns if the Dataset has records with a ROW-STATE of ROW-CREATED
+ LOGICAL HasDeletedRecords (handle) Returns if the Dataset has records with a ROW-STATE of ROW-DELETED
+ LOGICAL HasErrors (handle) Returns if the Dataset contains a record with an ERROR-STRING, ERROR or REJECTED
+ LOGICAL HasModifiedRecords (handle) Returns if the Dataset has records with a ROW-STATE of ROW-MODIFIED
+ LOGICAL HasRecursiveRelationFromTopLevelBuffer (handle) Checks if the ProDataset contains an active recursive data-relation from any of the top-level buffers
+ LOGICAL HasRowState (handle, integer) Returns if the Dataset has records with a given ROW-STATE
+ LOGICAL HasValidationMessages (handle) Returns if the ProDataset or ProDataset Buffer has any validation messages (BUFFER ERROR-STRING)
+ LOGICAL HasValidationMessages (handle, character) Returns if the ProDataset or ProDataset Buffer has any validation messages (BUFFER ERROR-STRING) for the given field name
+ LOGICAL HasValidationMessages (handle, character, character) Returns if the ProDataset or ProDataset Buffer has any validation messages (BUFFER ERROR-STRING) for the given field name and the given message group and number
+ LOGICAL HasValidationMessages (handle, character, character, integer) Returns if the ProDataset or ProDataset Buffer has any validation messages (BUFFER ERROR-STRING) for the given field name and the given message group and number
+ LOGICAL HasValidationMessages (handle, character, character, integer, character, character, character, character, character, character, character, character, character) Returns if the ProDataset or ProDataset Buffer has any validation messages (BUFFER ERROR-STRING) for the given field name and the given message group and number
+ LOGICAL HasValidationMessages (handle, character, integer) Returns if the ProDataset or ProDataset Buffer has any validation messages (BUFFER ERROR-STRING) of the given message group and number
+ LOGICAL HasValidationMessages (handle, character, integer, character, character, character, character, character, character, character, character, character) Returns if the ProDataset or ProDataset Buffer has any validation messages (BUFFER ERROR-STRING) of the given message group and number with the provided substitution values
+ LOGICAL IsUniqueChildRelation (handle) Returns if the provided data-relation is pointing to an unique child record
+ MergeUnmodifiedRecords (handle, handle) Merges the records of the source dataset into the target dataset. Does not overwrite modified records of the target dataset
+ HANDLE ParentBuffer (handle) Returns the handle of the parent buffer of a ProDataset buffer
+ Consultingwerk.Framework.Collections.RowidDictionary ParentRecordRowids (handle) Returns a RowidDictionary with the ROWID's of the current record as well as the parent and grand-parent ... records based on the ProDataset relations
+ CHARACTER ParentRelationWhereStringWithValues (handle) Returns the where string matching a DATA-RELATION field pairs
+ RejectNonCreateChanges (handle) Rejects all row-changes in the ProDatasets before tables that do not have the row-mod of Adding
+ RepositionDatasetBuffers (handle, rowid[]) Locates the records in all ProDataset buffers based on an Array of ROWID's
+ ResolveSmartErrorMessages (handle) Resolves SmartMessages in the Dataset records ERROR-STRING
+ SanitizeErrors (handle) Sanitizes ProDataset ERROR-STRING and ERROR
+ SetControlCancel (handle) Sets the ERROR-STRING of a ProDataset Buffer, and the ERROR attribute of the BUFFER and the ProDataset based on a DatasetControlStringEnum value
+ SetControlString (handle, DatasetControlStringEnum) Sets the ERROR-STRING of a ProDataset Buffer, and the ERROR attribute of the BUFFER and the ProDataset based on a DatasetControlStringEnum value
+ SetDataSourceQueryHandles (handle, handle[]) Assigns the Query handles of the data-source widgets attached to the ProDataset buffers
+ SetErrorString (handle, character) Sets the ERROR-STRING of a ProDataset Buffer, and the ERROR attribute of the BUFFER and the ProDataset
+ SetFillWhereStrings (handle, character[]) Assigns the FILL-WHERE-STRING's of the data-source widgets attached to the ProDataset buffers
+ SetSerializeNameFromXmlNodeName (handle) Sets all of a dataset's SERIALIZE-NAME attributes the value of the XML-NODE-NAME attribute. If a SERIALIZE-NAME value is the same as the NAME value, and the XML-NODE-NAME value is different, then the SERIALIZE-NAME value will be set to the XML-NODE-NAME.
+ SetTrackingChanges (handle, logical) Sets the tracking changes property of all temp-tables of the passed in dataset
+ SetTrackingChanges (handle, logical, DynamicTempTablesEnum) Sets the tracking changes property of all temp-tables of the passed in dataset
+ CHARACTER SiblingWhereStringWithValues (handle) Returns the where string matching a DATA-RELATION field pairs for a child buffer of the FOR EACH for a parent buffer
+ ThrowDatasetErrors (handle) Throws Dataset Validation error messages from the ERROR-STRING attributes of any record

Top Constructor Summary
Options Name Purpose
# DatasetHelper () Protected default constructor.


Method Detail
Top

PUBLIC ActivateRelations (handle, character)

Purpose: Enables the given ProDataset relations. Disables all other
parent-relations of the relation's child buffer
Notes: Supports a comma-delimited list of relations

Parameters:
phDataset HANDLE
The handle of the ProDataset
pcRelationNames CHARACTER
The name of the relation to enable
Top

PUBLIC CHARACTER ActiveRelationNames (handle)

Purpose: Returns a comma-delimited list of the names of the enabled relations in the
ProDataset
Notes:

Parameters:
phDataset HANDLE
The handle of the ProDataset
Returns CHARACTER
The comma-delimited list of the names of the enabled relations
Top

PUBLIC AddErrorString (handle, character)

Purpose: Adds an ERROR-STRING to a ProDataset Buffer, and sets the ERROR
attribute of the BUFFER and the ProDataset
Notes:

Parameters:
phBuffer HANDLE
The ProDataset Member Buffer
pcErrorString CHARACTER
The Error-String to add
Top

PUBLIC AddErrorString (handle, character, character)

Purpose: Adds an ERROR-STRING to a ProDataset Buffer, and sets the ERROR
attribute of the BUFFER and the ProDataset
Notes:

Parameters:
phBuffer HANDLE
The ProDataset Member Buffer
pcErrorString CHARACTER
The Error-String to add
pcErrorFieldName CHARACTER
The name of the field this error message belongs to
Top

PUBLIC AddErrorString (handle, character, character, character)

Purpose: Adds an ERROR-STRING to a ProDataset Buffer, and sets the ERROR
attribute of the BUFFER and the ProDataset
Notes:

Parameters:
phBuffer HANDLE
The ProDataset Member Buffer
pcErrorString CHARACTER
The Error-String to add
pcErrorFieldName CHARACTER
The name of the field this error message belongs to
pcErrorBufferName CHARACTER
The name of the buffer this error message belongs to
Top

PUBLIC CHARACTER AllChildBufferNames (handle)

Purpose: Returns a comma-delimited list of the names of the child buffers
of a ProDataset buffer
Notes: Recursively returns also grand-children

Parameters:
phBuffer HANDLE
The ProDataset buffer handle to return child buffers from
Returns CHARACTER
The comma-delimited list of the handles of the child buffers
Top

PUBLIC CHARACTER AllChildBuffers (handle)

Purpose: Returns a comma-delimited list of the handles of the child buffers
of a ProDataset buffer
Notes: Recursively returns also grand-children

Parameters:
phBuffer HANDLE
The ProDataset buffer handle to return child buffers from
Returns CHARACTER
The comma-delimited list of the handles of the child buffers
Top

PUBLIC CHARACTER BufferNames (handle)

Purpose: Returns a list of all buffer names in the ProDataset
Notes:

Parameters:
phDataset HANDLE
The handle of the ProDataset
Returns CHARACTER
The comma-delimited list of buffer names
Top

PUBLIC CHARACTER BufferNamesFromSerializeName (character, handle)

Purpose: Converts a list of SERIALIZE-NAME's of ProDataset temp-tables
to buffer names
Notes:

Parameters:
pcSerializeNames CHARACTER
The comma delimited list of SERIALIZE-NAME's
phDataset HANDLE
The handle of the ProDataset
Returns CHARACTER
The comma delimited list of buffer names
Top

PUBLIC CHARACTER ChildBufferNames (handle)

Purpose: Returns a comma-delimited list of the names of the child buffers
of a ProDataset buffer
Notes:

Parameters:
phBuffer HANDLE
The ProDataset buffer handle to return child buffers from
Returns CHARACTER
The comma-delimited list of the handles of the child buffers
Top

PUBLIC CHARACTER ChildBuffers (handle)

Purpose: Returns a comma-delimited list of the handles of the child buffers
of a ProDataset buffer
Notes:

Parameters:
phBuffer HANDLE
The ProDataset buffer handle to return child buffers from
Returns CHARACTER
The comma-delimited list of the handles of the child buffers
Top

PUBLIC CHARACTER ChildRelationQueryString (handle)

Purpose: Returns the query string matching a DATA-RELATION field pairs
Notes: Uses the parent table field names in the query string

Parameters:
phBuffer HANDLE
The child buffer of the relation
Returns CHARACTER
The query string matching the data-relation criteria
Top

PUBLIC CHARACTER ChildRelationQueryStringWithValues (handle)

Purpose: Returns the query string matching a DATA-RELATION field pairs
Notes: Instead of the parent table field names, the current buffer values are
used
When a before-buffer is passed in as phBuffer, we'll provide values based on the
before-buffer of the parent-record, when available

Parameters:
phBuffer HANDLE
The child buffer of the relation
Returns CHARACTER
The query string matching the data-relation criteria
Top

PUBLIC LOGICAL ChildRelationUnique (handle)

Purpose: Returns if the child buffer relation is unique
Notes:

Parameters:
phChildBuffer HANDLE
The child buffer to test for uniqueness
Returns LOGICAL
Logical value indicating the uniqueness of the child buffer
Top

PUBLIC LOGICAL CopyErrorStatus (handle, handle)

Purpose: Copies the error-status from the source dataset to the target dataset
Notes: Processes the BEFORE-TABLE records and assigns the ERROR, ERROR-STRING and
REJECTED attributes, expects that the hToDataset has before-table records
matching the hFromDataset

Parameters:
phFromDataset HANDLE
The handle of the source ProDataset
phToDataset HANDLE
The handle of the target ProDataset
Returns LOGICAL
Logical value indicating if there were records with an error
Top

PUBLIC CopyReadOnlyTables (handle, handle)

Purpose: Copies the read-only tables (no before table) from the source dataset
to the target dataset
Notes: Useful in combination with the dataset MERGE-CHANGES method to copy
also rows from tables without a before table form the source to the
target dataset. Those tables are ignored by the MERGE-CHANGES method

Parameters:
phSourceDataset HANDLE
The handle of the source dataset
phTargetDataset HANDLE
The handle of the target dataset
Top

PUBLIC CopyUnmodifiedRecords (handle, handle)

Purpose: Copies unmodified records from the source into the target dataset
Notes: Useful to fill a Dataset retrieved from GET-CHANGES with unmodified
records as well

Parameters:
phSourceDataset HANDLE
The handle of the source dataset
phTargetDataset HANDLE
The handle of the target dataset
Top

PUBLIC Consultingwerk.Util.Enum.DatasetControlStringEnum DatasetControlString (handle)

Purpose: Returns _CANCEL or _QUESTIONS-PENDING when contained in the
ERROR-STRING of at least a single record
Notes: SCL-2567

Parameters:
phDataset HANDLE
The handle of the dataset to return the error strings from
Returns Consultingwerk.Util.Enum.DatasetControlStringEnum
The control string as an DatasetControlStringEnum value
Top

PUBLIC Consultingwerk.RecordIdentifier DatasetErrorRecordIdentifier (handle)

Purpose: Returns the RecordIdentifier identifying the first record in the
ProDataset with Errors
Notes: Processes the Dataset in the same order as DatasetErrorStrings

Parameters:
phDataset HANDLE
The handle of the dataset to return the error strings from
Returns Consultingwerk.RecordIdentifier
The RecordIdentifier identifying the first record in the ProDataset with errors
Top

PUBLIC CHARACTER DatasetErrorStrings (handle)

Purpose: Returns a single CHARACTER string composed of the error-strings
of all records (from all tables in the given Dataset instance)
Notes: Filters out _CANCEL and _QUESTIONS-PENDING (SCL-2567)

Parameters:
phDataset HANDLE
The handle of the dataset to return the error strings from
Returns CHARACTER
The string composed of the error-strings of all records
Top

PUBLIC LONGCHAR DatasetErrorStringsLong (handle)

Purpose: Returns a single CHARACTER string composed of the error-strings
of all records (from all tables in the given Dataset instance)
Notes: Filters out _CANCEL and _QUESTIONS-PENDING (SCL-2567)

Parameters:
phDataset HANDLE
The handle of the dataset to return the error strings from
Returns LONGCHAR
The LONGCHAR string composed of the error-strings of all records
Top

PUBLIC HANDLE DatasetFieldHandle (handle, character, character, character)

Purpose: Returns the buffer-field handle for the given lookup field
Notes:

Parameters:
phDataset HANDLE
The ProDataset of the Business Entity
pcEntityTable CHARACTER
The name of the entity table
pcEntityView CHARACTER
The entity view tables
pcFieldName CHARACTER
The name of the lookup field
Returns HANDLE
The handle of the dataset field
Top

PUBLIC ROWID DatasetQueryRowids (handle, handle, rowid[])

Purpose: Extracts the Rowids from an array of ROWID's in order of Buffer-Sequence in a
ProDataset to an array of those ROWID's used in a query on buffers of the ProDataset
Notes:

Parameters:
phDataset HANDLE
The handle of the ProDataset
phQuery HANDLE
The handle of the query on buffers from the ProDataset
roRowids ROWID
The array of ProDataset buffer ROWIDs
Returns ROWID
The array of ROWIDs from the query
Top

PUBLIC DeleteCascade (handle)

Purpose: Deletes the record from the given ProDataset buffer and recursively
deletes all child records
Notes:

Parameters:
phBuffer HANDLE
The handle of the ProDataset buffer with the record to delete
Top

PUBLIC DeleteCascade (handle, logical, character)

Purpose: Deletes the record from the given ProDataset buffer and recursively
deletes all child records
Notes: Supports * as value for pcDeleteChildBuffers

Parameters:
phBuffer HANDLE
The handle of the ProDataset buffer with the record to delete
plDeleteRecord LOGICAL
Delete the actual record
pcDeleteChildBuffers CHARACTER
The comma delimited list of child buffer names to process
Top

PUBLIC DeleteDatasetAndBuffers (handle)

Purpose: Deletes a ProDataset object handle and all it's buffers
Notes: Useful, when dynamic buffers have been added to a ProDataset manually
any are not maintained by the ProDataset (like they would be when the
Dataset was created by the CREATE-LIKE method or similar).

Parameters:
phDataset HANDLE
The handle of the ProDataset
Top

PUBLIC DeleteDatasetAndTempTables (handle)

Purpose: Deletes a ProDataset object handle and all it's member temp-table
Notes:

Parameters:
phDataset HANDLE
The handle of the ProDataset
Top

PUBLIC DeleteOrphanedRecords (handle)

Purpose: Deletes orphaned records in the given Dataset or child table
Notes:

Parameters:
phDatasetOrBufferHandle HANDLE
The handle of the ProDataset or child table buffer
Top

PRIVATE DeleteOrphanedRecords (handle, logical)

Purpose: Deletes orphaned records in the given Dataset or child table
Notes:

Parameters:
phBuffer HANDLE
The handle of the ProDataset buffer to delete orphaned records in
plRecursive LOGICAL
Logical value indicating if child relations should be iterated recursively
Top

PUBLIC DeleteRestrict (handle)

Purpose: Deletes the record from the given ProDataset buffer only when
there is no child record
Notes: Throws an error message, when a child error still exists

Parameters:
phBuffer HANDLE
The handle of the ProDataset buffer with the record to delete
Top

PUBLIC DetachDataSources (handle)

Purpose: Detaches the DATA-SOURCE's of the ProDataset buffer
Notes:

Parameters:
phDataset HANDLE
The handle of the ProDataset
Top

PUBLIC EmptyDataset (handle)

Purpose: Empties a ProDataset
Notes: Assigns Tracking-Changes of all temp-tables to FALSE prior to
emptying the ProDataset and restores the state of Tracking-Changes
afterwards

Parameters:
phDataset HANDLE
The handle of the ProDataset
Top

PUBLIC HANDLE FindBufferWithField (handle, character, character)

Purpose: Find the first buffer of the list in the given ProDataset that
contains a field with the given name
Notes: Returns ? when the field is not available in any buffer

Parameters:
phDataset HANDLE
The handle of the ProDataset
pcBufferNames CHARACTER
The comma delimited list of buffer names of the ProDataset
pcFieldName CHARACTER
The unqualified name of the field to locate
Returns HANDLE
The handle of the first buffer that contains the field
Top

PUBLIC HANDLE GetBufferHandles (handle)

Purpose: Returns an Array of the Buffer handles of the given Dataset
Notes: Returns an uninitialized array and not a runtime error when the dataset
does not contain any buffer

Parameters:
phDataset HANDLE
The handle of the dataset
Returns HANDLE
The Array of Buffer handles
Top

PUBLIC INTEGER GetBufferIndex (handle, character)

Purpose: Returns the index of the buffer name in the ProDataset
Notes: Return ? when the buffer is not a member of the ProDataset

Parameters:
phDataset HANDLE
The handle of the ProDataset
pcBufferName CHARACTER
The name of the buffer to locate
Returns INTEGER
The index of the buffer in the ProDataset buffer's list
Top

PUBLIC HANDLE GetChangesDataset (handle)

Purpose: Builds a dataset containing the changes records from the
source dataset.
Notes: This method returns a dataset, clean up has to be done by the
caller.

Parameters:
phDataset HANDLE
The handle of the original dataset
Returns HANDLE
The handle of a new dataset containing the changes from the original dataset
Top

PUBLIC HANDLE GetChildRelation (handle, character)

Purpose: Returns the handle of the child relation of a buffer by name
Notes:

Parameters:
phParentBuffer HANDLE
The handle to the parent buffer
pcDataRelationName CHARACTER
The name of the data-relation to return
Returns HANDLE
The handle of the data-relation with the matching name
Top

PUBLIC ROWID GetDatasetRowids (handle)

Purpose: Returns an array with the current ROWID's of every ProDataset buffer
Notes: Useful in situations where ProDataset methods such as GET-CHANGES
or MERGE-CHANGES invalidate the current record buffers

Parameters:
phDataset HANDLE
The handle of the ProDataset
Returns ROWID
The variable extent array of ROWID's matching the order of buffers in the ProDataset
Top

PUBLIC HANDLE GetDatasetWithCurrentRecord (handle)

Purpose: Creates a Dataset as a copy of another Dataset that only contains
the current record in the given ProDataset temp-table buffer
Notes: Useful to send individual records of a ProDataset to Business Entity
InvokeMethod or Business Task methods

Parameters:
phBuffer HANDLE
The handle of the ProDataset Buffer that contains the record to be copied
Returns HANDLE
The copy of the ProDataset, the caller is responsible to clean this up when no longer needed
Top

PUBLIC HANDLE GetDatasetWithoutRelations (handle)

Purpose: Returns a Dataset with the same schema but no relations
Notes:

Parameters:
phDataset HANDLE
The handle of the source dataset
Returns HANDLE
The copy of the dataset with no relations
Top

PUBLIC HANDLE GetDataSourceQueryHandles (handle)

Purpose: Returns an array of the Query handles of the Data-Sources of the
given Dataset
Notes: Array may contain invalid ? entries when data sources don't have a
query assigned

Parameters:
phDataset HANDLE
The handle of the ProDataset
Returns HANDLE
The handle array with the handles of the data-source queries
Top

PUBLIC CHARACTER GetFillWhereStrings (handle)

Purpose: Returns an array of the FILL-WHERE-STRING's of the Data-Sources of the
given Dataset
Notes: Array may contain invalid ? entries when a buffer doesn't have a data-source

Parameters:
phDataset HANDLE
The handle of the ProDataset
Returns CHARACTER
The character array with the FILL-WHERE-STRING's of the buffers data-source
Top

PUBLIC HANDLE GetTableHandles (handle)

Purpose: Returns an Array of the Temp-Table handles of the given Dataset
Notes: Returns an uninitialized array and not a runtime error when the dataset
does not contain any buffer

Parameters:
phDataset HANDLE
The handle of the dataset
Returns HANDLE
The Array of Temp-Table handles
Top

PUBLIC LOGICAL GetTrackingChanges (handle)

Purpose: Returns if the Dataset is currently TRACKING-CHANGES
Notes: Returns the value of the TRACKING-CHANGES attribute of the first
updatable temp-table. When there is not updatable temp-table, FALSE
will be returned

Parameters:
phDataset HANDLE
Handle of the dataset
Returns LOGICAL
Logical value indicating if the Dataset is TRACKING-CHANGES
Top

PUBLIC LOGICAL HasBuffer (handle, character)

Purpose: Returns if the the passed in ProDataset handle has a buffer with the
given name
Notes:

Parameters:
phDataset HANDLE
The handle of the ProDataset
pcBufferName CHARACTER
The name of the Buffer that should exist
Returns LOGICAL
Logical value indicating if the ProDataset has a buffer with the given name
Top

PUBLIC LOGICAL HasChanges (handle)

Purpose: Tests if a ProDataset has changes
Notes: Similar to the System.Data.Dataset.HasChanges attribute

Parameters:
phDataset HANDLE
Handle of the dataset
Returns LOGICAL
Logical value indicating if the ProDataset has change records (before table records)
Top

PUBLIC LOGICAL HasCreatedRecords (handle)

Purpose: Returns if the Dataset has records with a ROW-STATE of
ROW-CREATED
Notes:

Parameters:
phDataset HANDLE
The handle of the Dataset
Returns LOGICAL
Logical value indicating if the dataset has records with ROW-STATE = ROW-CREATED
Top

PUBLIC LOGICAL HasDeletedRecords (handle)

Purpose: Returns if the Dataset has records with a ROW-STATE of
ROW-DELETED
Notes:

Parameters:
phDataset HANDLE
The handle of the Dataset
Returns LOGICAL
Logical value indicating if the dataset has records with ROW-STATE = ROW-DELETED
Top

PUBLIC LOGICAL HasErrors (handle)

Purpose: Returns if the Dataset contains a record with an
ERROR-STRING, ERROR or REJECTED
Notes:

Parameters:
phDataset HANDLE
Tha handle of the Dataset to test
Returns LOGICAL
Logical value indicating if the dataset has errors
Top

PUBLIC LOGICAL HasModifiedRecords (handle)

Purpose: Returns if the Dataset has records with a ROW-STATE of
ROW-MODIFIED
Notes:

Parameters:
phDataset HANDLE
The handle of the Dataset
Returns LOGICAL
Logical value indicating if the dataset has records with ROW-STATE = ROW-MODIFIED
Top

PUBLIC LOGICAL HasRecursiveRelationFromTopLevelBuffer (handle)

Purpose: Checks if the ProDataset contains an active recursive
data-relation from any of the top-level buffers
Notes:

Parameters:
phDataset HANDLE
The handle of the ProDataset
Returns LOGICAL
Logical value indicating if ProDataset contains an active recursive data-relation from any of the top-level buffers
Top

PUBLIC LOGICAL HasRowState (handle, integer)

Purpose: Returns if the Dataset has records with a given ROW-STATE
Notes:

Parameters:
phDataset HANDLE
The handle of the Dataset
piRowState INTEGER
The INTEGER ROW-STATE value to verify
Returns LOGICAL
Logical value indicating if the dataset has records with ROW-STATE = ROW-CREATED
Top

PUBLIC LOGICAL HasValidationMessages (handle)

Purpose: Returns if the ProDataset or ProDataset Buffer has
any validation messages (BUFFER ERROR-STRING)
Notes:

Parameters:
phDataHandle HANDLE
The handle of the ProDataset
Returns LOGICAL
Logical value indicating if the ProDataset or Buffer has any validation messages
Top

PUBLIC LOGICAL HasValidationMessages (handle, character)

Purpose: Returns if the ProDataset or ProDataset Buffer has
any validation messages (BUFFER ERROR-STRING) for the
given field name
Notes: Ignores parameters with value = ? in the evaluation

Parameters:
phDataHandle HANDLE
The handle of the ProDataset
pcFieldName CHARACTER
The name of the field to verify
Returns LOGICAL
Logical value indicating if the ProDataset or Buffer has any validation messages
Top

PUBLIC LOGICAL HasValidationMessages (handle, character, character)

Purpose: Returns if the ProDataset or ProDataset Buffer has
any validation messages (BUFFER ERROR-STRING) for the
given field name and the given message group and number
Notes: Ignores parameters with value = ? in the evaluation

Parameters:
phDataHandle HANDLE
The handle of the ProDataset
pcFieldName CHARACTER
The name of the field to verify
pcMessageText CHARACTER
The text of the validation message
Returns LOGICAL
Logical value indicating if the ProDataset or Buffer has any validation messages
Top

PUBLIC LOGICAL HasValidationMessages (handle, character, character, integer)

Purpose: Returns if the ProDataset or ProDataset Buffer has
any validation messages (BUFFER ERROR-STRING) for the
given field name and the given message group and number
Notes: Ignores parameters with value = ? in the evaluation

Parameters:
phDataHandle HANDLE
The handle of the ProDataset
pcFieldName CHARACTER
The name of the field to verify
pcMessageGroup CHARACTER
The message group
piMessageNumber INTEGER
The message number
Returns LOGICAL
Logical value indicating if the ProDataset or Buffer has any validation messages
Top

PUBLIC LOGICAL HasValidationMessages (handle, character, character, integer, character, character, character, character, character, character, character, character, character)

Purpose: Returns if the ProDataset or ProDataset Buffer has
any validation messages (BUFFER ERROR-STRING) for the
given field name and the given message group and number
Notes: Only substitution values <> ? will be verified, ignores
parameters with value = ? in the evaluation

Parameters:
phDataHandle HANDLE
The handle of the ProDataset
pcFieldName CHARACTER
The name of the field to verify
pcMessageGroup CHARACTER
The message group
piMessageNumber INTEGER
The message number
pcSubstitutionValue1 CHARACTER
The first message substitute value (&1)
pcSubstitutionValue2 CHARACTER
The second message substitute value (&2)
pcSubstitutionValue3 CHARACTER
The third message substitute value (&3)
pcSubstitutionValue4 CHARACTER
The fourth message substitute value (&4)
pcSubstitutionValue5 CHARACTER
The fifth message substitute value (&5)
pcSubstitutionValue6 CHARACTER
The sixth message substitute value (&6)
pcSubstitutionValue7 CHARACTER
The seventh message substitute value (&7)
pcSubstitutionValue8 CHARACTER
The eight message substitute value (&8)
pcSubstitutionValue9 CHARACTER
The ninth message substitute value (&9)
Returns LOGICAL
Logical value indicating if the ProDataset or Buffer has any validation messages
Top

PUBLIC LOGICAL HasValidationMessages (handle, character, integer)

Purpose: Returns if the ProDataset or ProDataset Buffer has
any validation messages (BUFFER ERROR-STRING) of the given
message group and number
Notes: Ignores parameters with value = ? in the evaluation

Parameters:
phDataHandle HANDLE
The handle of the ProDataset
pcMessageGroup CHARACTER
The message group
piMessageNumber INTEGER
The message number
Returns LOGICAL
Logical value indicating if the ProDataset or Buffer has any validation messages
Top

PUBLIC LOGICAL HasValidationMessages (handle, character, integer, character, character, character, character, character, character, character, character, character)

Purpose: Returns if the ProDataset or ProDataset Buffer has
any validation messages (BUFFER ERROR-STRING) of the given
message group and number with the provided substitution values
Notes: Only substitution values <> ? will be verified, ignores
parameters with value = ? in the evaluation

Parameters:
phDataHandle HANDLE
The handle of the ProDataset
pcMessageGroup CHARACTER
The message group
piMessageNumber INTEGER
The message number
pcSubstitutionValue1 CHARACTER
The first message substitute value (&1)
pcSubstitutionValue2 CHARACTER
The second message substitute value (&2)
pcSubstitutionValue3 CHARACTER
The third message substitute value (&3)
pcSubstitutionValue4 CHARACTER
The fourth message substitute value (&4)
pcSubstitutionValue5 CHARACTER
The fifth message substitute value (&5)
pcSubstitutionValue6 CHARACTER
The sixth message substitute value (&6)
pcSubstitutionValue7 CHARACTER
The seventh message substitute value (&7)
pcSubstitutionValue8 CHARACTER
The eight message substitute value (&8)
pcSubstitutionValue9 CHARACTER
The ninth message substitute value (&9)
Returns LOGICAL
Logical value indicating if the ProDataset or Buffer has any validation messages
Top

PUBLIC LOGICAL IsUniqueChildRelation (handle)

Purpose: Returns if the provided data-relation is pointing to an unique
child record
Notes: Returns TRUE for eOrder->eCustomer and FALSE for eOrder->eOrderLine

Parameters:
phRelation HANDLE
The handle of the DATA-RELATION to test
Returns LOGICAL
Logical value indicating if the data-relation is pointing to an unique child record
Top

PUBLIC MergeUnmodifiedRecords (handle, handle)

Purpose: Merges the records of the source dataset into the target dataset.
Does not overwrite modified records of the target dataset
Notes: The target dataset is expected to contain the same buffers/fields as the
source dataset

Parameters:
phSourceDataset HANDLE
The source ProDataset handle
phTargetDataset HANDLE
The target ProDataset handle
Top

PUBLIC HANDLE ParentBuffer (handle)

Purpose: Returns the handle of the parent buffer of a ProDataset buffer
Notes:

Parameters:
phBuffer HANDLE
The handle of the ProDataset buffer (child buffer)
Returns HANDLE
The handle of the parent buffer
Top

PUBLIC Consultingwerk.Framework.Collections.RowidDictionary ParentRecordRowids (handle)

Purpose: Returns a RowidDictionary with the ROWID's of the current record as
well as the parent and grand-parent ... records based on the ProDataset
relations
Notes:

Parameters:
phBuffer HANDLE
The handle of the child buffer to return the parent ROWID's for
Returns Consultingwerk.Framework.Collections.RowidDictionary
The RowidDictionary with the ROWID's of the parent records
Top

PUBLIC CHARACTER ParentRelationWhereStringWithValues (handle)

Purpose: Returns the where string matching a DATA-RELATION field pairs
Notes: Instead of the parent table field names, the current buffer values of
the child table are used in the where string

Parameters:
phBuffer HANDLE
The child buffer of the relation
Returns CHARACTER
The query string matching the data-relation criteria
Top

PUBLIC RejectNonCreateChanges (handle)

Purpose: Rejects all row-changes in the ProDatasets before tables that
do not have the row-mod of Adding
Notes: ROW-UNMODIFIED 0 The row was not modified.
ROW-DELETED 1 The row was deleted.
ROW-MODIFIED 2 The row was modified.
ROW-CREATED 3 The row was created.

Parameters:
phDataset HANDLE
The handle to the dataset
Top

PUBLIC RepositionDatasetBuffers (handle, rowid[])

Purpose: Locates the records in all ProDataset buffers based on an Array
of ROWID's
Notes: The input parameter proRowids can be obtained from the GetDatasetRowids
method

Parameters:
phDataset HANDLE
The handle of the ProDataset
proRowids ROWID
The variable extent array of ROWID's matching the order of buffers in the ProDataset
Top

PUBLIC ResolveSmartErrorMessages (handle)

Purpose: Resolves SmartMessages in the Dataset records ERROR-STRING
Notes:

Parameters:
phDataset HANDLE
The handle of the Dataset to process
Top

PUBLIC SanitizeErrors (handle)

Purpose: Sanitizes ProDataset ERROR-STRING and ERROR
Notes: Sets ERROR-STRING to "", ERROR and REJECTED to FALSE

Parameters:
phDataset HANDLE
Tha handle of the Dataset to sanitize errors
Top

PUBLIC SetControlCancel (handle)

Purpose: Sets the ERROR-STRING of a ProDataset Buffer, and the ERROR attribute
of the BUFFER and the ProDataset based on a DatasetControlStringEnum
value
Notes:

Parameters:
phBuffer HANDLE
The ProDataset Member Buffer
Top

PUBLIC SetControlString (handle, DatasetControlStringEnum)

Purpose: Sets the ERROR-STRING of a ProDataset Buffer, and the ERROR attribute
of the BUFFER and the ProDataset based on a DatasetControlStringEnum
value
Notes:

Parameters:
phBuffer HANDLE
The ProDataset Member Buffer
poControlString Consultingwerk.Util.Enum.DatasetControlStringEnum
The DatasetControlStringEnum value
Top

PUBLIC SetDataSourceQueryHandles (handle, handle[])

Purpose: Assigns the Query handles of the data-source widgets attached to the
ProDataset buffers
Notes: Ignores Cannot assign auto-generated FILL query to user FILL query. (11866)
in which case it seems safe to assign ? to the DATA-SOURCE QUERY attribute

Parameters:
phDataset HANDLE
The handle of the ProDataset
phQueries HANDLE
The array of the query handles to assign to the data-source queries
Top

PUBLIC SetErrorString (handle, character)

Purpose: Sets the ERROR-STRING of a ProDataset Buffer, and the ERROR attribute
of the BUFFER and the ProDataset
Notes:

Parameters:
phBuffer HANDLE
The ProDataset Member Buffer
pcErrorString CHARACTER
The Error-String
Top

PUBLIC SetFillWhereStrings (handle, character[])

Purpose: Assigns the FILL-WHERE-STRING's of the data-source widgets attached to the
ProDataset buffers
Notes: Ignores Cannot assign auto-generated FILL query to user FILL query. (11866)
in which case it seems safe to assign ? to the DATA-SOURCE QUERY attribute

Parameters:
phDataset HANDLE
The handle of the ProDataset
pcFillWhereStrings CHARACTER
The array of the query handles to assign to the data-source queries
Top

PUBLIC SetSerializeNameFromXmlNodeName (handle)

Purpose: Sets all of a dataset's SERIALIZE-NAME attributes the value of the XML-NODE-NAME
attribute. If a SERIALIZE-NAME value is the same as the NAME value, and the
XML-NODE-NAME value is different, then the SERIALIZE-NAME value will be set to the
XML-NODE-NAME.
Notes: This method is intended to be used for datasets that have been dynamically created from
an XSD file loaded with the READ-XMLSCHEMA method. The doc at
https://docs.progress.com/bundle/openedge-abl-use-xml/page/XML-NODE-NAME-and-SERIALIZE-NAME.html //docs.progress.com/bundle/openedge-abl-use-xml/page/XML-NODE-NAME-and-SERIALIZE-NAME.html
does not mention READ-XMLSCHEMA but the observed behavior matches the doc.
"All" means the dataset, all of the buffers and all of the buffers' fields

Parameters:
phDataset HANDLE
The handle to the Dataset
Top

PUBLIC SetTrackingChanges (handle, logical)

Purpose: Sets the tracking changes property of all temp-tables of the passed
in dataset
Notes: Tables without a valid BEFORE-BUFFER will not be handled. For static
temp-tables this is typically understood as read-only temp-tables
(and the attempt to enable TRACKING-CHANGES would cause a runtime
error). Dynamic temp-tables that have never been set to
TRACKING-CHANGES = TRUE will never have a valid BEFORE-BUFFER. As
such it's expected that dynamic temp-tables that should be updatable
will be set to TRACKING-CHANGES briefly in their factory method.

Parameters:
phDataset HANDLE
The handle to the Dataset
plTrackingChanges LOGICAL
LOGICAL value indicating if tracking changes should be turned on or off
Top

PUBLIC SetTrackingChanges (handle, logical, DynamicTempTablesEnum)

Purpose: Sets the tracking changes property of all temp-tables of the passed
in dataset
Notes: Tables without a valid BEFORE-BUFFER will not be handled. For static
temp-tables this is typically understood as read-only temp-tables
(and the attempt to enable TRACKING-CHANGES would cause a runtime
error). Dynamic temp-tables that have never been set to
TRACKING-CHANGES = TRUE will never have a valid BEFORE-BUFFER.
The poDynamicTempTables parameter allows to indicate how to handle
dynamic temp-tables

Parameters:
phDataset HANDLE
The handle to the Dataset
plTrackingChanges LOGICAL
LOGICAL value indicating if tracking changes should be turned on or off
poDynamicTempTables Consultingwerk.Util.Enum.DynamicTempTablesEnum
The DynamicTempTablesEnum value indicating how to handle dynamic temp-tables
Top

PUBLIC CHARACTER SiblingWhereStringWithValues (handle)

Purpose: Returns the where string matching a DATA-RELATION field pairs for a child buffer
of the FOR EACH for a parent buffer
Notes:

Parameters:
phBuffer HANDLE
The current buffer
Returns CHARACTER
The query string
Top

PUBLIC ThrowDatasetErrors (handle)

Purpose: Throws Dataset Validation error messages from the ERROR-STRING
attributes of any record
Notes: Performs no action, when there is no record with an ERROR-STRING in
the ProDataset
SCL-496
Throws: Consultingwerk.Exceptions.DatasetException

Parameters:
phDataset HANDLE
The handle to the Dataset


Constructor Detail
Top

PROTECTED DatasetHelper ()

Purpose: Protected default constructor.
Notes: There's no need to create instances of the helper classes



©2006-2023 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       15.04.2024 06:16:33