Codeunit wDCR_ReportFunctions
Provides helper functions for reports.
Properties
Methods
wgFncContactGetSalutationText(Text, Code[20], Code[10], Enum::Microsoft#CRM#Setup#Salutation Formula Salutation Type):Text
Obsolete
Procedure will be removed, please use wgFncGetContactSalutationText instead 2.54.0.0
Returns Salutation Text (Formal or Informal) based on Salutation Formula settings Contact Function will test if Contact No. and Salutation Formula language exists to exclude errors. If no Contact or Translation for Salutation is found then only pContactName will be sent as Salutation Text.
Parameters
Type |
Name |
Description |
Text |
pContactName |
Contact Name from document |
Code[20] |
pContactNo |
Contact No. from document |
Code[10] |
pLanguageCode |
Language Code |
Enum "Salutation Formula Salutation Type" |
pSalutationType |
Salutation Type |
Returns
Type |
Description |
Text |
Salutation Text |
wgFncFormatDateText(Date):Text
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(Integer, Date):Text
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(Date, Enum::wDCR_DateTextFormat):Text
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(Code[20], Code[10], Enum::Microsoft#CRM#Setup#Salutation Formula Salutation Type):Text
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 |
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. |
wgFncGetContactSalutationText(Text, Code[20], Code[10], Enum::Microsoft#CRM#Setup#Salutation Formula Salutation Type):Text
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(Code[10]):Text[10]
Returns CurrencySymbol.
Parameters
Type |
Name |
Description |
`` |
pCurrency |
The Currency Code. |
Returns
Type |
Description |
`` |
The CurrencySymbol. |
wgFncGetDateTextFormat(Integer, Enum::wDCR_DateTextFormat@):Boolean
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(Dimension Set Entry@, Text[120]@)
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. |
wgFncGetReportIDFromCurrReportObjectIDString(Text):Integer
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(RecordRef@):Boolean
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(VAT Amount Line@):Boolean
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. |
wgFncSetReportID(Integer)
Sets the Report ID for this codeunit.
Parameters
Type |
Name |
Description |
Integer |
pReportID |
The report ID. |
wgFncSetReportIDFromCurrReportObjectIDString(Text):Integer
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:Boolean
Retrieves whether item pictures should be loaded for the current report.
Returns
Type |
Description |
Boolean |
true iff item pictures are to be loaded. |
wgFncShouldLoadItemPictures(Integer):Boolean
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. |
wlEvpOnBeforeFormatDateText(Date, Enum::wDCR_DateTextFormat, Text@, Boolean@)
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. |