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>



 

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 AdSense units and "buy me a coffee" link.
Join us.

Blog Tags