Hi,
Ref: APEX 4.2.4.00.08
I have jQuery code to grab data from a Report (based on a read-only view) and send them to an on-demand process which then add data into an APEX Collection. Adding one Report row at a time is no problem but when add multiple records I run into this error:
unique constraint (APEX_040200.WWV_FLOW_COLLECTION_MEMBERS_PK) violated
I am not sure why this happens.
I am using APEX JAVASCRIPT API to send data to the on-demand process.
var f01Arr = new Array();
f01Arr.push("VAL1");
f01Arr.push("VAL2");
apex.server.process(
serverProcessName,
{
x01: 1,
x02: 2,
..
..
x07: 'some text',
f01: f01Arr
},
{
dataType: "text",
success: function(pData) {
console.log("Result: "+pData);
}
});
APEX_COLLECTION.ADD_MEMBER (
p_collection_name => p_collection_name,
p_c001 => p_1,
p_c002 => p_2,
p_c003 => p_3,
...
...
--p_generate_md5 => 'YES' );
NOTE: this error does not happen all the time but most of the time
I suspect it is to do with the timing.
Is it possible to make apex.server.process synchronous?
Has anyone come across this issue? Please advise how to avoid it
Thanks & regards