Results. The value "DataSourceName" is not found in the map.

Error: Results. The value "DataSourceName" is not found in the map.
Usually happens when adding Name from DirPerson (DirPartyTable) data source joined to HcmWorker_Orderer data source on PurchPurchaseOrderHeaderV2Entity data entity or HcmWorker_OrderResponsible / HcmWorker_OrderTaker data sources on SalesOrderHeaderV3Entity data entity.
Remove the new data source and replace the column with computer one:
/// <summary>
/// Extension Class for PurchPurchaseOrderHeaderV2Entity data entity.
/// </summary>
[ExtensionOf(dataentityviewstr(PurchPurchaseOrderHeaderV2Entity))]
final class VKPurchPurchaseOrderHeaderV2Entity_Extension
{
    public static str getOrdererName()
    {
        DictView    purchaseOrderEntity = new DictView(tableNum(PurchPurchaseOrderHeaderV2Entity));
        str         orderEntityDS       = dataEntityDataSourceStr(PurchPurchaseOrderHeaderV2Entity, HcmWorker_Orderer);

        str sqlQuery = strFmt(@"select %1 from %2 where %3=%4",
                                fieldStr(DirPerson, Name),
                                tableStr(DirPartyTable),
                                fieldStr(DirPartyTable, RecId),
                                purchaseOrderEntity.computedColumnString(orderEntityDS, fieldStr(HcmWorker, Person))
            );

        return sqlQuery;
    }
}
Data entity field:
        <AxDataEntityViewField xmlns=""
            i:type="AxDataEntityViewUnmappedFieldString">
            <Name>VKOrdererName</Name>
            <AllowEdit>No</AllowEdit>
            <AllowEditOnCreate>No</AllowEditOnCreate>
            <ComputedFieldMethod>VKPurchPurchaseOrderHeaderV2Entity_Extension::getOrdererName</ComputedFieldMethod>
            <ExtendedDataType>DirPartyName</ExtendedDataType>
        </AxDataEntityViewField>



Support The Author

 If you found value in what I share, I've set up a Buy Me a Coffee page as a way to show your support.

Buy Me a Coffee

Post a Comment


All Comments


No comments. Be the first one to comment on this post.

Search

About

DaxOnline.org is free platform that allows you to quickly store and reuse snippets, notes, articles related to Dynamics AX.

Authors are allowed to set their own "buy me a coffee" link.
Join us.

Blog Tags