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.
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?
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;
}