Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Answered

How to hide the dimension message.

Posted on by 225
Hi everyone,
 
 Is there any way to hide this message in jobs on Business central. Im updating the header dimension field value via coding while im testing im getting this dimension message. I need to skip this message and the default answer is /Yes/
 
 
 
Thanks in Advance.
Categories:
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 68,395 Super User 2024 Season 2 on at
    How to hide the dimension message.
    Hi, indeed it's a bit troublesome and I'm sorry I didn't fully confirm it.
    You can subscribe to the above event, skip the whole confirmation process, and then modify the dimensions in your code for the lines
    For example,
     
        [EventSubscriber(ObjectType::Table, Database::Job, OnBeforeUpdateJobTaskDimension, '', false, false)]
        local procedure Job_OnBeforeUpdateJobTaskDimension(var Job: Record Job; FieldNumber: Integer; ShortcutDimCode: Code[20]; var IsHandled: Boolean);
        var
            JobTask: Record "Job Task";
        begin
            IsHandled := true;
    
            JobTask.SetRange("Job No.", Job."No.");
            if JobTask.FindSet(true) then
                repeat
                    case FieldNumber of
                        1:
                            JobTask.Validate("Global Dimension 1 Code", ShortcutDimCode);
                        2:
                            JobTask.Validate("Global Dimension 2 Code", ShortcutDimCode);
                    end;
                    JobTask.Modify();
                until JobTask.Next() = 0;
        end;
     
    Hope this helps.
    Thanks
    ZHU
     
  • yoheswaran Profile Picture
    yoheswaran 225 on at
    How to hide the dimension message.
    Thanks for the reply YUN ZHU for Job Card i need the same process i don't have any event in Job Table object. Here the we have the message in "UpdateJobTaskDimQst".
     
  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 68,395 Super User 2024 Season 2 on at
    How to hide the dimension message.
    Hi, generally, you can subscribe to the event before the message to skip the message.
    For example,
     
    Solutions to this type of problem:  https://yzhums.com/43837/
     
    Hope this can give you some hints.
    Thanks.
    ZHU

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,252 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,089 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans