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
navvy
Freelance Developer
0
Comments
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.....
Freelance Developer
You could add a new field to overcome this.
Freelance Dynamics AX
Blog : http://axnmaia.wordpress.com/
I can't add a new field to NAV, because the CAL Function (Codeunit) will be installed on different (long-existing) NAV-installations ](*,)
Freelance Developer
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 ?
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
> yes, I want to make a "simple" query, I cannot make any changes to the existing NAV-Installations.
>"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....
> that's not an option, see above.
Freelance Developer
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 helps
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
Freelance Dynamics AX
Blog : http://axnmaia.wordpress.com/
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 #-o
I must be blind, I can't see this field: screenshot
Freelance Developer
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.
Freelance Dynamics AX
Blog : http://axnmaia.wordpress.com/
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)
At the moment, that's not an option....
Freelance Developer
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.
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
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...
Freelance Developer
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 helps
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
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:
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.
Freelance Developer
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.
RIS Plus, LLC
Sorry, I've mixed CAL with C#/LINQ..... ](*,)
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 customer
Freelance Developer
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 standard
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
Thanks for your help. I will now write a test. After that I come back here....
navvy
Freelance Developer