ServerAPI.GetNewContactNotification Method
Gets the NotifyOnNewContact property of the LocatableUser object for the user identified by the domain and alias.
Public Function GetNewContactNotification (domainAlias As System.String)
_ As System.Boolean
[C#]
public System.Boolean GetNewContactNotification (System.String domainAlias);
Parameters
- domainAlias
The domain and alias of a user as a string; for example, "domain\user". For information about the maximum length of the domainAlias argument, see MapPoint Location Server Parameter Lengths.
Remarks
For more information about the terms notification and notify on contact, see the Glossary.
Example
[Visual Basic]
'Create a new instance of the ServerAPI class
Dim MyServerAPI As New ServerAPI
Try
'Initialize the database connection for ServerAPI operations
MyServerAPI.Initialize("Your SQL Server Name", "LocationServerDB")
'Now get the Contact Notification flag for the domain alias DOMAIN\user
'True means that the user gets a notification if he/she is added as a contact to somebody else's list
'False means that the user will NOT get a notification if he/she is added as a contact to somebody else's list
Dim newContactNotification As Boolean = MyServerAPI.GetNewContactNotification("DOMAIN\user")
'Use this flag according to your needs
If (newContactNotification) Then
'...
Else
'...
End If
Catch MyException As Exception
'Process your exceptions here
Console.WriteLine(MyException.GetType().Name)
Finally
'Do cleanup
MyServerAPI = Nothing
End Try
[C#]
//Create a new instance of the ServerAPI class
ServerAPI MyServerAPI = new ServerAPI();
try
{
//Initialize the database connection for ServerAPI operations
MyServerAPI.Initialize("Your SQL Server Name", "LocationServerDB");
//Now get the Contact Notification flag for the domain alias DOMAIN\user
//True means that the user gets a notification if he/she is added as a contact to somebody else's list
//False means that the user will NOT get a notification if he/she is added as a contact to somebody else's list
bool newContactNotification = MyServerAPI.GetNewContactNotification(@"DOMAIN\user");
//Use this flag according to your needs
if(newContactNotification)
{
//...
}
else
{
//...
}
}
catch(Exception MyException)
{
//Process your exceptions here
Console.WriteLine(MyException.GetType().Name);
}
finally
{
//Do cleanup
MyServerAPI = null;
}
See Also
LocatableUser Class | Microsoft.MapPoint.LocationServer.Management | ServerAPI Class | ServerAPI Members