Sdílet prostřednictvím


Guidelines

If you are planning to use Visual Studio Tools for Microsoft Dynamics GP to develop an integration for general distribution, we recommend that you limit the references to resources on modified or alternate forms. Because of security settings, a specific user may not have access to the modified or alternate version of a form, possibly causing errors in your integration. If you do distribute an integration which accesses modified or alternate forms, be sure that your code properly handles cases when these resources are not available.

For instance, when you set or retrieve the value of a field, use a try...catch block to enclose the statements. This allows your code to catch any exceptions that are thrown because the field cannot be accessed. The following C# example shows how a field in window for an alternate version of the Vendor Maintenance form can be set within a try...catch block.

// Set the Status local field in the alternate form
try
{
    SampleIntegratingApp.Forms.PmVendorMaintenance.PmVendorMaintenance.LocalStatus.Value = "Preferred";
}
catch (Exception ex)
{
    // The field was not accessible. In this example, display a message.
    MessageBox.Show(ex.Message);
}