원클릭으로
csharp-api
Reference files and patterns for writing C# scripts in Comindware Platform
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Reference files and patterns for writing C# scripts in Comindware Platform
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | csharp_api |
| description | Reference files and patterns for writing C# scripts in Comindware Platform |
Use this skill when answering questions about:
docs/ru/developer_guide/csharp/csharp_guide.md — Full reference for all script types (lines 28-407)
UserCommandResultScriptContextObjectIDdocs/ru/developer_guide/csharp/start_process_by_records.md — Start process for list recordsdocs/ru/developer_guide/csharp/create_entry_transfer_data.md — Create record with data transferdocs/ru/developer_guide/csharp/change_task_status.md — Change status and complete taskdocs/ru/developer_guide/csharp/button_change_variable.md — Modify reusable variabledocs/ru/developer_guide/csharp/example_csharp_object_copy.md — Clone/clone objectdocs/ru/developer_guide/csharp/goto_showcase_record.md — Navigate to recorddocs/ru/developer_guide/csharp/delete_related_record.md — Delete related objectsdocs/ru/developer_guide/csharp/fill_collection_selected_list.md — Fill collection from listdocs/ru/developer_guide/csharp/global_active_directory.md — Active Directory integrationdocs/ru/developer_guide/csharp/start_process_button_for_list_records.md — Start process from buttondocs/ru/developer_guide/csharp/change_all_account_emails.md — Modify all accountsdocs/ru/developer_guide/csharp/clear_link.md — Clear link attributeusing System;
using System.Collections.Generic;
using System.Linq;
using Comindware.Data.Entity;
using Comindware.TeamNetwork.Api.Data.UserCommands;
using Comindware.TeamNetwork.Api.Data;
public class Script
{
public static UserCommandResult Main(UserCommandContext userCommandContext, Comindware.Entities entities)
{
var objectId = userCommandContext.ObjectIds.FirstOrDefault();
// Your logic here
var result = new UserCommandResult
{
Success = true,
Commited = true,
ResultType = UserCommandResultType.DataChange,
Messages = new[]
{
new UserCommandMessage
{
Severity = SeverityLevel.Normal,
Text = "Operation completed"
}
}
};
return result;
}
}
Context properties:
ObjectIds — array of selected record IDs (empty if none selected, or one ID from form)SelectedIds — array of IDs selected in table on formCurrentUserId — current user account IDCurrentRequestTime — datetime of current requestReturn types:
DataChange — refresh dataNotificate — show messageNavigate — go to page (with NavigationResult)File — download file (with File)using System;
using System.Collections.Generic;
using System.Linq;
using Comindware.Data.Entity;
class Script
{
public static void Main(Comindware.Process.Api.Data.ScriptContext context, Comindware.Entities entities)
{
var businessObjectId = context.BusinessObjectId;
var processId = context.ProcessID;
// Your logic here
}
}
Context properties:
ProcessID — process instance IDBusinessObjectID — associated record IDpublic class Script
{
public static string Main(string ObjectID, [Comindware.Entities entities])
{
// Return string, int, decimal, dateTime, bool, TimeSpan or IEnumerable<string>
}
}
var request = Api.TeamNetwork.ObjectService.Get(id);
object value;
request.TryGetValue("op.93", out value); // by attribute ID
var propertyDictionary = new Dictionary<string, object>();
propertyDictionary.Add("AttributeSystemName", value);
Api.TeamNetwork.ObjectService.CreateWithAlias("RecordTemplateAlias", propertyDictionary);
var data = new Dictionary<string, object>
{
{ "AttributeSystemName", newValue }
};
Api.TeamNetwork.ObjectService.EditWithAlias("RecordTemplateAlias", objectId, data);
Api.TeamNetwork.ObjectService.Clone(objectId, null, true);
Api.Process.ProcessObjectService.CreateWithObjectId("pa.2", null, objectId);
var activeTask = Api.Process.ProcessObjectService.GetReferencedTasks(objectId)
.Where(x => x.Status == UserTaskStatus.InProgress)
.FirstOrDefault().Id;
Api.TeamNetwork.UserTaskService.Complete(activeTask, true);
var query = new Comindware.TeamNetwork.Api.Data.DatasetQuery
{
DatasetId = "lst.74"
};
var rows = Api.TeamNetwork.DatasetService.QueryData(query).Rows;
var result = new UserCommandResult
{
Success = true,
ResultType = UserCommandResultType.Navigate,
NavigationResult = new UserCommandNavigationResult
{
ContainerId = "oa.8",
ObjectId = objectId,
Context = ContextType.Record
}
};
var data = new Dictionary<string, object>
{
{ "CollectionAttribute", listOfIds } // List<string>
};
Api.TeamNetwork.ObjectService.EditWithAlias("Template", objectId, data);
var accounts = Api.Base.AccountService.List();
foreach (var account in accounts)
{
account.Mbox = "new@email.com";
Api.Base.AccountService.Edit(account);
}
var value = Api.Solution.SolutionVariableService.GetValue("svar.1");
Api.Solution.SolutionVariableService.SetValue("svar.1", newValue);
Button that starts process for selected records:
foreach (var objectId in userCommandContext.ObjectIds)
{
Api.Process.ProcessObjectService.CreateWithObjectId("pa.2", null, objectId);
}
Button that creates record with data transfer:
var request = Api.TeamNetwork.ObjectService.Get(objectId);
object value;
request.TryGetValue("op.93", out value);
var data = new Dictionary<string, object> { { "Attribute", value } };
Api.TeamNetwork.ObjectService.CreateWithAlias("Template", data);
Process task that fills collection from list:
var query = new DatasetQuery { DatasetId = "lst.53" };
var rows = Api.TeamNetwork.DatasetService.QueryData(query).Rows;
List<string> ids = rows.Select(r => r.Id).ToList();
var data = new Dictionary<string, object> { { "CollectionAttr", ids } };
Api.TeamNetwork.ObjectService.EditWithAlias("Template", context.BusinessObjectId, data);
FirstOrDefault() when processing single object from ObjectIds arrayforeach loop when processing multiple recordsif (sessionsData == null) { return; }op.N format for attributes, pa.N for processes, lst.N for listsUserCommandResult from button scripts, void from process task scripts| Context | Signature | Use when |
|---|---|---|
| Process task | void Main(ScriptContext, Entities) | Unattended data import/sync, scheduled automation, background processing |
| Button | UserCommandResult Main(UserCommandContext, Entities) | User-initiated action on a form or table — needs UI feedback, navigation, or data refresh |
| Scenario | string Main(string ObjectID, [Entities]) | Expression-like calculation, returning a single value to an attribute |
Crawl and sanitize external websites for LLM ingestion. Use when needing to crawl comindware.ru or cmwlab.com, sanitize scraped content, or manage the crawl→sanitize pipeline. Supports --fresh (from scratch) and --resume (checkpoint) workflows.
Use when you've completed a non-trivial task and need to document discoveries, patterns, or gotchas for future sessions. Also use to review the discovery log before starting similar work.
Transcribe meeting recordings with Google Gemini for future documentation work. Use when the user provides a video file and needs a structured Markdown transcript with timestamps, visual notes, and summary in .scratch/.
Use when working on the PHPKB cloning and post-clone migration workflow in this repository: creating a new PHPKB section for a new product version, publishing a new MkDocs article by cloning an adjacent PHPKB article, syncing changed for_kb_import_ru HTML back to PHPKB by kb-id (git diff batch), cloning PHPKB categories or articles, updating cloned PHPKB article/category links, migrating local docs IDs with clone mappings, fixing related topics after cloning, or analyzing/updating scripts in utilities/phpkb_cloning.
Use when writing or answering about N3/Turtle/RDF/Notation3/Triples in Comindware Platform
Use when regenerating or ingesting the Comindware Platform LLM knowledge bundle in this repository: refreshing phpkb_content_rag from PHPKB, running phpkb_import_for_rag.py, running phpkb_ingest.py, or updating the LLM ingestion bundle.