ICustomers

class ICustomers

Bases: ImpactCOMWrapperBase, Iterable

Description:

A collection of ICustomer objects.

Wraps a COM object or another wrapper instance. Accepts: - A valid impact_object - An existing impact_com_wrapper_base-derived instance

property can_search_case_sensitive

Gets can_search_case_sensitive.

Description:

Gets if customers can be searched for with case-sensitivity.

Remarks:

If the customers are on an external database, this option may differ from that of the main database connection.

Returns:

The value of can_search_case_sensitive.

Return type:

can_search_case_sensitive (bool)

property count

Gets Count.

Description:

The number of items in this collection.

Returns:

The value of Count.

Return type:

count (int)

property inactive_row_context

Gets inactive_row_context.

Description:

Determines whether to count active and/or inactive items.

Remarks:

Introduced in Impact 11.0.0.80

Returns:

The value of inactive_row_context.

Return type:

inactive_row_context (ipInactiveRowContext)

add(code, name)
Description:

Adds a customer to the database using the specified code and name.

Remarks:

If a customer with the specified code exists, no customer is added and this method returns NULL. To add a customer that is flagged as inactive, use the Add2 method.

Returns:

The new customer.

Parameters:
  • code (str) – Specifies the code of the new customer.

  • name (str) – Specifies the name of the new customer.

add2(code, name, active)
Description:

Adds a customer to the database using the specified code and name.

Remarks:

Inactive customers are hidden from some parts of the Impact interface; for example when assigning a project to a customer. If a customer with the specified code exists, no customer is added and this method returns NULL.

Returns:

The new customer.

Parameters:
  • code (str) – Specifies the code of the new customer.

  • name (str) – Specifies the name of the new customer.

  • active (bool) – Specifies whether or not the customer is marked as active.

column_has_case_sensitive_index(column_name)
Description:

Does the specified column in the customers table have a case-sensitive index.

Parameters:

column_name (str) – The unqualified name of the column to test.

count_by_conditions(s_q_l_filter_conditions)
Description:

Counts the customers using the given filter conditions.

Parameters:

sql_filter_conditions (any) – The conditions by which to filter the customers.

count_by_sql(s_q_l)
Description:

Returns the number of items which would be returned by using the specified SQL in the find_by_sql method.

Parameters:

sql (str) – Specifies the sql to execute to find the customers.

find_by_code(code)
Description:

Finds a customer with the specified code.

Remarks:

If no customer is found this method returns NULL.

Parameters:

code (str) – Specifies the code of the customer to find.

find_by_conditions(s_q_l_filter_conditions, max_records)
Description:

Finds the customers using the given filter conditions.

Parameters:
  • sql_filter_conditions (any) – The conditions by which to filter the customers.

  • max_records (int) – The maximum number of customers to return. The result set will be capped to this value if it is exceeded.

find_by_key(key)
Description:

Finds a customer with a specified key.

Parameters:

key (int) – Specifies the key of the customer to find.

find_by_name(name)
Description:

Finds a customer with the specified name.

Remarks:

If no customer is found this method returns NULL.

Parameters:

name (str) – Specifies the name of the customer to find.

find_by_sql(s_q_l, max_records)
Description:

Finds a customer using the specified SQL.

Parameters:
  • sql (str) – Defines the SQL to use. If you wish to search by name or code you can use the substitution “%1” to represent the code field (by default CS_CODE) or “%2” to represent the name field (by default CS_NAME). Using the substitutions is particularly useful if your database uses an external customers table. A typical value for this parameter would be “CS_NAME like ‘Arden%’”.

  • max_records (int) – Specifies the maximum number of records to return.

item(index)
Description:

Gets an ICustomer object from this collection with the specified index or customer code.

Remarks:

If a string is passed as the method parameter ‘Index’ this method is analagous to using the ‘find_by_name’ method.

Parameters:

index (any) – Specifies the index or code of the customer to get.

refresh()
Description:

Refresh the ICustomers collection from the database.