Gets or sets the value of a data element using data from a file object.
Syntax:
Remarks
When assigning a file object to the data element, the data stored to the data element is the contents of the physical file of the ediFile object. When retrieving a value as a file object, the value of the data element is stored to a temporary file, and the ediFile object of the temporary file is returned. The temporary file is deleted when the instance of the object is destroyed.NOTE: If the data element has no value, this property will return an empty object or NULL.
Example 1: Getting the file value
Dim oEdiDoc As Fredi.ediDocument
Dim oSchemas As Fredi.ediSchemas
Dim oSchema As Fredi.ediSchema
Dim oDataElement As Fredi.ediDataElement
Dim oDataSegment As Fredi.ediDataSegment
Dim oFile As Fredi.ediFile
' Create instance of Framework EDI.
Set oEdiDoc = New Fredi.ediDocument
' Disable standard reference library.
Set oSchemas = oEdiDoc.GetSchemas
oSchemas.EnableStandardReference = False
' Load the schema that the EDI file will use.
Set oSchema = oEdiDoc.LoadSchema(App.Path & "\SampleSefX12_850.SEF", Schema_Standard_Exchange_Format)
' Process the EDI file.
oEdiDoc.LoadEdi App.Path & "\SampleEdiX12_850.X12"
' Get first data segment in document.
Set oDataSegment = oEdiDoc.FirstDataSegment
' Get the data element that is the 5th position of the BEG data segment.
Set oDataElement = oDataSegment.GetDataElementByPos("\ISA\GS\ST\BEG<373>")
' Get the file object containing the data element value.
Set oFile = oDataElement.FileValue
' Get the value from the file object.
MsgBox "Element Value: " & oFile.GetStringContent(EncodeType_Binary)
Example 2: Setting the file value
Dim oEdiDoc As Fredi.ediDocument
Dim oSchemas As Fredi.ediSchemas
Dim oSchema As Fredi.ediSchema
Dim oDataElement As Fredi.ediDataElement
Dim oDataSegment As Fredi.ediDataSegment
Dim oFile As Fredi.ediFile
Dim oFileSystem As Fredi.ediFileSystem
' Create instance of Framework EDI.
Set oEdiDoc = New Fredi.ediDocument
' Get file system.
Set oFileSystem = oEdiDoc.GetFileSystem
' Disable standard reference library.
Set oSchemas = oEdiDoc.GetSchemas
oSchemas.EnableStandardReference = False
' Load the schema that the EDI file will use.
Set oSchema = oEdiDoc.LoadSchema(App.Path & "\SampleSefX12_850.SEF", Schema_Standard_Exchange_Format)
' Process the EDI file.
oEdiDoc.LoadEdi App.Path & "\SampleEdiX12_850.X12"
' Get first data segment in document.
Set oDataSegment = oEdiDoc.FirstDataSegment
' Get the data element that is the 5th position of the BEG data segment.
Set oDataElement = oDataSegment.GetDataElementByPos("\ISA\GS\ST\BEG<373>")
' Set file object with file containing new data element value.
Set oFile = oFileSystem.GetFile(App.Path & "\FileValue.txt")
' Set the data element value from the file object.
oDataElement.FileValue = oFile
' Show new value of data element.
MsgBox "Element Value: " & oDataElement.Value
Sample