How to update field in contact when i create customer

enoahmedspahic
Member Posts: 25
Hi!This is my first topic and my english is not good!So...help if you know how!
I have expended Contact form with some basic informations about customer (I can create customer here).I can pick template for creating customer but when I create them (it is created fine) i don't know how to update Contact table and also Customer fields on Contact form.
Thanks!
I have expended Contact form with some basic informations about customer (I can create customer here).I can pick template for creating customer but when I create them (it is created fine) i don't know how to update Contact table and also Customer fields on Contact form.
Thanks!
0
Answers
-
See the OnModify trigger of the Customer table. You will see something like:
IF (Name <> xRec.Name) OR ("Search Name" <> xRec."Search Name") OR ("Name 2" <> xRec."Name 2") OR (Address <> xRec.Address) OR ("Address 2" <> xRec."Address 2") OR (City <> xRec.City) OR ("Phone No." <> xRec."Phone No.") OR ("Telex No." <> xRec."Telex No.") OR ("Territory Code" <> xRec."Territory Code") OR ("Currency Code" <> xRec."Currency Code") OR ("Language Code" <> xRec."Language Code") OR ("Salesperson Code" <> xRec."Salesperson Code") OR ("Country Code" <> xRec."Country Code") OR ("Fax No." <> xRec."Fax No.") OR ("Telex Answer Back" <> xRec."Telex Answer Back") OR ("VAT Registration No." <> xRec."VAT Registration No.") OR ("Registration No." <> xRec."Registration No.") OR ("Post Code" <> xRec."Post Code") OR (County <> xRec.County) OR ("E-Mail" <> xRec."E-Mail") OR ("Home Page" <> xRec."Home Page") OR (Contact <> xRec.Contact) THEN BEGIN MODIFY; UpdateContFromCust.OnModify(Rec); END;
I think that this will help you to find correct point and what you need to do to use standard functionality for syncing the Customer with Contact.0 -
When I click on (something like this) Functions->create as->Customer...It create Customer. I was looking on klick of that MENU ITEM (on Contact form) and it start with creating customer. Function is createCustomer and it is in Contact table.It use selected template for creating Customer.
I think...after creating Customer I must initiate some synchronisation between Customer and Contact but I don't know how. Is there any function to force synchronisation....because...afther I create Contact and Customer(using template) and ...when I change some properti on Customer it modify coresponding property on Contact and vice versa. :roll:
Thanks again.0 -
Look at my example I posted. Read It. Try to understand it. It is what you are searching fore. THis is the code, which sync the Customer with the contact each time you change something on the customer...0
-
Thanks for help.I ame close to finish this.I put in Contact table , in function CreateCustomer(CustomerTemplate:Code [10]) this code
....
IF( Cust.MODIFY)THEN BEGIN
UpdateContFromCust.OnModify(Cust);
....
Synchronization work fine fot two fields(it syinchronise them). For :
Cont."Cust. Gen. Bus. Posting Group", and Cont."Customer Posting Group".
In Code unit CustCont-Update is folowing code (OnModify):
....
Cont."Cust. Gen. Bus. Posting Group":=Cust."Gen. Bus. Posting Group";
Cont."Cust. VAT Bus. Posting Group":=Cust."VAT Bus. Posting Group";
Cont."Customer Posting Group":=Cust."Customer Posting Group";
....
I don't know wher is trick.0 -
I appreciate any help!0
-
enoahmedspahic wrote:Thanks for help.I ame close to finish this.I put in Contact table , in function CreateCustomer(CustomerTemplate:Code [10]) this code
....
IF( Cust.MODIFY)THEN BEGIN
UpdateContFromCust.OnModify(Cust);
....
Synchronization work fine fot two fields(it syinchronise them). For :
Cont."Cust. Gen. Bus. Posting Group", and Cont."Customer Posting Group".
In Code unit CustCont-Update is folowing code (OnModify):
....
Cont."Cust. Gen. Bus. Posting Group":=Cust."Gen. Bus. Posting Group";
Cont."Cust. VAT Bus. Posting Group":=Cust."VAT Bus. Posting Group";
Cont."Customer Posting Group":=Cust."Customer Posting Group";
....
I don't know wher is trick.
I do not understand your problem. You need to add your own code there which will copy your new fields from customer to contact. This code is doing it for standard fields. You need to expand it with your own code.0 -
I have expended Contact table with these added fields:
Cont."Cust. Gen. Bus. Posting Group",
Cont."Customer Posting Group",
and they are related to same fields in Customer. When I create Customer from Contact with manual inserting values in that fields in form it create customer fine. In that case all synchronization work fine. Other case is when I create Customer from Contact using template.I resolve that problem with previous Code but it doesn't work for all extended fields. It work only for :
Cont."Cust. Gen. Bus. Posting Group" and Cont."Customer Posting Group".
Field "Cust.Vat .Bus. Posting group" is empty afther creating Customer using template, even synchronization work for other fields.
I will try to to fix that. Thanks!0 -
I find mistake(human error!). I forget one line in function wich create Customer using template.
Thanks KINE!0 -
-
Please write [solved] in your subject, if your problem is finished.
RegardDo you make it right, it works too!0 -
I can't find where!?Can you explain?0
-
it is in the 27th line my friend!!!
it is self explanatory!!!!Thanks & Regards
Santosh
Where Stones can be transformed to Gold0 -
My qvestion vas:"Has this forum some procedure for that or...?",but I find way.....0
-
every problem has its own funda of solutionizing for getting thte result is what makes the problem possible to solve!!!!Thanks & Regards
Santosh
Where Stones can be transformed to Gold0
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