Click or drag to resize

IFindIdFromForeignKey Method

get record id based on foreignkeyvalue - returns 0 if no record is found Get the record id based on foreign key value - returns 0 if no record is found

Namespace:  SuperOffice.COM.SuperOfficeDB
Assembly:  SuperOfficeDB.Interop (in SuperOfficeDB.Interop.dll) Version: 8.0.0.0
Syntax
int IdFromForeignKey(
	string i_App,
	string i_Device,
	string i_Key,
	string i_Value,
	SOTableId i_TableId
)

Parameters

i_App
Type: SystemString
the external application
i_Device
Type: SystemString
the external device
i_Key
Type: SystemString
the name of the key where the value you want is stored
i_Value
Type: SystemString
the value you’re looking for
i_TableId
Type: SuperOffice.COM.SuperOfficeDBSOTableId

Return Value

Type: Int32
Long
Examples

IdFromForeignKey

This text may be copied to the notepad, and saved as a *.vbs file. Remember to change the login information

VB
dim objso, p1, p2
set objso = CreateObject("superofficedb.database")
if objso.login  ("<USERID>", "<password>") = true then
    set p1 = objso.getdocument(2)
    set p2 = objso.getdocument(3)
    p1.foreignkey.set  "mail", "xyz", "alias", "value"
    p1.foreignkey.set "mail",  "tux", "alias", "dummyvalue"
    p2.foreignkey.set  "mail", "tux", "alias", "anotherdummyvalue"
    p2.foreignkey.set  "mail", "xyz", "alias", "yetanotherdummyvalue"

    ' does not affect values set above
    p1.foreignkey.remove  "mail", "xyz", "alias"
    ' removes value from p1, but leaves "dummyvalue" on p1 alone
    p1.foreignkey.remove  "mail", "xyz", "alias"
    ' removes all values from p2, but leaves values on p1 alone
    p2.foreignkey.removeall 
    ' none of the  foreign keys are saved until the model is saved.
    p1.save
    p2.save
    msgbox objso.find.idfromforeignkey  ("mail", "tux", "alias", "dummyvalue", 6)
end if

See Also