GetFactData(
FactorKey: Integer;
[Options: DictionaryGetDataOptions = 0]
): IRubricatorFactData;
GetFactData(
FactorKey: uinteger;
Options: Prognoz.Platform.Interop.Rds.DictionaryGetDataOptions
): Prognoz.Platform.Interop.Cubes.IRubricatorFactData;
FactorKey. Factor key.
Options. Parameter of getting data. Optional parameter. Default value - DictionaryGetDataOptions.None - getting data for reading.
The GetFactData method returns data of time series dictionary by factor key.
If Options = DictionaryGetDataOptions.Create or Options = DictionaryGetDataOptions.Edit, that is, the data is created or edited, the revision must be created. To create a revision, use the IRubricatorInstance.OpenRevision method.
Executing the example requires a time series database with the TSDB identifier containing the factor with the "1" key.
Add links to the Metabase, Cubes system assemblies.
Sub UserProc;
Var
MB: IMetabase;
RubDesc: IMetabaseObjectDescriptor;
RubrIn: IRubricatorInstance;
FactD: IRubricatorFactData;
Begin
MB := MetabaseClass.Active;
RubDesc := MB.ItemById("TSDB");
RubrIn := RubDesc.Open(Null) As IRubricatorInstance;
FactD := RubrIn.GetFactData(1);
If FactD.IsEdited
Then Debug.WriteLine("The factor is available for editing");
Else Debug.WriteLine("The factor is read-only");
End If;
End Sub UserProc;
After executing the example the console window displays the information whether the factor with the 1 key is available for editing.
Executing the example requires a time series database with the TSDB identifier containing the factor with the "1" key.
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Rds;
…
[STAThread]
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
RubDesc: IMetabaseObjectDescriptor;
RubrIn: IRubricatorInstance;
FactD: IRubricatorFactData;
Begin
MB := Params.Metabase;
RubDesc := MB.ItemById["TSDB"];
RubrIn := RubDesc.Open(Null) As IRubricatorInstance;
FactD := RubrIn.GetFactData(1, DictionaryGetDataOptions.dgdoNone);
If FactD.IsEdited
Then System.Diagnostics.Debug.WriteLine("The factor is available for editing");
Else System.Diagnostics.Debug.WriteLine("The factor is read-only");
End If;
End Sub;
After executing the example the console window displays the information whether the factor with 1 key is available for editing.
See also: