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

How to refresh the table of a page?

(0) ShareShare
ReportReport
Posted on by 625

Hi All,

I am quite new Dynamics 365 BC.

I have created a new customization on Sales Quote Creation, that whenever it is created a new Dimcode Value for DimCode = A will be assigned on the dimensions of that sales Quote.

It was working fine for quite some weeks, but today i am facing the issue. As soon after creating the Sales Quote , i got the Dimensions of that sales Quote and my new customization is not showing but when i close and open the dimensions again on that Sales Quote, the customizations are displaying as intended too. 

I believe it is some cache refresh issue. I believe i have refresh the SalesHeader table.

Can anybody help me how i can i achieve this?

Thanks in Advance!

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    I think the implementation is not good, but it's difficult to help without seeing the code.

  • AXBOY Profile Picture
    625 on at

    Here :

    tableextension 50001 WfsSalesHeaderExt extends "Sales Header"

    {

       trigger OnAfterInsert()

       var

           NewProjectCode: Code[20];

           DimCode: Code[20];

           SalesHeader: Record "Sales Header";

           DimensionValue_Old: Record "Dimension Value";

           DimensionValue_New: Record "Dimension Value";

           DimVal: Record "Dimension Value";

           DimSetEntry: Record "Dimension Set Entry";

           DimSetEntryTmp: Record "Dimension Set Entry" temporary;

           DImMgt: Codeunit DimensionManagement;

       begin

           Clear(SalesHeader);

           // Find the last Dimension Value for the Dimension Code = Project & increment the value by 1.

           DimensionValue_Old.SetFilter("Dimension Code", '=Project');

           DimensionValue_Old.FindLast();

           NewProjectCode := IncStr(DimensionValue_Old.Code);

           //Add the incremented Dimension Value to the Master Table

           DimensionValue_New.Init();

           DimensionValue_New."Dimension Code" := DimensionValue_Old."Dimension Code";

           DimensionValue_New.Code := NewProjectCode;

           DimensionValue_New.Name := NewProjectCode;

           DimensionValue_New."Dimension Value Type" := DimensionValue_Old."Dimension Value Type";

           DimensionValue_New.Insert();

           SalesHeader.SetFilter("Document Type", '=Quote');

           SalesHeader.FindLast();

           if SalesHeader."Dimension Set ID" = 0 then begin

               DimSetEntryTmp.DeleteAll();

               //Insert the incremented Dimension Value into a temporary Dimension Set Entry table.

               DimVal.Get(DimensionValue_New."Dimension Code", NewProjectCode);

               DimSetEntryTmp.Init();

               DimSetEntryTmp.Validate("Dimension Code", DimensionValue_New."Dimension Code");

               DimSetEntryTmp.Validate("Dimension Value Code", NewProjectCode);

               DimSetEntryTmp."Dimension Value ID" := DimVal."Dimension Value ID";

               DimSetEntryTmp.Insert();

               // Get Dimension Set ID of the recently added dimension by calling function GetDimensionSetID of CU 408,

               //Use the above mentioned temporary Dimension Set Entry table as parameter.

               //Finally update this Dimension Set ID with that of the last entered Sales Quote.

               SalesHeader."Dimension Set ID" := DImMgt.GetDimensionSetID(DimSetEntryTmp);

               SalesHeader.Modify();

           end

           else begin

               Clear(DimSetEntry);

               DimSetEntryTmp.DeleteAll();

               DimSetEntry.SetRange("Dimension Set ID", SalesHeader."Dimension Set ID");

               DimCode := 'Project';

               if (DimSetEntry.FindFirst()) then begin

                   repeat

                       if (DimSetEntry."Dimension Code" <> DimCode) then begin

                           DimSetEntryTmp.Init();

                           DimSetEntryTmp.Validate("Dimension Code", DimSetEntry."Dimension Code");

                           DimSetEntryTmp.Validate("Dimension Value Code", DimSetEntry."Dimension Value Code");

                           DimSetEntryTmp."Dimension Value ID" := DimSetEntry."Dimension Value ID";

                           DimSetEntryTmp.Insert();

                       end;

                   until DimSetEntry.Next = 0;

               end;

               //Insert the incremented Dimension Value into a temporary Dimension Set Entry table.

               DimVal.Get(DimensionValue_New."Dimension Code", NewProjectCode);

               DimSetEntryTmp.Init();

               DimSetEntryTmp.Validate("Dimension Code", DimensionValue_New."Dimension Code");

               DimSetEntryTmp.Validate("Dimension Value Code", NewProjectCode);

               DimSetEntryTmp."Dimension Value ID" := DimVal."Dimension Value ID";

               DimSetEntryTmp.Insert();

               // Get Dimension Set ID of the recently added dimension by calling function GetDimensionSetID of CU 408,

               //Use the above mentioned temporary Dimension Set Entry table as parameter.

               //Finally update this Dimension Set ID with that of the last entered Sales Quote.

               SalesHeader."Dimension Set ID" := DImMgt.GetDimensionSetID(DimSetEntryTmp);

               SalesHeader.Modify();

           end;

       end;

    end;

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 748 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 354 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 351 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans