Notifications
Announcements
No record found.
I have a processing group which uses a file which has a column company name.
Is there a way i can validate if the filecompany name == curext() (company name user is logged into) before data is moved from source to staging.
Intent is to not allow data to be moved to staging if the company name of file being imported is not same as the company name user has logged into.
Thanks
Mav
I would start by trying to put such validation in the validateWrite() method of the entity.
I did check my validateWrite() for my entity and wrote info("test") in there, change the procecssing group i.e. checked the box states run business validation , now when i run the dixif import i do not see info test
But that was not your requirement, right? Did you try to implement the validation?
The requirement is same throw error when file company name column has a company name which != curext()
So i followed your suggestion and in order to capture what will file company name column look in runtime i added a test info message & put a debugger so that i can see what is type of file company name column & then replace my file company name column != curext() with that type from debugger.
Hence after adding info test in insert/update & validate write & checking all the boxes of business validation & logic in processing group when i retried the import i was expecting my test info to show in the infolog , however unfortunately nothing got caught in debugger , also tested my debugger & realized that it is working fine.
I think that the process runs asynchronously so it might not write to your infolog or debugger.
But if you develop logic in validateWrite, there's no need to throw error (the standard pattern is return checkFailed("error message")). And the error message can be found in the execution log.
Will use this.company != curext() & see if it works
public boolean validateWrite() { if (this.Company != curext()) { info("Validation failed data not imported"); return false; } return true; }
:-( The above code did not work as i see records inserted in staging table after i import the file using DIxif. Please note the company in file name is not the same as the company from where i am importing so ideally it should have not allowed to insert/update in teh staging table.
Please suggest a fix.
I think the validation happens between staging and target. Would that work for you? Otherwise you need to put your code in validateWrite of staging table. But that's against the standard way how entities, staging and validation works. I recommend sticking to the standard approach.
My validation between staging to target is already working, but i thought why to have unncecessary records in staging itself & hence thought of building a solution which would refrain to insert recs which fail validation at staging itself.
Thx for your guidance.
Hi Mav,
You can't perform this validation on the staging table. The reason is that the import into the staging table is handled by SSIS to get an optimal performance. So, there is no AX logic executed at the stage where the file is being read and records imported in SQL directly.
So, the only option here is indeed from staging to target.
Or create additional logic that the file will be scanned before it will be picked up by the SSIS package.
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 592 Most Valuable Professional
André Arnaud de Cal... 478 Super User 2025 Season 2
BillurSamdancioglu 305 Most Valuable Professional