Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

query is changing after super method in Execute query

(1) ShareShare
ReportReport
Posted on by 434
Hi,
 
In the execute query method, the query is changed after the call to the super method of the execute query. Why is it happening?. Refer to the below screenshots. I have written code to sort by prodDate in the Init method of the form. After the execute query it is sorting by the BatchID. Need you assistance in this.
 
Before Super method:
 
 
After super method:
 
 
Thanks,
Ram
 
  • Ram Kumar Profile Picture
    Ram Kumar 434 on at
    query is changing after super method in Execute query
    Hi Mohamed,
     
    Here is the code in executequery.
    void executeQuery()
    {
        QueryBuildDataSource    qbds = this.query().dataSourceNo(1);
        FieldId                 fieldId;
        ItemId                  itemId;
        InventModelGroupItem _inventmodelgroupitem;
        InventModelGroup      inventmodelgroup;
        InventTable          InventTable;
        DataAreaId           datacompany;
        if (#PdsShelfEnabled)
        {
            itemId = inventDimFormSetup.callerItemId();
        }
    
        fieldId = inventDimFormSetup.callerItemFieldId();
        if (fieldId)
        {
            if (! qbds.dynalinkCount())
            {
                qbds.addDynalink(
                    fieldNum(InventBatch,ItemId),
                    inventDimFormSetup.callerItemIdFormDatasource().cursor(),
                    fieldId);
            }
        }
        else
        {
            if (inventDimFormSetup.hasCallerItemId())
            {
                qbds.addRange(fieldNum(InventBatch,ItemId)).value(queryValue(inventDimFormSetup.callerItemId()));
            }
        }
    
        if (#PdsShelfEnabled)
        {
            if (inventDimFormSetup
                && itemId
                && InventTable::find(itemId).pdsCheck())
            {
                qbds.sortClear();
                if (InventTable::find(itemId).modelGroup().PdsPickCriteria == PdsPickCriteria::ExpiryDate)
                {
                    qbds.addSortField(fieldNum(InventBatch,ExpDate));
                }
                else
                {
                    qbds.addSortField(fieldNum(InventBatch,PdsBestBeforeDate));
                }
    
                qbds.addSortField(fieldNum(InventBatch,InventBatchId));
            }
        }
    
        super();
       
    }
     
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 10,169 Super User 2024 Season 2 on at
    query is changing after super method in Execute query
    Hi @Ram,
     
    Can you please share with us all the code in executeQuery method ?
     
    Best regards,
    Mohamed Amine MAHMOUDI

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