Skip to main content

Notifications

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

No data Is selected by query please help

(0) ShareShare
ReportReport
Posted on by

  // 1 AP
        priceDiscAdmTrans = this.priceDiscAdmTransSiteWise(#Site1, inventTable);
        inventDim = inventDim::find(priceDiscAdmTrans.InventDimId);

        if (priceDiscAdmTrans.RecId)
        {
            this.RLPAP        = priceDiscAdmTrans.OABRLP;
            this.InventSiteAP = inventDim.InventSiteId;
            this.PricePerPcsAP = priceDiscAdmTrans.Amount;
            this.CreatedDateAP = priceDiscAdmTrans.FromDate;
        }

here pricediscadmtrans is being called by function , here debugger is not going inside if condition 

 public PriceDiscAdmTrans priceDiscAdmTransSiteWise(InventSiteId _inventSiteId, InventTable inventTable)// Inventdim inventdim)
    {
        PriceDiscAdmTrans   priceDiscAdmTrans;
        InventDIm           inventDim;

        select firstonly inventDim
            where inventDim.InventSiteId == _inventSiteId;

        select firstonly priceDiscAdmTrans
            where priceDiscAdmTrans.ItemCode        == PriceDiscProductCodeType::Table
                && priceDiscAdmTrans.ItemRelation   == inventTable.ItemId
                && priceDiscAdmTrans.InventDimId    == inventDim.inventDimId
                && (priceDiscAdmTrans.FromDate      <= today()
                && (priceDiscAdmTrans.ToDate        == dateNull()
                || priceDiscAdmTrans.Todate         >= today()));
        //    join inventDIm
        //where inventDIm.inventDimId == priceDiscAdmTrans.InventDimId &&
        //     inventDIm.inventsiteid == _inventSiteId;

        return priceDiscAdmTrans;
    }

here pricediscadmtrans is returning no data

  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: No data Is selected by query please help

    Hi sachin mittal,

    Date range you have added in the select statement for PriceDiscAdmTrans table is confusing.

    Can you tell me the data range where you want to get the data for?

    Also the 1st select statement you have written in InventDim returns a value?

    You need to debug the code and find out which lines in where condition causing them to return priceDiscAdmTrans as empty.

    Just comment out the lines on the where condition one by one and check whether its returning a buffer after commenting.

    Thanks,

    Girish S.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,031 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,868 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans