Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Want to Hide Confirmation message when my data is importing from configuration package

(1) ShareShare
ReportReport
Posted on by 85
Hi Experts,

I am facing issue with configuration package. I have insert GuiAllowed true for case that if someone is changing my Link-with Erp boolean field from Project Page then it shoes the confirm message which is working fine. But if I import bulk data configuration package then it should not ask for confirmation message. So, the problem is that if I import bulk data from configuration package then it shows the confirm message which it should not show. How can I fix it.

P.S: The Link with Erp field is not able to be modified because this field is coming from Dependencies so I can not change it or modify it. Please see the below attachments for verification.


Code: 
Written in Codeunit:
[EventSubscriber(ObjectType::Table, Database::"Job", 'OnAfterValidateEvent', "Link With BuilderMt", true, true)]
    local procedure JobLinkWithErpCheck(var Rec: Record "Job"; var xRec: Record Job)
    var
        JsonString: Text;
        IsSuccessCode: Boolean;
        JobTaskRec: Record "Job Task";
        Cnfrm: Boolean;
    begin
        if Rec."Link With BuilderMT" <> xRec."Link With BuilderMT" then begin
            if GuiAllowed() then begin
                Cnfrm := Confirm('Are you sure you want to change link with the ERP?', false);
            End
            else begin
                Cnfrm := true;
            end;
            if Cnfrm then begin
                if rec."Link With BuilderMT" = true then begin
                    JsonString := JobCodeunit.CreateJobJson(Rec);
                    IsSuccessCode := JobCodeunit.CreateJobInErp(JsonString);
                    if IsSuccessCode = true then begin
                        JobTaskRec.SetRange("Job No.", Rec."No.");
                        if JobTaskRec.FindSet() then begin
                            REPORT.Run(REPORT::"ArmCreateJobTaskInERPRep", false, false, JobTaskRec);
                        end;
                    end;
                end;
            end
            else begin
                Error('');
            end;
        end;
    end;

Configuration Package Behaviour:
 
 
After importing and apply package then it shows this confirmation message which it should not
 
I want it to show message on Project page only where I am Modifying the record.

Please tell me the solution.

Thanks.
  • MA-22070947-0 Profile Picture
    85 on at
    Want to Hide Confirmation message when my data is importing from configuration package
    I'll give it a try. :-)
     
    Thanks.
  • Suggested answer
    YUN ZHU Profile Picture
    84,728 Super User 2025 Season 1 on at
    Want to Hide Confirmation message when my data is importing from configuration package
    Or you can add another field, such as IsConfigurationPackage, with a default value of false.
    Set it to true when importing from Configuration Package, which does not affect the code on the table and can achieve your goal.
     
    Just an idea, hope this helps.
    Thanks.
    ZHU
  • MA-22070947-0 Profile Picture
    85 on at
    Want to Hide Confirmation message when my data is importing from configuration package
    Thanks Zhu and KasparsSemjonovs for your thoughtful answers but removing the field validation won't be a good option cause this field is linked with other processes.
  • Suggested answer
    YUN ZHU Profile Picture
    84,728 Super User 2025 Season 1 on at
    Want to Hide Confirmation message when my data is importing from configuration package
    When you import through the Configuration Package, it is true, not false, because it is also imported from the page (BC UI).
    If you are importing via a Web Service or API, this is false.
    Of course you can skip the OnValidate trigger using the method mentioned by KasparsSemjonovs.
    More detail: Dynamics 365 Business Central: Can we skip/ignore field validation errors?
     
    Hope this helps.
    Thanks.
    ZHU
  • Suggested answer
    KasparsSemjonovs Profile Picture
    4,296 Super User 2025 Season 1 on at
    Want to Hide Confirmation message when my data is importing from configuration package
    Open Fields in Configuration Package for this table.
    Then take out the Validate field checkmark for this field. This way, the validation will be skipped, and the confirmation message will not be shown. (of course it also doesn't do any other validations or filling in other fields if the onModify trigger is doing so, so gotta be carefult when skipping Validations)

  • MA-22070947-0 Profile Picture
    85 on at
    Want to Hide Confirmation message when my data is importing from configuration package
    Hi ZHU,
     
    Thank you for your reply. 
    So the functionality of GuiAllowed did not work on Codeunit? And will it send GUIAllowed false when I am exporting the result by Configuration Package.
     
    Thanks.
  • Suggested answer
    YUN ZHU Profile Picture
    84,728 Super User 2025 Season 1 on at
    Want to Hide Confirmation message when my data is importing from configuration package
    How about writing this control in the trigger of the Project page?
    This will not have any impact on the Configuration Package.
     
    Hope this can give you some hints.
    Thanks.
    ZHU

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 1,452

#2
YUN ZHU Profile Picture

YUN ZHU 1,313 Super User 2025 Season 1

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 1,083 Most Valuable Professional

Featured topics

Product updates

Dynamics 365 release plans