Table of Contents

Call DLL from another .NET assembly

You can use the UrlDotNet method to reference a .NET DLL from another .NET assembly. The UrlDotNet method is exposed by the Web class in the Sage.CRM.WebObject namespace.

Example:

string sUrl = UrlDotNet("MyDllFile.dll", "RunViewOpportunity");
AddUrlButton("Cancel", "Cancel.gif", sUrl);

Alternatively, you can use the Dispatch.Redirect method within another .NET DLL.

Example:

Dispatch.Redirect(UrlDotNet("MyDllFile.dll", "RunDataPage"));

In this case, consider the following:

  • The .NET API redirect occurs only when the .NET DLL has finished processing the code. The DLL must provide the HTTP response before being unloaded from memory.

  • Use the Dispatch.Redirect method inside BuildContents only and return it after the redirect is set. Otherwise, the system performance can be seriously impacted.

  • Use only one redirect in your code.