Technical configuration

14- How to create an Extension fields

Objective

The App Extension Field functionality is used to define additional field names for the Business Trip request type. These fields must be configured in the Self-Service module under the Extension Fields screen. Once configured, users will be able to view all the defined extension fields within the Business Trip request in our ESS D365 mobile app.

Prerequisites

  • The user must have access to the Microsoft Dynamics 365 Finance and Operations development environment.
  • The user must be assigned the System Administrator role in Microsoft Dynamics 365 Finance and Operations to access and configure the App Extension Fields.
  • The Dynamics ESS 365 application must have access to the configured extension fields in the Business Trip Request to display them within the mobile application.
  • The customer must have their own model, with a reference to the MPayroll

Extension field setup configuration

  • Navigate to Self-services > App extension > Extension fields.
  • Click New and select Business trip as the request type.
  • Click New Line to add the required extended field names for the Business trip request.
  • All added extension fields will be available for users to view, create, and edit within the Business trip request.

Note:

  1. The Mapping Lookup button will be enabled only when the field action is set to Lookup. Users can add additional fields within the mapping lookup configuration.
  2. The Text field action is not supported for the Enum data type.

Add a custom logic to the mapping lookup field

If the Custom Logic checkbox is enabled for the mapping lookup, the user must provide the corresponding extension code for the required customization.

[ExtensionOf(classStr(SDSLookupDC))]
internal final class SDSLookupDC_Extension
{
    public static SDSLookupListDC lookupCustomerLogic(STSRequestType _requestType,
                                                     str             _extendedName,
                                                     str             _parm1 ,
                                                     str             _parm2 ,
                                                     str             _parm3 ,
                                                     str             _parm4 ,
                                                    DataAreaId      _dataAreaid ,
                                                    LanguageId      _languageId ,
                                                    SDSLookupListDC  _lookupList )
    {
        SDSLookupDC contract;
        SDSLookupListDC           list = next lookupCustomerLogic( _requestType,
                                                                 _extendedName,
                                                                  _parm1,
                                                                  _parm2 ,
                                                                  _parm3 ,
                                                                  _parm4 ,
                                                                _dataAreaid,
                                                                _languageId ,
                                                                _lookupList );
      // _parm1 , _parm2 , _parm3, _parm4 , will use to filter data from your logic.
        if (_requestType == STSRequestType::BusinessTrip)
        {
            if (_extendedName == fieldId2Name(tableNum(SDSBusinessTripRequest), fieldNum(SDSBusinessTripRequest, Enable_TestModel)))
            {
                MPTravelSource travelSource;
                while select travelSource
                {
                    contract = SDSLookUpDC::newFromTableRecord(travelSource.CountryID,travelSource.CountryDescription);
                    _lookupList.addToList(contract);
                }
            }
        }
        return _lookupList;
    }
}