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 :
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.
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    95,763 Super User 2025 Season 2 on at
    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
  • MA-22070947-0 Profile Picture
    85 on at
    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
    KasparsSemjonovs Profile Picture
    4,782 Super User 2025 Season 2 on at
    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)

  • Suggested answer
    YUN ZHU Profile Picture
    95,763 Super User 2025 Season 2 on at
    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
  • MA-22070947-0 Profile Picture
    85 on at
    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
    95,763 Super User 2025 Season 2 on at
    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
    I'll give it a try. :-)
     
    Thanks.

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,116

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 764 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 635 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans