Sales order Posting is throwing error suddenly this morning

Latest Axapta / Dynamics AX FAQ Pages

Get our Free Newletter

Don't you have the time to be online here at DUG every day? So how do you follow what is going on in the Dynamics industry and community?
If you subscribe to the DUG Newsletter then you can relax! We will make sure that you don't miss the big news!

Check out our
Newsletter Subscription Center
page a complete list of our different newsletters.

Solution (Not Verified) This post has 0 verified solutions | 5 Replies | 2 Followers

Male
58 Posts
542 Points
Joined: 2011-11-29
Last Online:
2014-8-29 21:30
Location: West des moines , USA
Shankar posted on 2012-3-23 17:21

Hi All,

            I am trying to Post a Sales order confirmation in Ax 2009 and suddenly this morning i am getting an error

Cannot create a record in Sales order header - Updating table (SalesParmSubTable).  The record already exists.

This is happening in method SalesFormLetter.

protected void recordInsertListInsert()
{
    recordInsertSalesParmTable.insertDatabase();
    recordInsertSalesParmSubTable.insertDatabase();
    recordInsertSalesParmLine.insertDatabase();
    this.removeRecIdSuspension();

}

The first call recordInsertSalesParmTable.insertDatabase() is inserting the recors in SalesParmTable and

SalesParmSubTable and the second call is actually trying to insert only in SalesparmSubTable and is erroring out.

There is no change in the code and  i am trying to find what is causing this error ?

Thanks in advance,

Shankar

 

All Replies

313 Posts
5,487 Points
Joined: 2010-12-8
Last Online:
2014-4-10 18:05
Location: USA
Solution (Not Verified) Alex replied on 2012-3-23 18:36
Suggested by Alex

Something probably crashed and there are orphaned records that are causing a conflict.  Delete out the related records from the salesparmsubtable and salesparmsubline.  They're generated during posting.  You can even delete out the salesparmtable and salesparmline records too and it'll just get it back to scratch.  I'd stick with the related sub tables first and give it a shot.

Male
58 Posts
542 Points
Joined: 2011-11-29
Last Online:
2014-8-29 21:30
Location: West des moines , USA
Shankar replied on 2012-3-23 19:00

Thanks for the reply.

  I tried to look at the associated related tables and coud not find any records in those tables. The only problem i see currently is the insert to SalesParmTable callwhich  is inserting the record in SalesParmTable and SalesparmSubTable also. this is leading to inserting the same record in SalesParmSubTable in the next method call once again. If i comment the second call SalesparmSubsTable.DatabaseInsert() everything is working fine. I dont want to comment that code as i dont know where it will get impacted.

 

313 Posts
5,487 Points
Joined: 2010-12-8
Last Online:
2014-4-10 18:05
Location: USA
Alex replied on 2012-3-23 19:11

I've seen this before and because you aren't doing anything out of the ordinary, I'm still pretty sure you just have some duplicating records.  Try and delete ALL records relating to the posting you're trying to do out of all four of those tables and maybe even check salesparmupdate too.

Whatever you tried to post recently, if you open the posting window, you should see a line with a red "X" icon.  Delete that line first, then close the window, and look for any other records in those parm tables.

Female
7 Posts
53 Points
Joined: 2012-3-16
Last Online:
2013-5-8 16:32
Location: Grand Rapids, US
Holly Coppock replied on 2012-8-29 17:22

Hello - I am now getting this error but the strange thing is that only certain people are getting the error.  I don't believe it has anything to do with security but it doesn't make sense that I can post the picking list but another user gets this error when they try.

How did you resolve it?

 

Female
7 Posts
53 Points
Joined: 2012-3-16
Last Online:
2013-5-8 16:32
Location: Grand Rapids, US
Holly Coppock replied on 2012-8-29 19:03

We ended up rebooting our AOS servers and it resolved the issue.

Page 1 of 1 (6 items) | Get this RSS feed | Bookmark and Share