web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

How to open picture using automation in NAV 2009R2

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • keoma Profile Picture
    32,729 on at

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

    do you mean item picture or customer picture ?

  • Community Member Profile Picture
    on at

    Hi Jonathan Archer,

     Thank you for your response.

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

  • keoma Profile Picture
    32,729 on at

    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
    on at

    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.

  • Suggested answer
    keoma Profile Picture
    32,729 on at

    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
    on at

    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
    Suresh Kulla Profile Picture
    50,247 Super User 2025 Season 2 on at

    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
    on at

    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.

  • Verified answer
    keoma Profile Picture
    32,729 on at

    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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans