Deleting Customers (Python)¶
Deleting Customers (Python)¶
1customers = impact.active_database.customers
2
3impact.gui.output_toolbox.clear()
4impact.gui.output_toolbox.add("customer Count: " + str(customers.count))
5customer = None
6try:
7 customer = customers.add("COMTEST", "COM Test customer")
8except Exception as exc:
9 impact.gui.output_toolbox.add(f"Failed to create object via customers.add(): {exc}")
10
11if customer.isNone():
12 impact.gui.output_toolbox.add("Error: Unable to add a new customer")
13else:
14 impact.gui.output_toolbox.add("Successfully added new customer '" + customer.name + "'")
15
16 if customer.delete():
17 impact.gui.output_toolbox.add("Successfully deleted customer")
18 else:
19 impact.gui.output_toolbox.add("Error: Unable to delete customer")