Modifying VAT Setlement date in Sales Line from Sales Header

nukeenukee Member Posts: 5
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.

Comments

  • diptish.naskardiptish.naskar Member Posts: 360
    At least the code seems correct to me..nothing wrong in it, do check the line with the values, zoom in after you have changed the values in the header and see if the same reflects in the line.
    Diptish Naskar
    For any queries you can also visit my blog site: http://msnavarena.blogspot.com/
Sign In or Register to comment.