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