409 Conflict Issue

Hi,

I New to insert value of one doctype to another doctype while submitting.

Below is my code snippet

   frappe.call({
        "method": "frappe.client.insert",
        "args": {
          "doc": 
          {
           "doctype":"Destination Advance",
           "transaction_date":doc.mode_of_payment,
           "destination":doc.destination,
           "debit":ex_amount,
           "reference":doc.name
         }
       }
    });

With this. I’m getting 409 Conflict.

How to Solve it. Please help me out.

TIA.

“doc”:

These fields are from first doctype which was inserted
doc.destination,
doc.mode_of_payment
doc.name

Again “doc”: is refered,

(two doc variables are same, get the values before sending)