Quantcast
Channel: SCN : Discussion List - SAP for Mobile
Viewing all articles
Browse latest Browse all 5806

MBO refresh problem

$
0
0

Hello,

I've been developing a sales app with SUP in c# following the Sales Force Automation found in here. After I create a new order, there's a query that's supposed to show a MessageBox with the Sales Document Number but it doesn't. I've figured out why but I don't know how to fix it. Here's the code:

 

Query query = new Query();

                CompositeTest test = new CompositeTest();

                test.SetOperator(CompositeTest.AND);

                test.Add(new AttributeTest("entityKey", SurrogateKey.ToString(), AttributeTest.EQUAL));

                test.Add(new AttributeTest("code", "200", AttributeTest.EQUAL));

                query.SetTestCriteria(test);

               

                List<ILogRecord> logs = SFA_NewDB.GetLogRecords(query);

                if (logs.Count > 0)

                {

                    newOrder.Refresh();

                   

                    foreach (ILogRecord log in logs)

                    {

                                               

                       

                        MessageBox.Show("The Sales Document No is " + newOrder.SD_DOC);

                    }

                }

 

the bolded line is where the problem is. After I synchronize and the sale order is created, the surrogate key in the table that holds the orders changes and when the internal code of the refresh tries to find the line with the former surrogate key, it fails with an internal "Object not found" message.

Ex:

Before sync
     Surrogate key in both tables : 100 018

After sync
     Surrogate key in log table:       100 018  (and also inside the refresh code)

     Surrogate key in sales table:    403 371

 

So, How can I fix this ? or Is it any way to do it?

 

Thanks in advance.


Viewing all articles
Browse latest Browse all 5806

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>