I have a txt file which contains informartion for 2 companies from Navision and I want to imported in one step in both companies (each with his own values) using Validate trriger.
How can I do it? (I've with table.CHANGECOMPANY but when Validate trriger is calles the correlated tables remains on work company)
Cristina
0
Comments
that's not possible.
But perhaps helps this idea:
in the import code check if the information is for the actual company, then insert it else skip the information.
run the import in both companies
br
Josef Metz
Josef Metz
But then again, it won't be released until Fall...
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
When you do a CHANGECOMPANY, you change the company ONLY on the record variable that you call it from. So if you change the company of your record variable and then you validate a field, and in this field there are other record variables, you will run into problems. These other record variables are reading/writing into the current company, because you did not change the company.
The solution is either the previous suggestion (only running the values for the current company, but do this for each company) or...
You can set values without field validation, and if you really need field validation, you copy the code from the field validation into your code, makin sure that you change the company for each record type variable.
hth
RIS Plus, LLC