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...
Answered

Removing Posting Dates from User setup page

(0) ShareShare
ReportReport
Posted on by 105

Hello All,

Am creating a task scheduler that will run at midnight to remove all posting dates which was assigned to users, I know I have to create a code unit and later to create a job queue to perform a task, can you please help me on code unit part I have tried to do it but am facing some errors

local procedure UpdateUserSetup()
    var
        UseStp: Record "User Setup";
    begin
        UseStp.Reset;
        UseStp.SetRange("Allow FA Posting From", UseStp."Allow Posting From");
        if UseStp.FindSet(true, truethen
            repeat
                if UseStp."Allow Posting From" <> '' then begin
                    UseStp."Allow Posting From" := Format('');
                    UseStp.Modify()
                end;
            until (UseStp.Next() 0)

    end;
thank you for your assistance
I have the same question (0)
  • Suggested answer
    Vaishnavi J Profile Picture
    3,062 on at

    Hi,

    you can write the codeunit logic like this 

    codeunit 50115 UpdatePostingdate
    {
        trigger OnRun()
        begin
            UpdateUserSetup();
        end;

        local procedure UpdateUserSetup()
        var
            UseStp: Record "User Setup";
        begin
            UseStp.Reset();
            UseStp.SetFilter("Allow Posting From", '<>%1', 0D);
            if UseStp.FindSet() then
                repeat
                    UseStp."Allow Posting From" := 0D;
                    UseStp."Allow Posting To" := 0D;
                    UseStp.Modify(true);
                until UseStp.Next() = 0;
        end;
    }
    If my answer was helpful to you, please verify it so that other users know it worked. Thank you very much
  • Maro9595 Profile Picture
    105 on at

    Thank you, Vaishnav it works

  • Suggested answer
    Dallefeld Profile Picture
    211 User Group Leader on at

    Why are you removing this posting date control? This can be super helpful in controlling your accounting dates.

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 3,177

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,467 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,435 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans