Codeunit "Edit in Excel"
This codeunit provides an interface to running Edit in Excel for a specific page.
Properties
| Name | Value |
|---|---|
| Access | Public |
Methods
EditPageInExcel
Creates web service for the specified page, and uses the web service to prepare and download an Excel file for the Edit in Excel functionality.
procedure EditPageInExcel(PageCaption: Text[240], PageId: Integer)
Parameters
| Name | Type | Description |
|---|---|---|
| PageCaption | Text[240] |
The name of the page. This will be used for the name of the downloaded excel file, additionally the web service will be called [PageCaption]_Excel. Note if the PageCaption starts with a digit, the web service name will be WS[PageCaption]_Excel. |
| PageId | Integer |
The ID of the page, for example, 21. |
EditPageInExcel
Creates web service for the specified page, and uses the web service to prepare and download an Excel file for the Edit in Excel functionality.
procedure EditPageInExcel(PageCaption: Text[240], PageId: Integer, EditinExcelFilters: Codeunit "Edit in Excel Filters")
Parameters
| Name | Type | Description |
|---|---|---|
| PageCaption | Text[240] |
The name of the page. This will be used for the name of the downloaded excel file, additionally the web service will be called [PageCaption]_Excel. Note if the PageCaption starts with a digit, the web service name will be WS[PageCaption]_Excel. |
| PageId | Integer |
The ID of the page, for example, 21. |
| EditinExcelFilters | Codeunit System.Integration.Excel."Edit in Excel Filters" |
The filters which will be applied to Edit in Excel. |
EditPageInExcel
Creates web service for the specified page, and uses the web service to prepare and download an Excel file for the Edit in Excel functionality.
procedure EditPageInExcel(PageCaption: Text[240], PageId: Integer, EditinExcelFilters: Codeunit "Edit in Excel Filters", FileName: Text)
Parameters
| Name | Type | Description |
|---|---|---|
| PageCaption | Text[240] |
The name of the page. This will be used for the name of the downloaded excel file, if the FileName parameter is not set. Additionally, the web service will be called [PageCaption]_Excel. Note if the PageCaption starts with a digit, the web service name will be WS[PageCaption]_Excel. |
| PageId | Integer |
The ID of the page, for example, 21. |
| EditinExcelFilters | Codeunit System.Integration.Excel."Edit in Excel Filters" |
The filters which will be applied to Edit in Excel. |
| FileName | Text |
The name of the downloaded excel file. |
GenerateExcelWorkBook
procedure GenerateExcelWorkBook(TenantWebService: __MissingTypeSymbol__, SearchFilter: Text)
Parameters
| Name | Type | Description |
|---|---|---|
| TenantWebService | __MissingTypeSymbol__ | |
| SearchFilter | Text |
GenerateExcelWorkBook
procedure GenerateExcelWorkBook(TenantWebService: __MissingTypeSymbol__, EditinExcelFilters: Codeunit "Edit in Excel Filters")
Parameters
| Name | Type | Description |
|---|---|---|
| TenantWebService | __MissingTypeSymbol__ | |
| EditinExcelFilters | Codeunit System.Integration.Excel."Edit in Excel Filters" |
Events
OnEditInExcelWithStructuredFilter
This event is called when Edit in Excel is invoked, handling JSON structured filters. It also allows overriding the Edit in Excel functionality. It is however recommended to use OnEditInExcelWithFilters below if possible to avoid taking dependency on a given structure.
[IntegrationEvent(False,False)]
internal procedure OnEditInExcelWithStructuredFilter(ServiceName: Text[240], Filter: JsonObject, Payload: JsonObject, SearchFilter: Text, var Handled: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| ServiceName | Text[240] |
The name of the web service already created for use with Edit in Excel. |
| Filter | JsonObject |
Business Central Filter to be applied in Edit in Excel. |
| Payload | JsonObject |
Object binding the name of the filtered field with its EdmType |
| SearchFilter | Text |
The search filter of the user. |
| Handled | Boolean |
The name of the web service already created for use with Edit in Excel. |
OnEditInExcelWithFilters
This event is called when the Edit in Excel system action is invoked or EditInExcel is called in this codeunit. It allows modifying filters or overriding the Edit in Excel functionality completely.
[IntegrationEvent(False,False)]
internal procedure OnEditInExcelWithFilters(ServiceName: Text[240], var EditinExcelFilters: Codeunit "Edit in Excel Filters", SearchFilter: Text, var Handled: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| ServiceName | Text[240] |
The name of the web service already created for use with Edit in Excel. |
| EditinExcelFilters | Codeunit System.Integration.Excel."Edit in Excel Filters" |
The filters which will be applied to Edit in Excel. |
| SearchFilter | Text |
The search filter of the user. |
| Handled | Boolean |
The name of the web service already created for use with Edit in Excel. |