find list of field values using another field as the key - poor mans SQL query Example: Find.Field("contact","contact_id","number1", "SUPER") returns the first contact where CODE = 'SUPER'
Perform a "poor mans" SQL query to find list of field values using another field as the key.
Namespace:
SuperOffice.COM.SuperOfficeDB
Assembly:
SuperOfficeDB.Interop (in SuperOfficeDB.Interop.dll) Version: 8.0.0.0
SyntaxObject FirstMatch(
string Table,
string ResultField,
string SearchField,
Object KeyValue
)
Function FirstMatch (
Table As String,
ResultField As String,
SearchField As String,
KeyValue As Object
) As Object
Dim instance As IFind
Dim Table As String
Dim ResultField As String
Dim SearchField As String
Dim KeyValue As Object
Dim returnValue As Object
returnValue = instance.FirstMatch(Table,
ResultField, SearchField, KeyValue)
Object^ FirstMatch(
[InAttribute] String^ Table,
[InAttribute] String^ ResultField,
[InAttribute] String^ SearchField,
[InAttribute] Object^ KeyValue
)
Parameters
- Table
- Type: SystemString
for example Contact - ResultField
- Type: SystemString
for example Contact_id - SearchField
- Type: SystemString
for example Number1 - KeyValue
- Type: SystemObject
for example SUPER
Return Value
Type:
ObjectArray – array of variant
ExamplesFirstMatch
This text may be copied to the notepad, and saved as a *.vbs file. Remember to change the login information.
dim objso
set objso = CreateObject("superofficedb.database")
If not (objSO is nothing) Then
objso.login "<USERID>", "<password>"
searchvalue = "979%"
result = objso.find.firstmatch("contact", "contact_id", "orgnr", searchvalue)
msgbox objso.getcontact(result).name
else
msgbox "could not log in"
end if
set objso = nothing
See Also