CxFacEditor Methods

The CxFacEditor object contains the following methods:

Configure

The Configure method launches a Facility Attribute Definitions dialog box, which is used to configure facility attributes.

Syntax

Configure() As Integer

Remarks

This method returns one of the following values:

  -1 or 0 An error occurred.
  2 The Close or Save button was pressed.

Example

The following example launches the Service Definitions or Configuration dialog box.

Copy
Configure
Sub

    Dim iRet
    iRet = <SvcEditor>.Configure
    MsgBox iRet

End Sub

Back to top

Connect

The Connect method connects the object to a service.

Syntax

Connect(DomainSiteService As String)

Parameters

Parameter Required Description

DomainSiteService

Yes

The [Domain]Site.Service to which to connect. The domain is optional. The service must be a valid one.

Remarks

Returns 0 if successful and a non-zero value if the connection failed.

Example

The following example connects the Client object to the CYGDEMO.<SVC> on domain 5410:

Copy
Connect
Sub

    Dim FacEditor
    Set FacEditor = CreateObject("CxEditors.CxFacEditor")
    FacEditor.Connect("[5410]CYGDEMO.FAC")

End Sub

Back to top

Copy

The Copy method launches a New Facility dialog box initialized with the information in the specified record. This method accepts either a Facility Tag string or database queue key, eliminating the need to call the Find method to obtain the database queue key from the Facility Tag components.

Syntax

Copy(QueueKey As String) As Integer

Parameters

Parameter Required Description

QueueKey

Yes

The database queue key of the record to copy.

Remarks

This method returns one of the following values:

  -1 or 0 An error occurred.
  1 OK button was pressed.
  2 Cancel button was pressed.

Example

The following example launches a Copy or New dialog box for the record "0000012345."

Copy
Copy
Sub Copy()

    Dim iRet
    iRet = <SvcClient>.Copy("0000012345")
 
    MsgBox iRet

End Sub

Back to top

Delete

The Delete method launches a Delete Facility dialog box initialized with the information in the specified record. This method accepts either a Facility Tag string or database queue key, eliminating the need to call the Find method to obtain the database queue key from the Facility Tag components.

Syntax

Delete(QueueKey As String) As Integer

Parameters

Parameter Required Description

QueueKey

Yes

The database queue key of the record to delete.

Remarks

This method returns one of the following values:

  -1 or 0 An error occurred.
  1 OK button was pressed.
  2 Cancel button was pressed.

Example

The following example launches the specified Delete dialog box for record "0000012345":

Copy
Delete
Sub

    Dim iRet
    iRet = <SvcEditor>.Delete("0000012345")
 
    MsgBox iRet
    
End Sub

Back to top

Disconnect

The Disconnect method disconnects from the connected service.

Syntax

Disconnect() As Integer

Remarks

The Disconnect method returns 0 if successful and a non-zero value if the disconnect failed.

Example

The following example disconnects the Client object from the connected service, and pops a message box if it is unsuccessful:

Copy
Disconnect
Sub Svc.Disconnect()
 
    <SvcClient>.Disconnect()
    MsgBox "Service has disconnected."
    
    If <SvcClient>.Disconnect <> 0 
    Then
        MsgBox "Failed to disconnect."
    End If

End Sub

Back to top

Edit

This method accepts either a Facility Tag string or database queue key, eliminating the need to call the Find method to obtain the database queue key from the Facility Tag components.

The Edit method launches an editor dialog box initialized with the information in the specified record.

Syntax

Edit(QueueKey As String) As Integer

Parameters

Parameter Required Description

QueueKey

Yes

The database queue key of the record to edit.

Remarks

This method returns one of the following values:

  -1 or 0 An error occurred.
  1 OK button was pressed.
  2 Cancel button was pressed.

Example

The following example launches an editor dialog box for the record "0000012345":

Copy
Edit
Sub

    Dim iRet
    
    iRet = <SvcEditor>.Edit("0000012345")
     MsgBox iRet
    
End Sub

Back to top

Find

The Find method returns the database queue key for the specified FacilityId.

Syntax

Find(ByVal Site As String, ByVal Service As String, ByVal FacilityId As String) As String

Parameters

Parameter Required Description

Site

Yes

The Site to which to connect.

Service

Yes

The Service to which to connect.

FacilityId

Yes

The FacilityId for which to retrieve a database queue key.

Remarks

This method returns an error if the FacilityId is not found in the connected FAC.

Example

The following example displays the database queue key for the record with ID "MYRECORD.".

Copy
Find
Sub

    Dim iRet
    iRet= FacEditor.Find("MYRECORD")
    MsgBox iRet

End Sub

Back to top

New

The New method launches a New Facility dialog box.

Syntax

New() As Integer

Remarks

This method returns one of the following values:

  -1 or 0 An error occurred.
  1 OK button was pressed.
  2 Cancel button was pressed.

Example

The following example launches the specified editor dialog box:

Copy
New
Sub

    Dim iRet
    iRet = <SvcEditor>.New
 
    MsgBox iRet
    
End Sub

Back to top

View

The View method launches a dialog box for the specified record. This method accepts either a Facility Tag string or database queue key, eliminating the need to call the Find method to obtain the database queue key from the Facility Tag components.

Syntax

View(Key As String, EditEnabled As Boolean) As Integer

Parameters

Parameter Required Description

Key

Yes

The database key (DbKey) of the record to view/edit.

EditEnabled

Yes

Set this parameter to true to enable editing of a record.

Remarks

This method returns one of the following values:

  -1 or 0 An error occurred.
  1 OK button was pressed.
  2 Cancel button was pressed.

Example

The following example launches the specified editor dialog box for the record "0000012345":

Copy
View
Sub

    Dim iRet
    iRet = <SvcEditor>.View("0000012345", True)
    MsgBox iRet

End Sub

Back to top