More prettifiations
This commit is contained in:
parent
7ff6ff73fa
commit
04944b1584
3 changed files with 62 additions and 77 deletions
|
|
@ -51,67 +51,44 @@ Code example (Insert a record, apply a template, and insert the related template
|
|||
|
||||
**// Apply a template RecRef.GETTABLE(Customer);**
|
||||
|
||||
```al
|
||||
ConfigTemplateMgt.UpdateRecord(ConfigTemplateHeader,RecRef);
|
||||
|
||||
RecRef.SETTABLE(Customer);
|
||||
```
|
||||
|
||||
**// Insert Dimensions -- related templates**
|
||||
|
||||
```al
|
||||
MiniDimensionsTemplate.InsertDimensionsFromTemplates(ConfigTemplateHeader,Customer."No.",DATABASE::Customer);
|
||||
|
||||
```
|
||||
Code to insert related templates (dimensions):
|
||||
|
||||
**FUNCTION InsertDimensionsFromTemplates(ConfigTemplateHeader : Record "Config. Template Header";MasterRecordNo : Code\[20\];TableID : Integer)**
|
||||
|
||||
**// There are multiple records (multiple dimensions per master record)**
|
||||
|
||||
**// We have to set filter******
|
||||
|
||||
ConfigTemplateLine.SETRANGE(Type,ConfigTemplateLine.Type::"Related Template");****
|
||||
|
||||
ConfigTemplateLine.SETRANGE("Data Template Code",ConfigTemplateHeader.Code);****
|
||||
|
||||
****
|
||||
|
||||
IF ConfigTemplateLine.FINDSET THEN****
|
||||
|
||||
REPEAT****
|
||||
|
||||
```al
|
||||
FUNCTION InsertDimensionsFromTemplates(ConfigTemplateHeader : Record "Config. Template Header";MasterRecordNo : Code\[20\];TableID : Integer)
|
||||
// There are multiple records (multiple dimensions per master record)
|
||||
// We have to set filter
|
||||
ConfigTemplateLine.SETRANGE(Type,ConfigTemplateLine.Type::"Related Template");
|
||||
ConfigTemplateLine.SETRANGE("Data Template Code",ConfigTemplateHeader.Code
|
||||
IF ConfigTemplateLine.FINDSET THEN
|
||||
REPEAT
|
||||
ConfigTemplateHeader.GET(ConfigTemplateLine."Template Code");
|
||||
|
||||
**// Ensure that the table where the template belongs to is Dimensions**
|
||||
|
||||
**// We could have other related templates******
|
||||
|
||||
IF ConfigTemplateHeader."Table ID" = DATABASE::"Default Dimension" THEN****
|
||||
|
||||
InsertDimensionFromTemplate(ConfigTemplateHeader,MasterRecordNo,TableID);****
|
||||
|
||||
UNTIL ConfigTemplateLine.NEXT = 0;****
|
||||
|
||||
****
|
||||
// Ensure that the table where the template belongs to is Dimensions
|
||||
// We could have other related templates
|
||||
IF ConfigTemplateHeader."Table ID" = DATABASE::"Default Dimension" THEN
|
||||
InsertDimensionFromTemplate(ConfigTemplateHeader,MasterRecordNo,TableID);
|
||||
UNTIL ConfigTemplateLine.NEXT = 0;
|
||||
```
|
||||
|
||||
**// Create a new Dimensions Record and link it to the Master Record******
|
||||
|
||||
**FUNCTION InsertDimensionFromTemplate(ConfigTemplateHeader : Record "Config. Template Header";MasterRecordNo : Code\[20\];TableID : Integer)**
|
||||
|
||||
```al
|
||||
FUNCTION InsertDimensionFromTemplate(ConfigTemplateHeader : Record "Config. Template Header";MasterRecordNo : Code\[20\];TableID : Integer)
|
||||
DefaultDimension.INIT;
|
||||
|
||||
DefaultDimension."No." := MasterRecordNo;****
|
||||
|
||||
DefaultDimension."Table ID" := TableID;****
|
||||
|
||||
DefaultDimension."Dimension Code" := GetDefaultDimensionCode(ConfigTemplateHeader);****
|
||||
|
||||
DefaultDimension.INSERT;****
|
||||
|
||||
****
|
||||
|
||||
RecRef.GETTABLE(DefaultDimension);****
|
||||
|
||||
ConfigTemplateMgt.UpdateRecord(ConfigTemplateHeader,RecRef);****
|
||||
|
||||
DefaultDimension."No." := MasterRecordNo;
|
||||
DefaultDimension."Table ID" := TableID;
|
||||
DefaultDimension."Dimension Code" := GetDefaultDimensionCode(ConfigTemplateHeader);
|
||||
DefaultDimension.INSERT;
|
||||
RecRef.GETTABLE(DefaultDimension);
|
||||
ConfigTemplateMgt.UpdateRecord(ConfigTemplateHeader,RecRef);
|
||||
RecRef.SETTABLE(DefaultDimension);
|
||||
```
|
||||
|
||||
**To surface the action in the product, you have three options:**
|
||||
|
||||
|
|
@ -167,7 +144,9 @@ The user opens the **Customers List** window and selects **New**
|
|||
|
||||
**[![ ][image3]][anchor3]**
|
||||
|
||||
**[][anchor3]**From this page, the user can view the template, edit it, or create a new one. Selecting a template will populate the customer card and open a new record. From the existing record, the user has options to save as a template or opening a list of templates to maintain available templates. Selecting a template will populate the customer card and open a new record. From the existing record, the user has options to save as a template or opening a list of templates to maintain available templates.
|
||||
**[][anchor3]**
|
||||
|
||||
From this page, the user can view the template, edit it, or create a new one. Selecting a template will populate the customer card and open a new record. From the existing record, the user has options to save as a template or opening a list of templates to maintain available templates. Selecting a template will populate the customer card and open a new record. From the existing record, the user has options to save as a template or opening a list of templates to maintain available templates.
|
||||
|
||||
[![ ][image4]][anchor4]
|
||||
|
||||
|
|
|
|||
|
|
@ -38,9 +38,11 @@ Where:
|
|||
* **Object Type** and **Object ID** define the type of the application object to run (Table, Page, Report, Codeunit, Query, or XMLport) and its ID.
|
||||
* **Record** specifies the actual data to run the URL on, such as:
|
||||
|
||||
```al
|
||||
Vendor.GET("Account No.");
|
||||
|
||||
GETURL(CLIENTTYPE:WEB,COMPANYNAME, OBJECTTYPE::Page,27,Vendor)
|
||||
```
|
||||
|
||||
**Note**: It is currently not possible to set filters on the record that you sent as a last parameter to the GETURL function. However, it is possible to write your own code to compute and append the filter string to the URL that is created by the GETURL function.
|
||||
|
||||
|
|
@ -61,7 +63,7 @@ The following are examples of calls to GETURL and their corresponding return val
|
|||
**Command**
|
||||
|
||||
**URL**
|
||||
|
||||
```al
|
||||
GETURL(CLIENTTYPE::Win)
|
||||
|
||||
dynamicsnav://MyServer:7046/DynamicsNAV71//
|
||||
|
|
@ -202,12 +204,15 @@ GETURL(CLIENTTYPE::Web,COMPANYNAME,OBJECTTYPE::Report,6)
|
|||
|
||||
https://navwebsrvr:443/DynamicsNAV71\_Instance1/Webclient?company=CRONUS&report=6
|
||||
|
||||
```
|
||||
|
||||
If the GETURL function is called with invalid parameters, it will return an empty string. In that case, you can find the related error text by calling the GETLASTERRORTEXT function.
|
||||
|
||||
**Function Call**
|
||||
|
||||
**Error Message**
|
||||
|
||||
```al
|
||||
GETURL(CLIENTTYPE::Web,COMPANYNAME,OBJECTTYPE::Table,27)
|
||||
|
||||
The specified object type parameter for the GetUrl function is not valid.
|
||||
|
|
@ -274,6 +279,8 @@ The specified object type parameter for the GetUrl function is not valid.
|
|||
|
||||
GETURL(CLIENTTYPE::SOAP,COMPANYNAME,OBJECTTYPE::Page,27,record)
|
||||
|
||||
```
|
||||
|
||||
You cannot specify a record parameter for the GetUrl function when the object type is SOAP
|
||||
|
||||
## NAV Specific Example
|
||||
|
|
|
|||
|
|
@ -96,16 +96,14 @@ If you need a setup record and codeunit, then it is a good idea to encapsulate t
|
|||
|
||||
Implementation of the **Finance Performance Chart** page (762)
|
||||
|
||||
**BusinessChart::AddInReady()**
|
||||
|
||||
```al
|
||||
BusinessChart::AddInReady()
|
||||
UpdateChart(Period::" ");
|
||||
|
||||
**LOCAL UpdateChart(Period : ',Next,Previous')**
|
||||
|
||||
LOCAL UpdateChart(Period : ',Next,Previous')
|
||||
MoveAndUpdateChart(Period,0);
|
||||
|
||||
**LOCAL MoveAndUpdateChart(Period : ',Next,Previous';Move : Integer)**
|
||||
|
||||
LOCAL MoveAndUpdateChart(Period : ',Next,Previous';Move : Integer)
|
||||
AccSchedChartManagement.GetSetupRecordset(AccountSchedulesChartSetup,AccountSchedulesChartSetup.Name,Move);
|
||||
|
||||
AccSchedChartManagement.UpdateData(Rec,Period,AccountSchedulesChartSetup);
|
||||
|
|
@ -113,16 +111,17 @@ AccSchedChartManagement.UpdateData(Rec,Period,AccountSchedulesChartSetup);
|
|||
Update(CurrPage.BusinessChart);
|
||||
|
||||
StatusText := GetCurrentSelectionText("Period Filter Start Date","Period Filter End Date");
|
||||
```
|
||||
|
||||
In the MoveAndUpdateChart method, the AccSchedChartManagement codeunit gets a setup record and updates it if necessary. Then, it initializes the chart with setup data and sets the StatusText to show the period for which data is displayed. The same method is used by the actions to move and update the chart so that there is no code duplication.
|
||||
|
||||
The following code is used to implement **DataPointClicked**
|
||||
|
||||
******BusinessChart::DataPointClicked(point : DotNet "Microsoft.Dynamics.Nav.Client.BusinessChart.BusinessChartDataPoint")**
|
||||
|
||||
```al
|
||||
BusinessChart::DataPointClicked(point : DotNet "Microsoft.Dynamics.Nav.Client.BusinessChart.BusinessChartDataPoint")
|
||||
SetDrillDownIndexes(point);
|
||||
|
||||
AccSchedChartManagement.DrillDown(Rec,AccountSchedulesChartSetup);
|
||||
```
|
||||
|
||||
SetDrillDownindexes is a method from the **Business Chart Buffer** table that maps the DotNet point variable to C/AL data, so it must be used. The next method that you must implement is the action to be performed on Drilldown.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue