Showing posts with label Display and Edit Method. Show all posts
Showing posts with label Display and Edit Method. Show all posts

Tuesday, November 16, 2021

Add symbol icons to the Grid in Dynamics 365FO

 

    We see how to add symbol icons to the grid in Dynamics 365FO. I have to add icons to the records based on qty. 


For this, 

1. I have created a display method on my table.     

    [SysClientCacheDataMethod(true)]
    public display container logo()
    {
        ImageReference          imageReference;
        container               image;
        
        
        //imageReference = ImageReference::constructForSymbol(
				this.QtyAvailable mod 2 ? 'GreenCheck' : 'RedX');
				
        str name = this.QtyAvailable mod 2 ? 'GreenCheck' : (
				this.QtyAvailable mod 3 ? 'YellowTriangle': 'RedX');
        imageReference = ImageReference::constructForSymbol(name);

        if (imageReference)
        {
            image = imageReference.pack();
        }

        return image;
    }

2. Created new Form image control in the form grid and set up the properties for that control.





Symbols:
  • GreenCheck
  • YellowTriangle
  • RedX
  • GreenCircle
  • RedDiamond
  • BlueSquare
  • RedSquare
  • GreenSquare
  • OrangeSquare
  • GreenSquare
  • YellowSquare
  • TemporaryUser
  • EditEvent
  • YellowExclamationPoint
We can use the above symbols as per our requirements.

Reference: https://www.avantiico.com/adding-symbol-font-icons-to-a-grid-in-dynamics-365-for-finance-and-operations-enterprise-edition/

Keep Daxing!!

Monday, December 7, 2020

Display and Edit methods in D365 FO


 Hi guys, Today we see How to add the Display method, Edit method In the standard Table Using COC in D365 FO / AX 7.


Check Below Example:


[ExtensionOf(tableStr(CustGroup))]

final class CustGroup_Extension

{

    [SysClientCacheDataMethod(true)]

    display Name displayName()

    {

        return this.CustGroup + ' ' + this.PaymTermId;

    }


    Edit Name editName(boolean _set, Name _name)

    {

        Name            name    = _name;

        CustDemo        custDemo;

        ;

        if(_set)

        {

            if(name)

            {

                ttsbegin;

                custDemo = CustDemo::find(this.CustGroup,true);

                custDemo.Name  = name;

                custDemo.update();

                ttscommit;

            }

        }

        else

        {

            name    = CustDemo::find(this.CustGroup).Name;

        }

        return name;

    }

}

Create a new field in the grid. Set the data source and data method properties.

Extension methods are not visible using the drop-down,   so you use a special syntax with the style ExtensionClassName::DisplayMethod.

Keep Daxing!!