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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to display Image in grid ?

(0) ShareShare
ReportReport
Posted on by 932

Hi,

 I created method that displays Image in grid :  

public display ImageRes ShowAccessLevelIcon(EUKSecurityMenus  _securitymenus)
{
         
            ImageRes                   imgRef;
        
            ImageListAppl                listAppl;
            listAppl = new ImageListAppl();
            .......
              if(securityTreeNode)
                   imgRef = listAppl.image(element.securityLevelIcon(securityTreeNode.SecurityLevel));
              else
                  
                   imgRef = listAppl.image(#ImageOverlayRedLock);
                
            return imgRef;
              
 }

In the securityLevelIcon , I put this code : 

public ImageRes securityLevelIcon(EUKSecurityLevel securityLevel)
    {

        #ResAppl
        ImageRes resourceId = 0;
        switch (securityLevel)
        {
            case EUKSecurityLevel::NoAccess:
                resourceId = #ImageOverlayRedLock;
                break;
            case EUKSecurityLevel::Read:
                resourceId = #ImageView;
                break;
            case EUKSecurityLevel::Update:
                resourceId = #ImageEdit;
                break;
            case EUKSecurityLevel::Create:
                resourceId = #ImageAdd;
                break;
            case EUKSecurityLevel::Delete:
                resourceId = #ImageFullControl;
                break;
            case EUKSecurityLevel::Access:
                resourceId = #ImageOverlayGreenLock;
                break;
            default:
                resourceId = 0;
                break;
        }
        return resourceId;
    }

When I execute the code , I get  this error :  

"Image 787 does not exist."
I have the same question (0)
  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: How to display Image in grid ?

    The doc page has an example, I will copy paste it here:

    public display container customerImage()
    {     
        ImageReference imgRef;
        container imgContainer = this.Image;
        if(imgContainer == connull())
        {
            // there is no image… the container is null
            // show a generic person outline image
            imgRef = ImageReference::constructForSymbol("Person");
            imgContainer = imgRef.pack();
        }
        return imgContainer;
    }

  • BASMA Profile Picture
    932 on at
    RE: How to display Image in grid ?

    How can I use these symbol ,

    Have you any example?

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: How to display Image in grid ?

    The AOT resource images that existed in AX2012 don't exist anymore in D365FO.

    Instead you can use the Symbol font to display images: docs.microsoft.com/.../symbol-font

    docs.microsoft.com/.../images-form-grid

    You can still add your own images as AOT resources, though.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,352

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 830 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 634 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans