Notifications
Announcements
No record found.
Have two table.
One standart Ax table, other one is dublicate (Test, CopyOfTest);
Declaring variables
Test test;
CopyOfTest cTest;
Do something like this will work?
test = cTest; ???
*This post is locked for comments
No, it won't. Test and CopyOfTest are two different types, therefore such as assignment isn't valid.
What are your trying to achieve?
i have while select loop. This is standart ax code, so i want to use other table with the same structure in current while select. Just use same variable with other type but same structure.
Hi Skribl,
while select tableA{ tableB.clear(); tableB.RollNo = tableA.Id; tableB.insert();}
This way i will change standart code. I should avoid this. I will use pre event handler.
Why would you have two tables with the same structure?
second one is for stagging. Imported data from excel.
In case if there is record in stagging table i use this.record otherwise from standart table.
It still sounds suspicious to me... Duplicity is usually a bad thing, because all changes will have to be done at two places.
But anyway, if you want to initialize fields from a different table, create an initFrom*() method and assign fields as needed. Then you'll call the method and pass a buffer of the other table there. You can look at AgreementLineHistory.initFromAgreementLine(), for example.
Or if you want generic code that can work with instances of both tables, you can create a table map and map all fields there. Then you can use the map in your code, instead of concrete tables. But I would again question the design before doing that.
Hi,
Did you get this issue fixed in the meantime?
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2