通过 Rest API 使用 Activity 创建案例 [英] Create Case with Activity through Rest API

查看:45
本文介绍了通过 Rest API 使用 Activity 创建案例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 C# 控制台应用程序将案例从我们的旧票务系统导入 Acumatica.我已经加载了旧票,我正在尝试使用 REST API 创建案例.

I am trying to import cases from our old ticketing system into Acumatica using a C# console application. I have the old tickets loaded, and I am trying to use the REST API to create the cases.

我创建了一个自定义 Web 服务端点来加载案例,但我还想从旧系统中的帖子创建消息活动.如果我使用组织下的案例屏幕,我可以为活动添加一个详细信息实体.但是,似乎没有办法添加活动详细信息字段,这是活动的主体.这是当前端点设置的屏幕截图,显示了我创建的顶级 Case 实体:

I created a custom web service endpoint to load the cases, but I would also like to create message activities from the posts in our old system. If I use the Cases screen under Organization, I can add a Detail entity for activities. However, there does not appear to be a way to add the Activity Details field, which is the body of the activity. Here is a screenshot of the current endpoint setup showing the top-level Case entity I created:

上图显示了 Case 实体,它似乎没有 ActivityDetails 字段.但是,如果我使用隐藏站点地图文件夹中的活动屏幕,则存在活动详细信息.这是我创建的 Activity 实体的屏幕截图,其中包含 ActivityDetails:

The above image shows the Case entity, which does not appear to have the ActivityDetails field. However, if I use the Activity screen from the Hidden site map folder, the ActivityDetails is present. Here is a screenshot of the Activity entity I created, which does have ActivityDetails:

我希望这是有道理的,但我希望 ActivityDetails 字段可从 Cases 顶级实体中使用,以便我可以插入一个完整的案例,包括活动及其详细信息.任何帮助将不胜感激.

I hope this makes sense, but I would like the ActivityDetails field to be available from the Cases top-level entity so I can insert a complete case including activities and their detail. Any help would be greatly appreciated.

谢谢.

推荐答案

这是不可能的行为.

这样做的原因是,当您使用 UI 进入该屏幕时,无法直接从该屏幕添加新的事件、任务或活动.那里的操作按钮仅用于打开其他屏幕,并且已经创建了指向点击操作的案例的链接.

The reason for this is that when you go on that screen using the UI, there is no possibility to add new Event, Task or Activity directly from that screen. The action button that are there only serve as to open the other screens a already create a link to the case from where the action was clicked on.

由于 API 的工作方式是同时处理一个屏幕,因此无法从案例屏幕创建活动.

Since the APIs work by dealing with one screen at the time, it is not possible from the Case screen to create an Activity.

因此,要为案例创建活动,您首先必须创建活动,然后将其链接到案例.

So to create an Activity for a Case, you will first have to create the Activity and then link it to the Case.

为此,您必须首先向 Case 实体和 Activity 实体添加一些字段.这些字段必须手动添加,因为它们不是自动完成的一部分.对于 Case 实体,您需要添加以下字段:

In order to do so, you must first add some field to both the Case entity and the Activity Entity. These fields must be added manually as they are not part of the autocompletion. For the Case entity, you need to add the following field:

Field Name = "NoteID"
Mapped Object = "Case Summary"
Mapped Field = "NoteID"
Field Value = "GuidValue"

在此处输入代码对于活动实体,请添加以下字段:在此处输入代码

enter code here For the Activity entity please add the following field:enter code here

Field Name = "RefNoteID"
Mapped Object = "Activities"
Mapped Field = "RefNoteID"
Field Value = "GuidValue"

添加这两个字段后,您可以开始向案例添加活动.为此:

Once these two fields have been added, you can start adding the activity to the case. In order to do so:

1) 使用 GET 调用检索要在其上添加活动的案例.您将需要使用刚刚添加的 NoteID 字段中的值.

1) Retrieve the Case on which you want to add the activity using A GET call. You will need to use the value from the NoteID field that has just been added.

2) 像往常一样使用 PUT 调用创建 Activity,但不要尝试在 RelatedEntityDescription 字段中添加值,而是将刚刚从 Case 中检索到的 NoteID 值添加到刚刚添加到活动实体.在响应中,您将能够通过检查 RelatedEntityDescription 字段看到活动已链接到案例.

2) Create the Activity like you normally would, using a PUT call, but instead of trying to add a value in the RelatedEntityDescription field, add the NoteID value you just retrieved from the Case to the RefNoteID field you just added to the Activity entity. In the response you will be able to see that the Activity was linked to the case by checking the RelatedEntityDescription field.

这篇关于通过 Rest API 使用 Activity 创建案例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆