AIF Service Issue with Create Service Operation.

I have a table in AX, CLMContractTable. The primary key to this table is ContractId. ContractId is tied to a number sequence in AX. When my C# .Net integration consumes the AX service endpoint and calls the create service operation, a 0 is being passed to ContractId (as ContractId is a required element). Instead of using 0 for the ContractId, I need AX to assign the ContractId based on the AX number sequence and return the ContractId.

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?

Thanks in advance……

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

We figured this out. Pass a sentinel value and get in the middle of the prepareforsaveextended method on the AxD class.

Also note that you configure the Axd class not to require ContractId at all (with setParmMethodAsNotMandatory()).