Dynamics AX 2012 R3-通过AIF Web服务创建记录 [英] Dynamics AX 2012 R3 - Record Creation through AIF web service

查看:88
本文介绍了Dynamics AX 2012 R3-通过AIF Web服务创建记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用AIF Web服务在Dynamics AX的合同模块中创建唯一主键时遇到问题.我们的合同PK格式为"CON-######",并且contractId绑定到AX中的数字序列.当我调用创建"服务操作时,我为"ContractId"传递了0,而AX并未将其0替换为数字序列中的实际合同ID.

I am having issues using an AIF web service to create a unique primary key in our contract module in Dynamics AX. Our contract PK's are in a format of 'CON-######', and the contractId is tied to a number sequence in AX. When I call the 'Create' service operation, I am passing a 0 for 'ContractId' and AX is not replacing that 0 with an actual contract Id from the number sequence.

AX服务端点被配置为增强端口.是否需要在AX服务终结点上启用设置?在AX端是否存在需要实现的方法替代?

The AX service endpoint is configured as an enhanced port. Is there a setting that needs to be enabled on the AX service endpoint? Is there a method override on the AX side that needs to be implemented?

我有一个名为CC的CallContext类变量,以及一个应该插入新实体的CreateEntityKey []方法.

I have a class CallContext variable named CC, and a CreateEntityKey[] method that should insert a new entity.

private CallContext cc = new CallContext() { Company = "MYCOMPANY", Language = "en-us" };

public EntityKey[] CreateEntityKey(AxdEntity_CLMContractTable axdBtmContractTable) 
{

     EntityKey[] ek = null;

     AxdBtmContractHdr axBtmContractHeader = new AxdBtmContractHdr() 
     { 
          CLMContractTable = new AxdEntity_CLMContractTable[] 
          { 
               axdBtmContractTable 
          } 
      };

      try
      {
          ek = _client.create(cc, axBtmContractHeader);
      }
      catch (Exception e)
      {
          ek = null;
      }

      return ek;
}

推荐答案

据我所知,AIF通常不支持开箱即用的数字序列字段,而仅支持某些实体(例如销售订单).这意味着您必须实现自己的逻辑才能从数字序列创建新数字.看一下AxSalesTable类和方法setSalesId的实现方法.

As far as I know, AIF does not generally support number sequence fields out of the box, but only for some entities (sales orders for example). This means you have to implement your own logic to create a new number from a number sequence. Take a look at class AxSalesTable, method setSalesId on how this is done.

这篇关于Dynamics AX 2012 R3-通过AIF Web服务创建记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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