Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
![]() |
Specifies a method called before a delete operation.
Syntax
[Visual Basic .NET]
Overridable Public Function PreDelete(
ByVal userContext As CalloutUserContext,
ByVal entityContext As CalloutEntityContext,
ByRef errorMessage As String
) As PreCalloutReturnValue
[C#]
public virtual PreCalloutReturnValue PreDelete(
CalloutUserContext userContext,
CalloutEntityContext entityContext,
ref string errorMessage
);
[JScript]
public virtual function PreDelete(
userContext : CalloutUserContext,
entityContext : CalloutEntityContext,
errorMessage : String
) : PreCalloutReturnValue;
Parameters
userContext
Contains information about the user who is performing the delete operation. See CalloutUserContext.
entityContext
Contains information about the entity being deleted. See CalloutEntityContext.
errorMessage
[ref] A string that contains the error message to be returned to the application. The error message string should not exceed 1,500 characters in length.
Return Value
Returns a PreCalloutReturnValue type that specifies what action to take after this method completes.
Example
The following code example shows how to log an object deletion using a pre-callout.
public override PreCalloutReturnValue PreDelete(CalloutUserContext userContext,
CalloutEntityContext entityContext,
ref string errorMessage)
{
TextWriter log = TextWriter.Synchronized(
File.AppendText(@"C:\CRM_SDK_Drop\Delete.txt"));
log.WriteLine("PreDelete");
log.WriteLine("ObjectType: " +
entityContext.EntityTypeCode.ToString());
log.WriteLine("ObjectId: " + entityContext.InstanceId.ToString());
log.WriteLine("CreatorId: " + userContext.UserId.ToString());
log.WriteLine();
log.Close();
return PreCalloutReturnValue.Continue;
}
Requirements
Namespace: Microsoft.Crm.Callout
Assembly: microsoft.crm.platform.callout.base.dll
See Also
Please sign in to use this experience.
Sign in