Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

How to open picture using automation in NAV 2009R2

Posted on by Microsoft Employee

Hi Experts,

  Earlier, I could  opened picture using Hyperlink(URL) function in NAV 2009R2.

Right Now, my requirement is:- whenever user is going to delete that picture, I need to show the error message.

So,  I thought this requirement  can be reached using automation.But I don't know which automation need to use.

Any one have suggestions...welcome.

Thanks in Advance.

   

*This post is locked for comments

  • Verified answer
    keoma Profile Picture
    keoma 32,675 on at
    RE: How to open picture using automation in NAV 2009R2

    for running external programs or documents/images, which can be opened by a default app you can use System.Diagnostics.Process

    community.dynamics.com/.../executing-external-programs

    to check if the file/image exists, you can use command EXISTS

    or .net class System.IO.FileInfo

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to open picture using automation in NAV 2009R2

    Hi Suresh Kulla,

     Thank you for your response.

    on the above post, I mentioned the code.

    If user click on ViewDrawing Menuitem  on the item card image will be opened, at this point if user going to delete the opened picture i need to throw a meessage.

    How can i achieve this requirement. Please let me know...

    Through automation or file handling through commands or anything.

    If you have any suggestions...welcome.

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: How to open picture using automation in NAV 2009R2

    Are you asking if somebody delete the picture manually from the shared folder do you want to throw a message ? How the users delete the picture from NAV ? Are you not using a picture field to store the picture like standard NAV does on the company information ?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to open picture using automation in NAV 2009R2

    Hi Jonathan Archer,

      Thank for your response.

    Actually,  Image is not accessed from item table...

    ....on the item card we added menu item =>ViewDrawing=>In ViewDrawing onpush trigger we called showpicture function(which has defined in item table).

    In showpicture function code as follows

    {

     MfgSetup.GET;

     ItemNo := "No.";

     HYPERLINK(MfgSetup."Drawings Path" + FilterItemNo(ItemNo) + '.bmp');

    }  

    where MfgSetup."Drawings Path" := \\Servername\NAV\Path\

    This is Earlier Code...

    Right now my issue is.........The picture is not existed in nav, it is accessed from external folder.

    I could open using "'Microsoft Shell Controls And Automation'.Shell" automation variable.

    I didn't find any method to fired when deletion occured in that autoamtion variable.

    After opening image it's under os control.

    So I need automation variable regarding Picture actions(open,save,delete) manageable.

    If any automation variable existing like that...please let me know.

    Thanks once again.  

  • Suggested answer
    keoma Profile Picture
    keoma 32,675 on at
    RE: How to open picture using automation in NAV 2009R2

    that needs a customization in form 346 "Item Picture". edit that form, then edit menu "Picture" / menubutton "Delete" and show the c/al code.

    <Control5> - OnPush()

    IF Picture.HASVALUE THEN

     IF CONFIRM(Text002,FALSE,TABLECAPTION,"No.") THEN BEGIN

       CLEAR(Picture);

       CurrForm.SAVERECORD;

     END;

    you could remove lines 2 - 5 and replace by

    error('delete not allowed');

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to open picture using automation in NAV 2009R2

    Hi Jonathan Archer,

      I am using classic client, and after image open, if user click on delete i need to stop the deletion of image. Instead of deletion i need to show the error message.

    Image is opened without any error.

  • keoma Profile Picture
    keoma 32,675 on at
    RE: How to open picture using automation in NAV 2009R2

    do you use classic client or RTC (windows client)?

    is your need to delete the item image and when doing that you want a confirmation?

    or you use links and ... the image in the file share was removed and when click on the link in navision you get an error message?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to open picture using automation in NAV 2009R2

    Hi Jonathan Archer,

     Thank you for your response.

    The Picture saves in Share folder.Also it is Item Picture.

  • keoma Profile Picture
    keoma 32,675 on at
    RE: How to open picture using automation in NAV 2009R2

    where is the picture saved, on the file system, net share or on the web?

    do you mean item picture or customer picture ?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans