Hi @Wilnaweb1,
You're running into this error because the @ID field in your schema (sam:ape_controlStg) is set to auto-generate as a UUID:
<attribute name="id" type="uuid" autopk="true" autouuid="true" ... />
This means Adobe Campaign Classic automatically handles the primary key (@id) when new records are inserted, and it doesn't allow you to manually assign a value — even if you're trying to update an existing record.
What's causing the issue:
In your IngestExt() call, you're doing something like this:
var xmlStagingSampleTable = <ape_controlStg _key="@id"
id="MyID" // manually setting an auto-generated ID
process_status="NOT_PROCESS"
xtkschema="sam:ape_controlStg" />;
strUuid = xtk.session.IngestExt(xmlStagingSampleTable);
Because you're passing a manual @ID, Campaign treats it as a new insert rather than an update, which causes the error.
How to fix it:
If you're trying to update an existing record, it's better to use xtk.session.Write() instead:
var xml = <ape_controlStg xtkschema="sam:ape_controlStg"
id="EXISTING_UUID"
process_status="OK" />;
xtk.session.Write(xml);
This tells Campaign to update the record with the provided @ID.
Hope this helps!
Thanks,