SBX - Search With Button

SBX - Forum Post Title

Error message is coming while opening the update order line - " Function PurchTable2LineField.getFieldDescription has been used incorrectly. (D365FO)

Dynamics 365 for Finance and Operations Forum

Start ax asked a question on 13 Jun 2019 6:18 AM
My Badges

Question Status

Unanswered

Hello everyone,

Error message is coming while opening the update order line - " Function PurchTable2LineField.getFieldDescription() has been used incorrectly.

Navigation - Procurement and sourcing < Setup < Procurement and sourcing parameters < General.

The code I have written is :

[ExtensionOf(classStr(PurchTable2LineField))]
final class PurchTable2LineField_Extension
{
    protected FieldLabel getFieldDescription(FieldId _fieldId)
    {
        FieldLabel description;
        description = next getFieldDescription(_fieldId);
        switch (_fieldId)
        {
            case fieldnum(PurchTable, PreparationDate) :
                return fieldId2PName(tableNum(PurchLine), fieldNum(PurchLine, PreparationDate));
                break;
        }
        return description;
    }
}
Reply
Start ax responded on 13 Jun 2019 11:35 AM
My Badges

Hi,

Anyone suggest me how to stop next call for _fieldID = PreparationDate.

In debug i found for every fieldID,  description = next getFieldDescription(_fieldId); is called. When PreparationDate is comming it throw error from description = next getFieldDescription(_fieldId);

Reply

There is delegate given getFieldDescriptionDelegate exactly for the purpose you are trying . Did you try to  implement that ?

Reply
Start ax responded on 13 Jun 2019 12:58 PM
My Badges

Hi Sukrut,

Not tried . Can you share any example to implement delegate.

Thanks

Reply
Start ax responded on 17 Jun 2019 3:08 AM
My Badges

Hi Sukrut,

Thanks for suggestions.

I written delegate  subscribe  method in class  and called that method in my extended  method. But still i am receiving same error

Reply

SBX - Two Col Forum

SBX - Migrated JS