web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

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

Custom lookup on DataEntity by extension

(0) ShareShare
ReportReport
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

I have the same question (0)
  • Suggested answer
    Neetu Chamling Profile Picture
    351 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

  • Vjekoslav Crnkovic Profile Picture
    2 on at
    Custom lookup on DataEntity by extension
    Hi,
    we have the same issue. Has anyone been able to resolve this?
     
    Thank you!

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 > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans