Attach document at 3.01 version

RachelSoonRachelSoon Member Posts: 202
edited 2005-04-25 in Navision Attain
Hi There,
Any one knows how to attach a document at Navision 3.01?

Scenario:
Attached a Sales.doc at the for a sales order document. How to go about it?

Thank you.

Cheers
Rachel

Comments

  • elmarfvelmarfv Member Posts: 53
    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.

    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.
    Elmar F. Vidisson
    Certified Navision Attain Developer
  • RachelSoonRachelSoon Member Posts: 202
    What is the data type of document pic , how to see the document after successful attach it, where did the document attachment display??
    10s..
    elmarfv wrote:
    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.

    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.
  • elmarfvelmarfv Member Posts: 53
    "Document Pic" is a Boolean field that controls a Bitmat on the form in question. Once the "Document Pic" is True, the pictur changes.

    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.
    Elmar F. Vidisson
    Certified Navision Attain Developer
  • jackiejackie Member Posts: 3
    i have the same problem oso..
    but
    alert message are prompt out
    "Overflow under type conversion of text to text
    Value: C:\.....doc"
    3q
  • jackiejackie Member Posts: 3
    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"

    How to solve this problem?
    thx in advance..
Sign In or Register to comment.