Номер Статьи: 1080 | Рейтинг: Без рейтинга | Последнее обновление: Mon, Oct 26, 2020 7:35 AM
Для того, чтобы скопировать запись, создайте в текущем шаблоне записи Операцию типа Скрипт и введите следующее выражение:
using System; using System.Collections.Generic; using System.Linq; using Comindware.Data.Entity; using Comindware.TeamNetwork.Api.Data.UserCommands; using Comindware.TeamNetwork.Api.Data;
class Script { public static UserCommandResult Main(UserCommandContext userCommandContext, Comindware.Entities entities) { foreach (var objectId in userCommandContext.ObjectIds) {
Api.TeamNetwork.ObjectService.Clone(objectId,null, true); } var result = new UserCommandResult { Success = true, Commited = true, ResultType = UserCommandResultType.DataChange, Messages = new[] { new UserCommandMessage { Severity = SeverityLevel.Normal, Text = "Запись скопирована" } } };