Create a new BLOB field in the Sales Header. That field will store your document for you.
Lets say you call it "Document" then this is how the code might look like...
"Exist" is a Boolean Variable, used to see if there is a document in there already, if there is, then ask the user to confirm the deletion of the current document before importing a new one.
"Document Pic" is a field i use to display a pic if there is a Document in the Sales Header.
Create a new BLOB field in the Sales Header. That field will store your document for you.
Lets say you call it "Document" then this is how the code might look like...
"Exist" is a Boolean Variable, used to see if there is a document in there already, if there is, then ask the user to confirm the deletion of the current document before importing a new one.
"Document Pic" is a field i use to display a pic if there is a Document in the Sales Header.
If you are working with a more recent version of Navision, you can use "CREATEINSTREAM" and "CREATEOUTSTREAM". Just lookup the Navision help to see how they work and code examples.
Elmar F. Vidisson
Certified Navision Attain Developer
1. create new segment number
2. fill in the interaction template
3. create new contact number
4. click the look up button in attachment field of contact number.
alert message pop out.
"This message is for C/AL programmers:
Could not invoke the member Active Window. The OLE control or Automation server returned an unknown"
Comments
Lets say you call it "Document" then this is how the code might look like...
"Exist" is a Boolean Variable, used to see if there is a document in there already, if there is, then ask the user to confirm the deletion of the current document before importing a new one.
"Document Pic" is a field i use to display a pic if there is a Document in the Sales Header.
CALCFIELDS(Document);
Exist := Rec.Document.HASVALUE;
IF Exist THEN
IF NOT CONFIRM(BMIText002) THEN
EXIT
ELSE
CLEAR(Document);
TempFileName_lt := Rec.Document.IMPORT('*.DOC',TRUE);
IF TempFileName_lt = '' THEN
EXIT;
"Document Pic" := TRUE;
MODIFY;
Hope this Helps.
Certified Navision Attain Developer
10s..
I don't know if you can See the document in Navision, but this code exports it so you can open it up..
Rec.Document.EXPORT("DOCUMENT NAME." + '.DOC',TRUE).
If you are working with a more recent version of Navision, you can use "CREATEINSTREAM" and "CREATEOUTSTREAM". Just lookup the Navision help to see how they work and code examples.
Certified Navision Attain Developer
but
alert message are prompt out
"Overflow under type conversion of text to text
Value: C:\.....doc"
3q
2. fill in the interaction template
3. create new contact number
4. click the look up button in attachment field of contact number.
alert message pop out.
"This message is for C/AL programmers:
Could not invoke the member Active Window. The OLE control or Automation server returned an unknown"
How to solve this problem?
thx in advance..