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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Default Dimension update error

(0) ShareShare
ReportReport
Posted on by 6
Hi all, 
 
I'm working on a requirement to create and update records in the jobs and default dimension tables through an API page. I've created the api page, and tested out the insert (POST) method through postman and it successfully inserts the record into jobs table (Job no, description) and default dimension table (sales person) dimension. 
 
However, when I run the PATCH method through postman to update the job no I created above, the jobs table updates fine. But I'm facing an issue with the default dimension table. Instead of updating the records, it deletes the sales person dimension from the default dimension table for that job no. 

Below is the code. Could someone please advise what i'm missing here. 
 
 trigger OnModifyRecord(): Boolean
    var
        Job: Record Job;
    begin
        JobsSetup.Get();
 
        Job.GetBySystemId(Rec.SystemId);
 
        if Rec./No./ = Job./No./ then
            Rec.Modify(true);
 
        ModifyDefaultDimension(Rec./No./, 'salesperson', SalesPerson);
    end;
 
 local procedure ModifyDefaultDimension(JobNo: Code[20]; DimCode: Code[20]; DimValue: Code[20])
    var
        DefaultDimension: Record /Default Dimension/;
    begin
        DefaultDimension.Validate(/Table ID/, Database::Job);
        DefaultDimension.Validate(/No./, JobNo);
        DefaultDimension.Validate(/Dimension Code/, DimCode);
        DefaultDimension.Validate(/Dimension Value Code/, DimValue);
        DefaultDimension.Modify(true);
    end;
 
 
Thank you! 
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    100,214 Super User 2026 Season 1 on at
    Hi, a very simple question. For Job, you used GetBySystemId to get the record, but for Default Dimension, you just used Modify, and you haven't Get or Find it yet. The system doesn't know which record to modify.
     
    Hope this can give you some hints.
    Thanks
    ZHU
  • CU27040908-7 Profile Picture
    6 on at
    Thank you! I'm new to business central. 
     
    I updated the modify logic as below, and as show in the postman output, the system picks up the values for the 3 primary keys with an error messaging saying the DD does not exist. However, when i go to the DD table to find the record, I see the record that i want to modify there. I'm not sure why it says the DD does not exist when it's there. 
     
     
     
    local procedure ModifyDefaultDimension(JobNo: Code[20]; DimCode: Code[20]; DimValue: Code[20])
        var
            DefaultDimension: Record "Default Dimension";
        begin
            if DefaultDimension.Get(Database::Job, JobNo, DimCode) then begin
                DefaultDimension.Validate("Dimension Value Code", DimValue);
                DefaultDimension.Modify(true);
            end;
        end;
    -----------------------------------------------------------------------postman output-------------------------------------------------------------------------------------------------------------------------------
     
    {
        "error": {
            "code": "Internal_RecordNotFound",
            "message": "The Default Dimension does not exist. Identification fields and values: Table ID='167',No.='FINALTEST12',Dimension Code='SALESPERSON'  CorrelationId:  e1db6f71-9183-4556-91ad-7d9407ad4d72."
        }
    }
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,948 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 936 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 616 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans