Skip to main content

Posts

Showing posts from June, 2021

Calculate First Date & Last Date of a Month: Using CalcDate

Hi Guys, In this article we will see how we can Calculate first and last date of a month from any date. Code:-              action( "Calculate Date" )             {                 ApplicationArea = All;                  trigger  OnAction ()                  var                     FirstDate:  Date ;                     LastDate:  Date ;                  begin                     FirstDate  :=  CalcDate ( '-CM' , Today ) ;                     LastDate  :=  CalcDate ( 'CM' , Today ) ;                     Message ( 'First Date >> '  + Format ( FirstDate )  +                      '\'  +  'Last Date >> '  + Format ( LastDate )) ;                  end ;             } Output :-  On a click of  Calculate Date action button, output will be :- Note:- You can replace Today with any date as per the requirement. Thanks!! I hope this will help you :)

Run Page/Report with Default Filters : Using SetTableView

 Hi Readers, In this article we will see how we can Run a Page with some default filters by using SetTableView function in Navision / Business Central. Basically, SetTableView applies the table view on the current record as the table view for the page, report or XMLport. In this example, will see how we can Run "Customer List" Page with bydefault filters:  Location Code = " Yellow " & Country/Region Code = " US " Here, we have define 2 local variables one for page that we want to run and other is record variable which is the source table of the running page: pageextension   50100  "Company Info Ext"  extends  "Company Information" {      actions     {          addlast( Navigation )         {              action( "SetTableView" )             {                 ApplicationArea = All;                  trigger  OnAction ()                  var                     Customer_Rec:  Record  Customer;                     Page_Cust

Report Selection in Dynamics 365 Business Central

Hi Folks, In this blog we will see how user can select which document report will be printed with each document type or how we can print our customize report with standard " Print " action button in Business Central. The default version of BC includes the following Report Selection Pages: Report Selection - Sales  >> (For all types of Sales related reports/Documents). Report Selection - Purchase Report Selection - Inventory Report Selection - Cash Flow Report Selection - Warehouse Report Selection - Service Report Selection - Bank Account Report Selections Reminder/Finance Charge Report Selections Production Order General Journal Template  >> For All types of Journals ( Posting Report ID , Test Report ID etc. fields are available in table). In this example we will see how we can print our customize report just by clicking on  "Print"  or  "Post & Print"  action button on Sales order by perform the following steps:  Type Report Selectio