Question Status

Suggested Answer
Pranav Kumar asked a question on 24 Apr 2012 11:32 PM
Hi All,
 
We have come across a strange error on just modifying a PO. A PO was created with 8 lines and a line was revised and the same line deleted successfully confirmed. However when the user attempts to create a new line, system is throwing as error
 
“Cannot edit a record in purchase line history (Purchlinehistory). Invalid value specified for ‘Exprration’.  It has to be less than the expiration of next record.”
 
On the PurchLineHistory table, we see the deleted line (and its versions) and has a value in the ValidTo column. All other PO lines hold the value “Never”. What we are not able to figure out is what caused the change of the value in that column to a specific date. Tried recreating the issue, but in vain. The only solution we have found so far is by deleting the problem records in the PurchLineHistory table.
 
Has anyone encountered this problem before? This was a very normal PO modification that happens realistically.
 Thanks,
Pranav
Reply
Suggested Answer
Debra Demske responded on 28 Apr 2012 6:55 AM

We found that the resolution is to delete the record from purchlinehistory table and it will allow you to edit the purchase line.

Debra

Reply
Suggested Answer
Jessica Swartz responded on 30 Apr 2013 7:35 AM

I just got a hotfix from Microsoft.  It's apparently not publicly available yet so you have to open a support case to get it.  Hope this helps!

Reply
Suggested Answer
Rahul Sharma responded on 3 Oct 2013 1:39 PM

You should be able to get around with this by changing first update_recordset statement in \Classes\VersioningPurchaseOrder\archivePurchLine. I added one more where clause so that AX does not try to update lines with max date value.

update_recordset purchLineHistory  

setting ValidTo = prevVersionValidTo

exists join purchLine

where purchLine.InventTransId == purchLineHistory.InventTransId

               && purchLine.PurchId == purchTable.PurchId

               && purchLine.IsDeleted

               && purchLine.IsModified

               && purchLineHistory.ValidTo == DateTimeUtil::maxValue();//skip lines with max date values

View Fan Page on Facebook

Reply
Suggested Answer
Wim Van hoorde responded on 3 Feb 2014 1:09 AM

The hotfix number is wrong. You need fixing using  KB2901696. See Lifecycle services for additional details.

Reply
Debra Demske responded on 27 Apr 2012 1:26 PM

Hi Pranav,

I'm experiencing the same issue.  Have you made any headway?

Debra

Reply
Suggested Answer
Debra Demske responded on 28 Apr 2012 6:55 AM

We found that the resolution is to delete the record from purchlinehistory table and it will allow you to edit the purchase line.

Debra

Reply
Pranav Kumar responded on 28 Apr 2012 11:48 PM

Hi Debra,

This workaround in allready we are following.. but this is not solution. Asking client to delete record from backend is not suggested.

:(

Pranav

Reply
Andy Adamak responded on 18 Jan 2013 7:06 AM

We are having the same issue... any idea what causes this, or an update on how to resolve it?

Reply
Debra Demske responded on 18 Jan 2013 7:15 AM

I'm still deleting the records.  I've only seen it happen a couple of times.  I think it is caused when a change is made, but it runs a long time and the user kills the session.

Reply
Tushar Joshi responded on 2 Apr 2013 10:04 AM

I have came across a similar situation when dealing with Intercompany orders. There are two legal entities in this scenario. One legal entity creates actual SO for external customer and using intercompany and direct delivery features of standard AX the linked intercompany PO and SO are created, when end user tries to update Unit price in original SO for external customer they come across the same error:

“Cannot edit a record in purchase lines history. Invalid value specified for expiration. It has to be less than the 'Expiration' of the next record.”

We can not ask client to delete the records from Production environment as it runs into compliance issues for having developer accessing LIVE environment.

Does anyone know a solution/fix for this? is it a bug that needs a hotfix from MS?

-Tushar

Reply
Suggested Answer
Jessica Swartz responded on 30 Apr 2013 7:35 AM

I just got a hotfix from Microsoft.  It's apparently not publicly available yet so you have to open a support case to get it.  Hope this helps!

Reply
Debra Demske responded on 1 May 2013 6:50 AM

Thanks Jessica!

Reply
SomuAx2012 responded on 11 Jul 2013 2:23 PM

Can you please post the KB article number. That would help me in sending a request to microsoft for hotfix.

Reply
Ashutosh Kumar responded on 17 Sep 2013 9:52 AM

It is a known Microsoft bug, which seems to be fixed in CU-4. For previous versions, i requested a Hot-fix using the "KB#2730201".

Reply
Suggested Answer
Rahul Sharma responded on 3 Oct 2013 1:39 PM

You should be able to get around with this by changing first update_recordset statement in \Classes\VersioningPurchaseOrder\archivePurchLine. I added one more where clause so that AX does not try to update lines with max date value.

update_recordset purchLineHistory  

setting ValidTo = prevVersionValidTo

exists join purchLine

where purchLine.InventTransId == purchLineHistory.InventTransId

               && purchLine.PurchId == purchTable.PurchId

               && purchLine.IsDeleted

               && purchLine.IsModified

               && purchLineHistory.ValidTo == DateTimeUtil::maxValue();//skip lines with max date values

View Fan Page on Facebook

Reply
Suggested Answer
Wim Van hoorde responded on 3 Feb 2014 1:09 AM

The hotfix number is wrong. You need fixing using  KB2901696. See Lifecycle services for additional details.

Reply