Using 2 de-dupe fields on a custom object
We have set up a custom object with a one to many relationship with the lead. (Lead can have multiple Invoices). Instead of using a random number generated by the API (InvoiceID) can I use a combination of 2 de-dupe fields (LeadID and DebtorID) to dedupe? Where if the system sees that if the value of these 2 columns ever match that that is a duplicate? In the example below Invoice 1 and 4 would be duplicates. Is this possible? If it is, do I just indicate that both LeadID and DebtorID are both de-dupe fields? Or is something else required?
InvoiceID 1: (LeadID = 1) & (DebtorID = 1) DUPLICATE
InvoiceID 2: (LeadID = 1) & (DebtorID = 2)
InvoiceID 3: (LeadID = 2) & (DebtorID = 1)
InvoiceID 4: (LeadID = 1) & (DebtorID = 1) DUPLICATE