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 :
Microsoft Dynamics AX (Archived)

Issue: - Record Caching happening

(0) ShareShare
ReportReport
Posted on by

I am facing an issue in Dynamics AX 2012.

There is one table  PGLog and having 7 columns in the table.

ConnectionId, Request1, Response1, Request2,Response2,Request3,Response3

Method SaveLog()- Creates the record if connection Id not there or update

1. SaveLog(connectionId, Request1, Response1, null, null,null,null); 

2. SaveLog(connectionId, Request1, Response1, Request2, Response2,null, null);

3. SaveLog(connectionId, Request1, Response1, Request2, Response2, Request3, Response3);

Whenever I call 1.SaveLog() method by passing 3 parameters, I am seeing all other fields updated from the very first record created in the table.

This is simply copying values from a old record, I tried even passing null. This is very strange.

One call 1, values of Request1, Response1 are OK but other values such as Request2, Response2, Request3, Response3 is copied from old record.

One call 2, values of Request1, Response1, Request2, Response2 are OK but other values such as  Request3, Response3 is copied from old record.

One call 3, values of Request1, Response1, Request2, Response2, Request3, Response3 are OK.

*This post is locked for comments

I have the same question (0)
  • Mea_ Profile Picture
    60,286 on at

    Hi Ashraf Ansari,

    I dont have this table in my demo VM so its probably a customization?  Its hard to tell what is happening without seeing actual code of SaveLog method, so could you please share it ?

  • Community Member Profile Picture
    on at

    [SysEntryPointAttribute]

    public boolean SaveMobileApplicationLog(QcMobileAppLogData logData)

    {

       QcMobileAppLog qcMobileAppLog  ;

       // Payment log is added for new request

       if(!QcMobileAppLog::exist(logData.parmMerchantReferenceNo()))

       {

           ttsBegin;

           select QcMobileAppLog;

           qcMobileAppLog.MerchantReferenceNo = logData.parmMerchantReferenceNo();

           qcMobileAppLog.ConnectionId = logData.parmConnectionId();

           qcMobileAppLog.Request1 = logData.parmRequest1();

           qcMobileAppLog.insert();

           ttsCommit;

       }

       else

       {

           // payment log is updated for existing request

           ttsBegin;

               select forUpdate qcMobileAppLog

                   where qcMobileAppLog.MerchantReferenceNo == logData.parmMerchantReferenceNo();

                   qcMobileAppLog.ReceiptNo = logData.parmDataCashReferenceNo()!= "" ? logData.parmDataCashReferenceNo():qcMobileAppLog.ReceiptNo;

                   qcMobileAppLog.Request2 = logData.parmRequest2() != "" ? logData.parmRequest2():qcMobileAppLog.Request2;

                   qcMobileAppLog.Request3 = logData.parmRequest3() != "" ? logData.parmRequest3():qcMobileAppLog.Request3;

                   qcMobileAppLog.Response1 = logData.parmResponse1() != "" ? logData.parmResponse1():qcMobileAppLog.Response1;

                   qcMobileAppLog.Response2 = logData.parmResponse2() != "" ? logData.parmResponse2():qcMobileAppLog.Response2;

                   qcMobileAppLog.Response3 = logData.parmResponse3() != "" ? logData.parmResponse3():qcMobileAppLog.Response3;

               qcMobileAppLog.update();

           ttsCommit;

       }

       return true;

    }

    // When a new record is created the if condition gets executed but I am able to find other values such as Response1, Request2, Response2, Request3, Response3 etc . which are I am not even setting up when the record is created.

  • Verified answer
    Community Member Profile Picture
    on at

    To FIX this issue, I have explicityly updated other values with null and it is working now.

    but my question is still same, why paramaters which are not specified values are copied from the very first record from the table.

     // Payment log is added for new request

       if(!QcMobileAppLog::exist(logData.parmMerchantReferenceNo()))

       {

           ttsBegin;

           select QcMobileAppLog;

           qcMobileAppLog.MerchantReferenceNo = logData.parmMerchantReferenceNo();

           qcMobileAppLog.ConnectionId = logData.parmConnectionId();

           qcMobileAppLog.Request1 = logData.parmRequest1();

           qcMobileAppLog.Response1 = "";

           qcMobileAppLog.Request2 = "";

           qcMobileAppLog.Response2 = "";

           qcMobileAppLog.Request3 = "";

           qcMobileAppLog.Response3 = "";

           qcMobileAppLog.ReprocessedComments = "";

           qcMobileAppLog.insert();

           ttsCommit;

       }

  • Verified answer
    Mea_ Profile Picture
    60,286 on at

    So here is you problem (highlighted)

           ttsBegin;
           select QcMobileAppLog;
           qcMobileAppLog.MerchantReferenceNo = logData.parmMerchantReferenceNo();
           qcMobileAppLog.ConnectionId = logData.parmConnectionId();
           qcMobileAppLog.Request1 = logData.parmRequest1();
           qcMobileAppLog.insert();
           ttsCommit;
    This line select QcMobileAppLog; selects random record and then updates .MerchantReferenceNo, ConnectionId and Request1 , however, all other fields would be taken from that randomly selected record. To fix this issue you need to delete that line and add code to init other fields from parameters.  
  • Community Member Profile Picture
    on at

    that's great, I don't know how come I made this stupid mistake.

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 16

#2
GiacomoRovai Profile Picture

GiacomoRovai 4

#3
Douglas Noel Profile Picture

Douglas Noel 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans