Skip to content

Codeunit wDCR_ReportFunctions

Provides helper functions for reports.

Properties

Name Value
Access Public

Methods

wgFncFormatDateText

Formats a date according to the format-option of the current report.

Parameters

Type Name Description
Date pDate The Date.

Returns

Type Description
Text The formatted date text.

wgFncFormatDateText

Formats a date according to the format-option of the report with the specified ID.

Parameters

Type Name Description
Integer pReportID The Report ID.
Date pDate The Date.

Returns

Type Description
Text The formatted date text.

wgFncFormatDateText

Formats a date according to the specified format option.

Parameters

Type Name Description
Date pDate The date.
Enum "wDCR_DateTextFormat" pwDCR_DateTextFormat The format option.

Returns

Type Description
Text The formatted date text.

wgFncGetContactSalutationText

Returns a salutation text (formal or informal) for a contact based on the Salutation Settings for the contact. If the contact or salutation formula does not exist, then an empty string is returned.

Parameters

Type Name Description
Code[20] pContactNo The no. of the contact to get the salutation text for.
Code[10] pLanguageCode The code of the language to use for the translation of the salutation.
Enum "Salutation Formula Salutation Type" pSalutationType The type of salutation to use.

Returns

Type Description
Text The salutation text for the contact based on the passed parameters.

wgFncGetContactSalutationText

Returns a salutation text (formal or informal) for a contact based on the Salutation Settings for the contact. If the contact or salutation formula does not exist, then the "pContactName" parameter will be returned.

Parameters

Type Name Description
Text pContactName The name of the contact to get the salutation text for.
Code[20] pContactNo The no. of the contact to get the salutation text for.
Code[10] pLanguageCode The code of the language to use for the translation of the salutation.
Enum "Salutation Formula Salutation Type" pSalutationType The type of salutation to use.

Returns

Type Description
Text The salutation text for the contact based on the passed parameters.

wgFncGetCurrencySymbol

Returns CurrencySymbol.

Parameters

Type Name Description
Code[10] pCurrencyCode The Currency Code.

Returns

Type Description
Text[10] The CurrencySymbol.

wgFncGetDateTextFormat

Retrieves the format-option that should be used to format dates in a report with specified ID.

Parameters

Type Name Description
Integer pReportID The ID of the report.
Enum "wDCR_DateTextFormat" vDateTextFormat The Format to use.

Returns

Type Description
Boolean true iff a date text format setting could be found for the report.

wgFncGetDimText

Builds strings of Dimension Code and Dimension Value Code pairs from a set of Dimension Set Entry records. This procedure is meant to be used iterating over a record set, for example in the OnAfterGetRecord trigger of a Dimension Set Entry dataitem. It will result in a string formatted like: 'DimCode1 DimValueCode1, DimCode2 DimValueCode2, DimCode3 DimValueCode3'.

Parameters

Type Name Description
Record "Dimension Set Entry" vRecDimSetEntry The Dimension Set Entry dataitem.
Text[120] vDimText The text build from the Dimension Set Entry records.

wgFncGetItemAttributeNameByLanguageCode

Retrieves the Item Attribute Name for the specified Language Code.

Parameters

Type Name Description
Record "Item Attribute Value" pRecItemAttributeValue The Item Attribute Value record.
Code[10] pLanguageCode The Language Code.

Returns

Type Description
Text[250] The Item Attribute Name for the specified Language Code.

wgFncGetItemAttributeValueByLanguageCode

Retrieves the Item Attribute Value for the specified Language Code.

Parameters

Type Name Description
Record "Item Attribute Value" pRecItemAttributeValue The Item Attribute Value record.
Code[10] pLanguageCode The Language Code.

Returns

Type Description
Text[250] The Item Attribute Value for the specified Language Code.

wgFncGetReportIDFromCurrReportObjectIDString

Retrieves the Report ID from the string returned by CurrReport.ObjectId(false)

Parameters

Type Name Description
Text pCurrReportObjectID The output of CurrReport.ObjectId(false).

Returns

Type Description
Integer The Report ID.

wgFncHideLineDiscount

Determines whether or not the Line Discount column needs to be shown on the document. Checks whether there are any lines under the document that have a line discount. If there are no lines with a discount, then the return value will be true. The procedure should be able to check this for the following header tables:

  • Sales Headers

  • Purchase Headers

  • Sales Shipment Headers

  • Sales Invoice Headers

  • Sales Credit Memo Headers

  • Service Headers

  • Service Invoice Headers

  • Service Credit Memo Headers

  • Return Receipt Headers For any other unsupported record type the return value is "true".

Parameters

Type Name Description
RecordRef vRecRef The header record

Returns

Type Description
Boolean true iff there are no lines in the document with a line discount.

wgFncIsMonolithicVAT

Determines whether a set of VAT Amount Line records only apply to a single VAT type. If the record set only includes 0 or 1 records, or 2 records being a positive and negative line for the same VAT type, then the return value will be true, because there is only a single VAT type.

Parameters

Type Name Description
Record "VAT Amount Line" vRecVATAmountLine The set of VAT Amount Line records.

Returns

Type Description
Boolean true iff only a single VAT type exists in the VAT Amount Line record set.

wgFncIsUseShowCommentsAndDimensionsEnabled

Gets the value of field "Use "Show Comments" and "Show Dimensions" from the setup.

Returns

Type Description
Boolean The value of "Use "Show Comments" and "Show Dimensions".

wgFncSetReportID

Sets the Report ID for this codeunit.

Parameters

Type Name Description
Integer pReportID The report ID.

wgFncSetReportIDFromCurrReportObjectIDString

Sets the Report ID for this codeunit from the string returned by CurrReport.ObjectId(false)

Parameters

Type Name Description
Text pCurrReportObjectID The output of CurrReport.ObjectId(false).

Returns

Type Description
Integer The Report ID.

wgFncShouldLoadItemPictures

Retrieves whether item pictures should be loaded for the current report.

Returns

Type Description
Boolean true iff item pictures are to be loaded.

wgFncShouldLoadItemPictures

Retrieves whether item pictures should be loaded for the report with the specified ID.

Parameters

Type Name Description
Integer pReportID The Report ID.

Returns

Type Description
Boolean true iff item pictures are to be loaded.

wgFncShouldOverrideDocumentLanguage

Retrieves whether the document language should be determined by parameters set on the request page, "Report Limits and Settings" page and/or session language instead of using the "Language Code" field on the document header.

Returns

Type Description
Boolean true if the document language code should be overriden by specifically set parameters.

wgFncShouldOverrideDocumentLanguage

Retrieves whether the document language should be determined by parameters set on the request page, "Report Limits and Settings" page and/or session language instead of using the "Language Code" field on the document header.

Parameters

Type Name Description
Integer pReportID The ID of the report object.

Returns

Type Description
Boolean true if the document language code should be overriden by specifically set parameters.

wlEvpOnBeforeFormatDateText

Allows to hook into how dates are formatted to text.

Parameters

Type Name Description
Date pDate The date.
Enum "wDCR_DateTextFormat" pwDCR_DateTextFormat The date format that should be used.
Text vFormattedDateText The output (date formatted as text).
Boolean vIsHandled Set this parameter to true if your extension handled formatting the date as text.