31 Dec’17

Dynamics 365, EnterpriseAdd custom Table method on Form in D3FOE

Background:

As we know, we can only work with Extension code in D365 Finance and Operations. In this blog article, we will see how we can add a custom display method to a Table and display it on form using Extension.

Steps:

  1. Create a new Class
  2. Add Display method
  3. Display the method on form

1. Create a new Class:

  • Go to Solution Explorer -> Project
  • Right Click -> Select ‘Add new Item’
  • Select Class -> Enter Name. Class name can be anything ending with ‘_Extension’. Eg. <ClassName>_Extension
  • Click Ok

2. Add Display method:

Public Static class CFLoyaltyaddphone_Extension // Class must be static 

{ 

    [SysClientCacheDataMethodAttribute (true)]  //This statement will cache display method 

    public static display LogisticsElectronicAddressLocator CFS_GetPhoneno (RetailLoyaltyCard _this) //Pass Tablename as Parameter 

    { 

        DirpartyTable dirPartyTable; 

        Dirpartylocation dirpartylocation; 

        LogisticsElectronicAddress logisticsElectronicAddress; 

        select * from dirpartylocation 

            where  dirpartylocation.Party == _this.Party 

            join logisticsElectronicAddress  

            where logisticsElectronicAddress.Location == dirpartylocation.Location  

            && logisticsElectronicAddress.IsPrimary == NoYes::Yes  

            && logisticsElectronicAddress.Type == LogisticsElectronicAddressMethodType::Phone ; 

         return logisticsElectronicAddress.locator; //Return Field value                  

    }  

}

3. Display the method on Form:

  • Add the field type on form Design.
  • Change the below property
  • change property

 

Written by

Sohagani Shah

ERP Developer

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Commands to Import .bacpac file to D3FOE SQL Server

    14 May’ 2018

    Introduction: This blog article will explain how to import a .bacpac file to Microsoft SQL Server which is created from ...

    Read more
  • [Solved] – Backspace not working in HTML Web Resources

    11 May’ 2018

    Issue: When we use a HTML web resource in Dynamics 365 CRM forms or even as a separate navigation, we sometimes face is...

    Read more
  • Dynamics 365 Tip: Sending Emails using Unified Interface

    10 May’ 2018

    Introduction: The unified client which was released D365 V9 had a very refreshing UI and lots of features. One of the b...

    Read more
  • Filtering Records on BPF unlike on Form – D365

    10 May’ 2018

    Introduction: Working with D365 is best when you’re trying to use as much OOB stuff as possible. Simplest configurati...

    Read more
  • Filter records in gallery control based on value selected in other gallery control in PowerApps.

    10 May’ 2018

    Introduction: This blog explains how to Filter records in gallery control based on value selected in other gallery cont...

    Read more