"Represents Company Must be Unique

I can’t create a New Customer. When I enter basic information (customer name, customer group, type and territory. Everything else is blank) I get the following error message “Represents Company must be unique”.

I’ve created over 500 Customers and never had an issue. Has anyone else had this problem.

Thanks
Joe

1 Like

I believe some info about the version u are using may be helpful

1 Like

Thank you
Installed Apps
ERPNext: v11.1.13 (master)
Frappe Framework: v11.1.13 (master)

1 Like

the same for me:

Yes I now have the same problem. ERPNext: v11.1.10

Chris
It appears to be something to do with “Is internal customer”.
There is a new field in there when you check it “represents company”
Edited doctype customer so “represents customer” id no longer unique. now works OK.

1 Like

so should that be reported as a bug on github?

so now, as we have figured out after quite a while where it should have been part of the initial post, it is clear that this happens for “internal customers” I’d say … this is how it is designed, and completely makes sense.

Unless anybody gives me a good reason why there should be more then 1 internal Customer representing your own “Company A” towards your other own “Company B”.

i’m not sure if i get you right. do you mean it’s not a bug, it’s a feature?

because the internal customer field is not checked in my case and i still receivce this message. can you explain why that should be designed in?

ok, that is a bug. I didn’t catch the “is internal customer” being unchecked part


seems you guys are pretty new to ERPNext, so this guide on how to post an issue on github may be worth a read

3 Likes

Yes it definitely come up when internal customer is Unchecked.

The work around I did was create internal customer then update to remove internal customer. Not ideal but it worked.

This is definitely a bug.

2 Likes

thanks for the analysis. then it should be reported. are you going to open an issue for that?

I have a very similar issue. I create customers programmatically. Even if I set ‘is_internal_customer’ to 0 and ‘represents_company’ to “” or None, the created customer - calling frappe.get_doc({dictionary of values}) - has a represents_company value set to the only Company that we have set up. The workaround is to immediately set:
frappe.db.set_value(‘Customer’, docname, ‘represents_company’, None)
after creating the Customer. Setting it to “” causes the same problem (the next Customer has a non-unique represents_company of “”, with MySQL and MariaDB treating NULL as a special case for UNIQUE I think).

Tried your work around, but it doesn’t work for me, I get the same error whether I try to create an internal customer or not…

Anyone else found a workaround ? This is clearly annoying and needs to be solved pretty fast…

Problem resolved: I had another look at my privileges. Click in your User Name top righthand side of screen > My Settings > Check Customer box.

1 Like

That’s right. It’s empty.