web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to validate field name of a file to be imported via Dixif at the time of running source to staging table.

(0) ShareShare
ReportReport
Posted on by

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 have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    I would start by trying to put such validation in the validateWrite() method of the entity.

  • Mav Profile Picture
    on at

    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

  • nmaenpaa Profile Picture
    101,160 Moderator on at

    But that was not your requirement, right? Did you try to implement the validation?

  • Mav Profile Picture
    on at

    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.

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    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.

  • Mav Profile Picture
    on at

    Will use this.company != curext() & see if it works

  • Mav Profile Picture
    on at

    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.

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    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.

  • Mav Profile Picture
    on at

    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.

  • Verified answer
    André Arnaud de Calavon Profile Picture
    301,069 Super User 2025 Season 2 on at

    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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 592 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 478 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 305 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans