Hi all,
I have a strange problem when I try to modify date.
Code in Sales Header Table (VAT Settlement Date field - OnValidate trigger) looks as below.
The problem is that once I change Date in Header everything is OK, sales line are corrected also. But sometimes first line is not validated (but Message in code shows correct value). These are two identical situations, I always change only date in Header in the same Sales Order.javascript:emoticon(':-k')
Think
What can be a reason of this? Is there any mistake in code?javascript:emoticon(':?')
Confused
add_day is an Integer
Code:
VAT Settlement Date - OnValidate()
SalesLine.RESET;
SalesLine.SETRANGE("Document Type","Document Type");
SalesLine.SETRANGE("Document No.","No.");
IF SalesLine.FIND('-') THEN
REPEAT
BEGIN
VATProductPostingGroup.GET(SalesLine."VAT Prod. Posting Group");
SalesLine.VALIDATE("VAT Settlement Date","VAT Settlement Date"+VATProductPostingGroup.add_day);
SalesLine.MODIFY;
MESSAGE('new date: '+ FORMAT(SalesLine."VAT Settlement Date"));
END;
UNTIL SalesLine.NEXT = 0;
Best regards.
0
Comments
For any queries you can also visit my blog site: http://msnavarena.blogspot.com/