MS CRM 保存 复制为新的(自定义实体)

发布于 2024-07-26 20:27:42 字数 283 浏览 3 评论 0原文

我在 Microsoft CRM (4.0) 中有一个自定义实体。 用户必须输入记录,但通常他们有一批 20 多个记录,除了 2 或 3 个字段需要更改之外,这些记录几乎相同。 我知道我需要编写一些自定义代码才能实现此功能。 但是任何人都可以推荐任何方法来做到这一点。

理想情况下,应该有一个按钮可以保存并创建副本作为新实体。

我当前的想法是将所有详细信息作为 URL 的一部分传递,并使用 javascript 在页面加载事件中将它们删除。 欢迎任何想法。

谢谢 卢克

I have a custom entity in Microsoft CRM (4.0). The user has to input records however usually they have a batch of 20+ records that are almost the same apart from 2 or 3 fields which need changing. I know I need to write some custom code to enable this functionally. However can anyone recommend any methods to do this.

Ideally there should be a button that will save and create a copy as a new entity.

My Current way of thinking is to pass all the details as part of the URL and use javascript to strip them out on the page load event. Any ideas welcome.

Thanks
Luke

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

冷夜 2024-08-02 20:27:42

我在这里找到了答案:

http://mscrm4ever.blogspot。 com/2008/06/cloning-entity-using-javascript.html

我已经使用过它并且看起来效果很好。

I found the answer here:

http://mscrm4ever.blogspot.com/2008/06/cloning-entity-using-javascript.html

I've used it and it appears to work well.

反差帅 2024-08-02 20:27:42

由于有很多字段,但只有某些字段值不同,所以我考虑为所有字段设置默认值,以便用户只需要在需要时更改这些值即可。

在我的方法中,我将在加载表单数据输入屏幕时挂接一个 javascript 函数,并使用 XmlHttp 方法/Ajax 方法挂接到自定义 Web 服务以拉取/检索每个字段的默认值。 或者你可以在 javascript 函数本身设置这些值,但这样做的缺点是以后很难自定义。 因此,我将选择挂钩自定义 Web 服务并从某些应用程序参数实体检索这些值的方法。

您提供“克隆”按钮的想法也是一个好主意,这意味着它将把先前记录的所有属性复制到新记录中,这样就可以节省数据输入人员自定义不同值的时间

< strong>编辑

由于您将以批处理模式输入记录,因此如何自定义 .ASPX 屏幕来输入记录。 通过.ASPX屏幕进行自定义,您可以使用选项卡,以便用户可以通过选项卡浏览,自定义每条记录的值/属性。

将有一个“保存”按钮以及“克隆”按钮来克隆一些常见的属性或值。

Since there are numerous fields, but only certain fields values are different, then i am thinking to set the default value to all the fields, so that users just need to alter those values when needed.

In my approach, i will hook a javascript function on load of the form data entry screen and use XmlHttp approach/Ajax approach to hook to the custom web service to pull/retrieve the default values of each fields. Or you can set those values at the javascript function itself, but the drawback of this, it's difficult to customize later. So i will choose the approach to hook to the custom web service and retrieve those value from some application parameter entity.

Your idea of providing a "clone" button is also a great idea, which means that it will duplicate all the attributes of the previous record, into a new record, so that it will save time for data entry person to customize the different value

EDIT

Since you would enter records in batch mode, how about customizing .ASPX screen to enter records. By customizing through .ASPX screen, you can use a tab , so that users can browse through tabs, to customize the value/attribute of each record.

There will be a "save" button as well as "clone" button to clone some common attribute or value.

放血 2024-08-02 20:27:42

我将创建一个自定义 Web 服务,该服务接受实体类型和我正在克隆的记录的 ID。 您的“保存并克隆”按钮将调用该服务,该服务将处理检索当前记录并决定在新记录上设置哪些字段的详细信息。 该服务创建记录,并将记录的 Guid 发送回您的按钮,然后按钮打开新创建的记录。

这样,您就可以避免在 JavaScript 中设置/获取值的混乱情况,并将要设置/检索的字段直接与 OnLoads 联系起来,并避免查询字符串太长的可能性。

该服务可以很容易地被充分概括,因此您所要做的就是将按钮添加到任何实体,并且假设您设置了服务来处理该特定实体,它就会起作用。

一个可能的缺点是,由于克隆记录按钮实际上会创建记录,因此如果用户决定根本不想克隆记录,他们将被迫删除克隆记录。

I would create a custom web service that would accept the entity type and the ID of the record I'm cloning. Your "Save and Clone" button would call the service, and the service would handle the details of retrieving the current record and deciding which fields to set on the new record. The service creates the record, and sends the Guid of the record back to your button, which then opens up the newly created record.

This way, you avoid the messiness of setting/getting values in JavaScript and tying which fields to set/retrieve directly to your OnLoads, as well as avoiding the possibility of query string that's too long.

The service could easily be sufficiently generalized so that all you'd have to do is add your button to any entity, and it would work, assuming you'd set up your service to handle that particular entity.

One possible downside is that since the clone record button would actually create the record, the user would be forced to delete the cloned record if they decided they didn't want to clone the record after all.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文