Skip to content

Codeunit WSB Custom Fields Management

Provides functions used for setting up Custom Fields.

Properties

Name Value
Access Public

Methods

wgFncCheckRestoreCustomCheckboxField(Boolean@, Boolean, Enum::WSB_CFEntity, Integer)

Restores (if needed) the value of custom field of type Boolean

Parameters

Type Name Description
Boolean vFieldValue The reference to the field value
Boolean pOldValue Value of the field before it was changed
Enum "WSB_CFEntity" pEntity Entity of the changed field
Integer pFieldNo Number of custom field

wgFncCheckRestoreCustomCodeField(Code[20]@, Code[20], Enum::WSB_CFEntity, Integer)

Restores (if needed) the value of custom field of type Code20

Parameters

Type Name Description
Code[20] vFieldValue The reference to the field value
Code[20] pOldValue Value of the field before it was changed
Enum "WSB_CFEntity" pEntity Entity of the changed field
Integer pFieldNo Number of custom field

wgFncCheckRestoreCustomDateField(Date@, Date, Enum::WSB_CFEntity, Integer)

Restores (if needed) the value of custom field of type Date

Parameters

Type Name Description
Date vFieldValue The reference to the field value
Date pOldValue Value of the field before it was changed
Enum "WSB_CFEntity" pEntity Entity of the changed field
Integer pFieldNo Number of custom field

wgFncCheckRestoreCustomDecimalField(Decimal@, Decimal, Enum::WSB_CFEntity, Integer)

Restores (if needed) the value of custom field of type Decimal

Parameters

Type Name Description
Decimal vFieldValue The reference to the field value
Decimal pOldValue Value of the field before it was changed
Enum "WSB_CFEntity" pEntity Entity of the changed field
Integer pFieldNo Number of custom field

wgFncCheckRestoreCustomNumberField(Integer@, Integer, Enum::WSB_CFEntity, Integer)

Restores (if needed) the value of custom field of type Integer

Parameters

Type Name Description
Integer vFieldValue The reference to the field value
Integer pOldValue Value of the field before it was changed
Enum "WSB_CFEntity" pEntity Entity of the changed field
Integer pFieldNo Number of custom field

wgFncCheckRestoreCustomTextField(Text[250]@, Text[250], Enum::WSB_CFEntity, Integer)

Restores (if needed) the value of custom field of type Text250

Parameters

Type Name Description
Text[250] vFieldValue The reference to the field value
Text[250] pOldValue Value of the field before it was changed
Enum "WSB_CFEntity" pEntity Entity of the changed field
Integer pFieldNo Number of custom field

wgFncCopyCustomFieldsFromRecRefToJob(Job@, Enum::WSB_CFEntity, RecordRef):Boolean

Copies custom fields from RecordRef to Job record.

Parameters

Type Name Description
Record "Job" vRecJob Target Job record.
Enum "WSB_CFEntity" pEntity Identifies entity where data is copied from
RecordRef pFromRecRef Source record with the data

Returns

Type Description
Boolean Specifies if any fields were copied to the target record

wgFncCopyCustomFieldsFromRecRefToPurchHeader(Purchase Header@, Enum::WSB_CFEntity, RecordRef):Boolean

Copies custom fields from RecordRef to Purchase Header record.

Parameters

Type Name Description
Record "Purchase Header" vRecPurchHeader Target Purchase Header record.
Enum "WSB_CFEntity" pEntity Identifies entity where data is copied from
RecordRef pFromRecRef Source record with the data

Returns

Type Description
Boolean Specifies if any fields were copied to the target record

wgFncCopyCustomFieldsFromRecRefToPurchLine(Purchase Line@, Enum::WSB_CFEntity, RecordRef):Boolean

Copies custom fields from RecordRef to Purchase Line record.

Parameters

Type Name Description
Record "Purchase Line" vRecPurchLine Target Purchase Line record.
Enum "WSB_CFEntity" pEntity Identifies entity where data is copied from
RecordRef pFromRecRef Source record with the data

Returns

Type Description
Boolean Specifies if any fields were copied to the target record

wgFncCopyCustomFieldsFromRecRefToSalesHeader(Sales Header@, Enum::WSB_CFEntity, RecordRef):Boolean

Copies custom fields from RecordRef to Sales Header record.

Parameters

Type Name Description
Record "Sales Header" vRecSalesHeader Target Sales Header record.
Enum "WSB_CFEntity" pEntity Identifies entity where data is copied from
RecordRef pFromRecRef Source record with the data

Returns

Type Description
Boolean Specifies if any fields were copied to the target record

wgFncCopyCustomFieldsFromRecRefToSalesLine(Sales Line@, Enum::WSB_CFEntity, RecordRef):Boolean

Copies custom fields from RecordRef to Sales Line record.

Parameters

Type Name Description
Record "Sales Line" vRecSalesLine Target Sales Line record.
Enum "WSB_CFEntity" pEntity Identifies entity where data is copied from
RecordRef pFromRecRef Source record with the data

Returns

Type Description
Boolean Specifies if any fields were copied to the target record

wgFncIsCopyToProductionBOMLineDefined(Enum::WSB_CFEntity):Boolean

Checks if an entity is defined for copying to a Production BOM Line.

Parameters

Type Name Description
Enum "WSB_CFEntity" pEntity Identifies entity where data is copied from

Returns

Type Description
Boolean Specifies if copy to production bom line is defined for the entity in the pEntity parameter.

wgFncCopyCustomFieldsFromRecRefToProductionBOMLine(Production BOM Line@, Enum::WSB_CFEntity, RecordRef):Boolean

Copies custom fields from RecordRef to Production BOM Line record.

Parameters

Type Name Description
Record "Production BOM Line" vRecProductionBOMLine Target Production BOM Line record.
Enum "WSB_CFEntity" pEntity Identifies entity where data is copied from
RecordRef pFromRecRef Source record with the data

Returns

Type Description
Boolean Specifies if any fields were copied to the target record

GetCustomFieldCaptionByExpressionCode(Integer, Text, Text[1024]@)

Returns caption of the custom field in the given language using caption expression.

Parameters

Type Name Description
Integer pLanguageId Identifier of the language
Text pCaptionExpr Expression with the entity and field number delimited by comma
Text[1024] vCaption Field caption

wgFncGetCustomFieldCaptionByFieldNo(Integer, Enum::WSB_CFEntity, Enum::WSB_CFDataType, Integer):Text[50]

Returns caption of the custom field in the given language using field number.

Parameters

Type Name Description
Integer pLanguageId Identifier of the language.
Enum "WSB_CFEntity" pEntity Entity of the field.
Enum "WSB_CFDataType" pType Datatype of the field.
Integer pFieldNum Field number according to Custom Field Definition

Returns

Type Description
Text[50] Field caption.

GetCustomFieldNoByFieldDefinition(WSB Custom Field Definition):Integer

Returns field number of the custom field in a table.

Parameters

Type Name Description
Record "WSB Custom Field Definition" pRecCustomFieldDef Custom Field Definition record with the specification of the custom field.

Returns

Type Description
Integer Field number in table.

IsContactCustomFieldChanged(Contact@, Contact@):Boolean

Determines whether custom fields were changed in contact record and if related customer or vendor should be updated.

Parameters

Type Name Description
Record "Contact" vRecCont Modified contact record.
Record "Contact" vxRecCont Contact record before modification.

Returns

Type Description
Boolean Return value of type Boolean.

IsCustomerCustomFieldChanged(Customer@, Customer@):Boolean

Determines whether custom fields were changed in customer record and if related contact should be updated.

Parameters

Type Name Description
Record "Customer" vRecCust Modified customer record.
Record "Customer" vxRecCust Customer record before modification.

Returns

Type Description
Boolean Return value of type Boolean.

wgFncIsCustomFieldsDefinedForEntity(Enum::WSB_CFEntity):Boolean

Determines whether custom fields configured for given table.

Parameters

Type Name Description
Enum "WSB_CFEntity" pEntity Entity table.

Returns

Type Description
Boolean Return value of type Boolean.

IsVendorCustomFieldChanged(Vendor@, Vendor@):Boolean

Determines whether custom fields were changed in vendor record and if related contact should be updated.

Parameters

Type Name Description
Record "Vendor" vRecVend Modified vendor record.
Record "Vendor" vxRecVend Vendor record before modification.

Returns

Type Description
Boolean Return value of type Boolean.

wgFncSetCustomFieldsVisibility(Enum::WSB_CFEntity, Enum::WSB_CFDataType, Boolean@, Boolean@, Boolean@, Boolean@, Boolean@)

Determines if custom fields of certain datatype should be visible on a page.

Parameters

Type Name Description
Enum "WSB_CFEntity" pEntity Entity table.
Enum "WSB_CFDataType" pFieldType Field data type.
Boolean vCustomField1Visible Visibility of the first custom field.
Boolean vCustomField2Visible Visibility of second custom field.
Boolean vCustomField3Visible Visibility of third custom field.
Boolean vCustomField4Visible Visibility of fourth custom field.
Boolean vCustomField5Visible Visibility of fifth custom field.