How to copy entire entity form ?

If you have several forms for entity, and you need to create new form based on previously created form there are two options:

  • open form customization window and SaveAs
  • simple copy form request can be used instead of inserting fields ony by one
using Microsoft.Crm.Sdk.Messages;

var stageAdapter = new CRMServiceAdapter("SERVER_NAME", "Stage");
var organizationService = stageAdapter.Proxy;

var formId = new Guid("FC4D659C-B2E6-491D-8823-BF5FB57EB739");
var copyRequest = new CopySystemFormRequest
    {
        SourceId = formId,
    };

var copyResponse = (CopySystemFormResponse)organizationService.Execute(copyRequest);

Copied form contains all customizations and javascripts. Copy is related with the same entity as original with name: originalName with number postfix

Have an own opinion?