Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

Can't import excel wmsLocation in formula coproducts v2

(1) ShareShare
ReportReport
Posted on by
I have added /ReceivingLocationId/ to fromula coproducts v2 entity  entity however I noticed that the location data can be exported but I cannot import these values. After searching I found this question so similar but nobody answered it. I Think I should fill map field to in InventInventoryDimensionEntityFieldsMapping but because it is extension I cannot. Do you have any solution?
 
  • Verified answer
    Can't import excel wmsLocation in formula coproducts v2
    [ExtensionOf(tableStr(PmfFormulaCoProductV2Entity))]
    final class PmfFormulaCoProductV2EntityOAB_Extension
    {
         public void mapEntityToDatasource(DataEntityRuntimeContext _entityCtx, DataEntityDatasourceRuntimeContext _dataSourceCtx)
        {
            next mapEntityToDatasource(_entityCtx, _dataSourceCtx);

            switch (_dataSourceCtx.name())
            {
                case dataEntityDataSourceStr(PmfFormulaCoProductV2Entity, FormulaCoProduct):
                    PmfFormulaCoBy coProduct = _dataSourceCtx.getBuffer() as PmfFormulaCoBy;
                    InventDim inventDim = InventDim::find(coProduct.InventDimId);
                    inventDim.wMSLocationId = this.wMSLocationId;
                    coProduct.InventDimId = InventDim::findOrCreate(inventDim).inventDimId;
                    break;
            }
        }
    Thanks  , for suggestion , it worked
  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,371 Most Valuable Professional on at
    Can't import excel wmsLocation in formula coproducts v2
    InventDim data source is read-only, which is correct, because you can't simply change a value in InventDim table. When you want a different combination of inventory dimensions, you need to find or create a different record in InventDim.
     
    I also don't think you can change the mapping in an extension, but you surely have some options. For example, you can use CoC to extend mapEntityToDataSource(). You'll let the system to assign InventDimId from the mapped dimensions, but then you'll take the other dimensions into account, find/create a new InventDimId and assign it to coProduct.InventDimId.
  • Can't import excel wmsLocation in formula coproducts v2
    its bound to inventdim datasource already available in entity
    entity name is PmfFormulaCoProductV2Entity
  • Martin Dráb Profile Picture
    Martin Dráb 230,371 Most Valuable Professional on at
    Can't import excel wmsLocation in formula coproducts v2
    You said you added the field, but not what the entity field is bound to. Please add this information.
     
    By the way, what is the AOT name of the entity?

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,642 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans