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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Unanswered

Add field EcoResProductCreate Form

(0) ShareShare
ReportReport
Posted on by 4
Hi, I would like to add the description field from EcoResProductTranslation table in EcoResProductCreate form
 
I extended this method to map the field to EcoResProductTranslation table.
    protected void createData2Controls()
    {
        next createData2Controls();
        data2Controls = conIns(data2Controls,
                                conLen(data2Controls) + 1,
                                [tableStr(EcoResProductTranslation), [[fieldNum(EcoResProductTranslation, Description), formControlStr(EcoResProductCreate, WTIProductDescription)]]]);
    }

I get this error: Function EcoResProductCreate.getBufferByDataSourceName has been incorrectly called.

This is where I'm blocked. I want to add this table in switch case of getBufferByDataSourceName method, but this method is private, I can't extend it.

Any help or ideas would be really appreciated, 
 
thanks!
Claudia
 
I have the same question (0)
  • Community member Profile Picture
    4 on at
    Ok the solution to this was to use the delegate method in the switch case (default case)
                default:
                    EventHandlerResult result = new EventHandlerResult();
                    this.getBufferByDataSourceNameDelegate(_formDataSourceName, _itemId, _forUpdate, result);
                    if (!result.hasResult())
                    {
                        throw error(Error::wrongUseOfFunction(funcName()));
                    }
                    common = result.result();

    We need to create a subscribed method

    1- create a class
    2- Add a subscribe method, that subscribes to getBufferByDataSourceNameDelegate delegate
     
        [SubscribesTo(formStr(EcoResProductCreate), delegateStr(EcoResProductCreate, getBufferByDataSourceNameDelegate))]
        public static void EcoResProductCreate_getBufferByDataSourceNameDelegate(str _formDataSourceName, ItemId _itemId, boolean _forUpdate, EventHandlerResult _result)
        {
            EcoResProduct               ecoResProduct;
            select RecId from ecoResProduct
                where ecoResProduct.DisplayProductNumber == _itemId;
            if(ecoResProduct)
            {
                EcoResProductTranslation    ecoResProductTranslation = EcoResProductTranslation::findByProductLanguage(ecoResProduct.RecId,companyinfo::languageId(),_forUpdate);
                _result.result(ecoResProductTranslation);
            }
        }

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Mallesh Deshapaga Profile Picture

Mallesh Deshapaga 1,072

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 214 Super User 2026 Season 1

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 131 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans