Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Custom lookup on DataE...
Finance forum

Custom lookup on DataEntity by extension

Posted on by 60

Hello,

i am trying add custom lookup on LedgerJournalLineEntity DataEntity by extension in D365FO. I am able to create the lookup by customisation but i would like to avoid it.

Here is what i have so far:

[ExtensionOf(tableStr(LedgerJournalLineEntity))]
public static class LedgerJournalLineEntity_Extension
{
    [
        SysODataActionAttribute("LedgerJournalLineEntityTextFieldCustomLookup", false),
        SysODataCollectionAttribute("_fields", Types::String),
        SysODataFieldLookupAttribute(fieldStr(LedgerJournalLineEntity, Text))
    ]
    public static str textCustomLookup(Array _fields)
    {
        OfficeAppCustomLookupListResult result = new OfficeAppCustomLookupListResult();
        result.items().value(1, "Value 1");
        result.items().value(2, "Value 2");
        result.items().value(3, "Value 3");
        result.items().value(4, "Value 4");

        return result.serialize();
    }

}

My understanding is that engine expects static method in the entity and i cannot make static method as extension. Or i would expect another attribute to specify entity name where the lookup method belongs.

Do you have any experience with this?

Thank you,

Daniel

  • Custom lookup on DataEntity by extension
    Hi,
    we have the same issue. Has anyone been able to resolve this?
     
    Thank you!
  • Suggested answer
    Neetu Chamling Profile Picture
    Neetu Chamling 345 on at
    RE: Custom lookup on DataEntity by extension

    Hi All,

    I have similar requirement to create extension of standard data entity and provide filter lookup.

    [

        SysODataActionAttribute("VendorInvoiceLineEntityBPGProjIdLookup", false),

        SysODataCollectionAttribute("_fields", Types::String),

        SysODataFieldLookupAttribute(fieldStr(VendorInvoiceLineEntity, BPGProjId))

       ]

    Provided annotation on extension class method but filtered is not working. not even code is being Hitting.

    any suggestions

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,900 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,275 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans