How to determine the "real" type of a customer ?

navvy
Member Posts: 79
Hi All,
As I understand, in a standard installation of NAV the contact of a customer must always be defined as Type "Company", that's clear.
Now I'm trying to find a way, to determine the "real" type of a customer. That means, I want figure out, if the customer is an individual person (i.e."Bill Gates") or a company (i.e. "Microsoft Corp.").
The only solution I found yet, is to go to the contact and check the "Salutation Code", but there must be a better way. That query will be done in a codeunit.
I would be very thankful if I could get as many suggestions.
Thanks and regards
As I understand, in a standard installation of NAV the contact of a customer must always be defined as Type "Company", that's clear.
Now I'm trying to find a way, to determine the "real" type of a customer. That means, I want figure out, if the customer is an individual person (i.e."Bill Gates") or a company (i.e. "Microsoft Corp.").
The only solution I found yet, is to go to the contact and check the "Salutation Code", but there must be a better way. That query will be done in a codeunit.
I would be very thankful if I could get as many suggestions.
Thanks and regards
navvy
Freelance Developer
Freelance Developer
0
Comments
-
Under each "company" contact you can create multiple "person" contacts.0
-
apertierra wrote:Under each "company" contact you can create multiple "person" contacts.
Thanks apertierra for your answer, but that makes no sense if the customer is a individual person (who doesn't work for a company).
Example: I want to make a new order for a new customer. The customer is a person (i.e. "Bill Gates"). So I go to "Contact" and create a new "company" contact for the person. In the next step I use the function "Create as" -> "Customer" (this function is only available, if the contact is defined as Type "Company")
I think, if a CAL function wants to determine the "real type" of a customer, it must check the "Salutation Code" of his contact.....navvy
Freelance Developer0 -
navvy wrote:apertierra wrote:Under each "company" contact you can create multiple "person" contacts.
Thanks apertierra for your answer, but that makes no sense if the customer is a individual person (who doesn't work for a company).
Example: I want to make a new order for a new customer. The customer is a person (i.e. "Bill Gates"). So I go to "Contact" and create a new "company" contact for the person. In the next step I use the function "Create as" -> "Customer" (this function is only available, if the contact is defined as Type "Company")
I think, if a CAL function wants to determine the "real type" of a customer, it must check the "Salutation Code" of his contact.....
You could add a new field to overcome this.0 -
Hi Navvy,
Without adding a field then you are restricted to using a standard field
The two that come to mind is the Industry Group code from the Company type contacts or Type of supply on the customer card.
If these are not an option then have you considered using a dimension for this ?0 -
DaveT, thanks for your answers.DaveT wrote:Hi Navvy,
Without adding a field then you are restricted to using a standard field
> yes, I want to make a "simple" query, I cannot make any changes to the existing NAV-Installations.DaveT wrote:The two that come to mind is the Industry Group code from the Company type contacts or Type of supply on the customer card.
>"Industry Group code": Good idee, but, I don't think that many NAV-customers use this field (correctly)
> "type contacts": Do you mean the field "Copy Sell-to Addr. to Qte From" on the tab "Invoicing" ? That can be the solution!I have to check this out...
> "Type of supply": Unfortunately I can't find this field on the customer card....DaveT wrote:If these are not an option then have you considered using a dimension for this ?
> that's not an option, see above.navvy
Freelance Developer0 -
Hi Navvy,navvy wrote:"type contacts": Do you mean the field "Copy Sell-to Addr. to Qte From" on the tab "Invoicing" ? That can be the solution!
I have to check this out...
I just meant that industry group is only for "Customer" (type) contacts
The type of supply should be on the invoicing tab on the customer card (V5 & V4) and I'm not sure what it's used for but may suit you to use it.
Hope this helps0 -
Using other fields to identity customer type can be tricky. For example if customer change settings it could lead to an error. I don’t exactly what you mean by an old version and you can’t add fields.0
-
nunomaia wrote:Using other fields to identity customer type can be tricky. For example if customer change settings it could lead to an error. I don’t exactly what you mean by an old version and you can’t add fields.
ok, it's hard to explain this but I will do my best...
I am building a connector (NAV Add-on) for the open-source shop-system osCommerce. This shop makes a clear difference between person- and company-customers (i.e. different table-fields on DB)
It should now be possible, that a user can "mark" a customer in NAV for "open this customer in the Shop". The connector will then export this customers to the shop (and send them a password for login). For this process, the connector (only a special codeunit) have to determine the "real" type of a customer.
Important is, that the integration of this Add-on is without impact on an existing NAV-installation (i.e. it should not be necessary to make any changes on existing customer data when installing the connector).
I think I have to use different standard fields to identify the customer type #-oDaveT wrote:The type of supply should be on the invoicing tab
I must be blind, I can't see this field: screenshotnavvy
Freelance Developer0 -
Well, I have build a few NAV connectors (Web Services, SQL, etc) and most of them add some kind of field or code change. It’s impossible to avoid such restrictions.
I have seem add-on larger than Navision and it makes changes every in many places.
If you don’t want to change customer table. You could add a new table that related customer No. and your classifications. In that way users can change every parameter without affecting your connector.0 -
nunomaia wrote:Well, I have build a few NAV connectors (Web Services, SQL, etc) and most of them add some kind of field or code change. It’s impossible to avoid such restrictions.
I have seem add-on larger than Navision and it makes changes every in many places.
It's hard but I think it's not impossible in my case. The connector is written in C# . At the moment, my connector can do many things (i.e. import new orders, export articles, import new contacts / customers) without the need of make any changes to a NAV installation (and only a new codeunit must be licensed)nunomaia wrote:If you don’t want to change customer table. You could add a new table that related customer No. and your classifications. In that way users can change every parameter without affecting your connector.
At the moment, that's not an option....navvy
Freelance Developer0 -
Hi Navvy,
The field "Type of supply" must be a localised field -> it's field 10500 on the customer table on IE/GB version (Also W1 I think)
Another suggestion is to modify codeunit 5056 CustCont-Update and have different business relation codes for the different contact type.0 -
DaveT wrote:Hi Navvy,
The field "Type of supply" must be a localised field -> it's field 10500 on the customer table on IE/GB version (Also W1 I think)
Another suggestion is to modify codeunit 5056 CustCont-Update and have different business relation codes for the different contact type.
Hi DaveT,
Thanks for this information. Change the codeunit 5056 CustCont would be an option, but it should not be required to make any changes of a NAV installation.
Question: Is it possible in CAL, to test if a field exist in a table ? i.e. I want to use the field "Type of supply" if it exists...navvy
Freelance Developer0 -
Hi Navvy,
There is the system table 2000000041 Field which has all the table fields in it. I have seen a post (and tried it out) where you can add a record in this table and it adds the field to the corresponding table. It worked for me but I'm not sure how robust it is for commerical use (worth a try) - also you cannot set any properties except type, length and table relation.
Hope this helps0 -
This table would be great, but in my NAV (German / SQL) there is no table "2000000041"....
Last question:
I've defined the new field "Nickname" in table "customer". When I use this field in a codeunit (in the NAV where this field is defined) it's working, but if I run the codeunit on another NAV (where the field "Nickname" doesn't exist) the following error occured:Reference to the member Nickname of the variable could not be solved.
In PHP I use the function isset() and in C# I use try/catch to see if a variable exists. Is there a way in CAL, to check if a variable (like Nickname) exists and use them?
All suggestions are welcome.navvy
Freelance Developer0 -
The German version does have that table, you just don't know where to find it. It is what is called a "Virtual Table", and you can find it in the variable list for Record type variables, and it is also available to select as source table for forms.
When something is a field in a table, it is not called a variable. When accessing the table directly there is no way to see if there is a field called 'whatever', but you can use the field table, and you can also probably use RecRef functionality, although I'm not sure if that will work.0 -
Thanks a lot DenSter for the info. "Virtual Table"... ok, I think I have to read the manual (Chapter 8 - Special C/SIDE Tables
)
When something is a field in a table, it is not called a variable.....
Very last question: Is there a way to insert data in fields "defined" dynamically by text-variables ?
Example:
fieldName := 'Nickname'; //the name of the table-field
fieldValue := 'Mike'; //the value of the table-field
customer.fieldName := fieldValue; //should insert 'Mike' to the field 'Nickname' in table customernavvy
Freelance Developer0 -
Hi Navvy,
I have not done this in practice but the Recref as Danial suggested should work. Look at the codeunit 8611 Migration Management to see how it's handle as standard0 -
Hi DaveT,
Thanks for your help. I will now write a test. After that I come back here....
navvynavvy
Freelance Developer0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions