Skip to main content

Notifications

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

Get records from tempDB

Posted on by 15

I want to implement this functionality but vendBalanceProvisionalTmpProcesing is always empty, i know it is empty because it is tempDB :

 while select AccountNum,PostingProfile from vendProvisionalBalanceTmpProcessing
            {
                select sum(AmountCur) from vendTrans
                    where vendTrans.AccountNum == vendProvisionalBalanceTmpProcessing.AccountNum
                    && vendTrans.PostingProfile == vendProvisionalBalanceTmpProcessing.PostingProfile
                    && vendTrans.TransDate >= _fromDate
                    && vendTrans.TransDate <= toDate;
            
                    tempSum += vendTrans.AmountCur;
            
                select sum(AmountMST) from vendTrans
                    where vendTrans.AccountNum == vendProvisionalBalanceTmpProcessing.AccountNum
                    && vendTrans.PostingProfile == vendProvisionalBalanceTmpProcessing.PostingProfile
                    && vendTrans.TransDate >= _fromDate
                    && vendTrans.TransDate <=toDate;
            
                    tempSum+= vendTrans.AmountMST*ledgerParameters.EonExchangeRate;
            
                    tmpValue.Amount = tempSum;
                    tmpValue.AccountNum = vendTrans.AccountNum;
                    tmpValue.PostingProfile = vendTrans.PostingProfile;
                    tmpValue.doInsert();    
            
            }


But there are 2 scenarios where i can access to vendProvisionalBalanceTmpProcessing.AccountNum :

insert_recordset tmpValue
        (AccountNum, PostingProfile, Amount)
        select AccountNum
        from vendProvisionalBalanceTmpProcessing
            group by AccountNum
        join PostingProfile, sum(AmountMST) from vendTrans
            group by PostingProfile
            where vendTrans.AccountNum == vendProvisionalBalanceTmpProcessing.AccountNum
                && vendTrans.PostingProfile == vendProvisionalBalanceTmpProcessing.PostingProfile
                && vendTrans.TransDate < _fromDate;
    update_recordset vendProvisionalBalanceTmpProcessing
        setting OpeningBalance = tmpValue.Amount
        join tmpValue
            where tmpValue.AccountNum == vendProvisionalBalanceTmpProcessing.AccountNum
                && tmpValue.PostingProfile == vendProvisionalBalanceTmpProcessing.PostingProfile;


  • Martin Dráb Profile Picture
    Martin Dráb 230,188 Most Valuable Professional on at
    RE: Get records from tempDB

    Didn't you meant to ask a question?

    If it's not clear to you, you won't find anything a TempDB table buffer if you didn't insert records to the same buffer, or didn't link it with data from another buffer by linkPhysicalTableInstance().

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans