IsDataSourceAvailable

Note: This page includes content based on the F1 documentation for Centura development. It may be partially converted to support APF development, but should be regarded to be of uncertain actuality. It is provided as is. Eventually, it should be replaced by documentation available from within Visual Studio.

SalBoolean IsDataSourceAvailable( SalString sName )

The IsDataSourceAvailable tells if a data source is available to the user.

Parameters

Name Description
SalString sName Name of the data source object. Typically this is the name of a cFormWindow, cTableWindow, cDialogBox, cUserDataSource, or objects derived from these classes.

Returns

The return value is TRUE if the data source is available, FALSE otherwise.

Comments

A data source is available if:

  1. the view associated with the data source is available or if no view is associated with the data source.
  2. the presentation object (form window, table window or dialog) is available (granted) to the user.

Applications should use the Var.Component.WindowRegister method to associate views with data sources.

To find out if a specific window is available in the application (regardless of whether the associated view is available), applications should use the Var.Component.IsWindowAvailable method.

To find out if a specific window is granted for a user (regardless of whether the associated view is available or if the window is included), applications should use the Var.Security.IsPresObjectAvailable method.

Example

Function: ShowDetails
   Actions
       Select Case nWhat
          Case METHOD_Inquire
              Return Component.IsWindowAvailable( 'frmDetails' )
                 And Security.IsDataSourceAvailable( 'frmDetails' )
          Case METHOD_Execute
              Return SalCreateWindows( 'frmDetails', hWndMDI )
C# code
public SalBoolean DataSourceCreateWindow(SalNumber nWhat, SalString sWindowName)
{
	#region Actions
	switch (nWhat)
	{
		case Const.METHOD_Inquire:
			return Var.Component.IsWindowAvailable(sWindowName) 
&& Var.Security.IsDataSourceAvailable(sWindowName); ...............