How to change the shipment date on change of posting date

Markandey_PandeyMarkandey_Pandey Member Posts: 178
Hi all

I want to change the shipment date as soon as i change the posting date on sakes order, so that i dont have to change the shipment date manualy.

can anybody help me
Markandey Pandey

Comments

  • lvanvugtlvanvugt Member Posts: 774
    Changing the Posting Date will also change the Document Date. Did you have a look at the code in the OnValidate-trigger of the field Posting Date how this is achieved?

    PS: be sure that doing it in a similar way for the Shipment Date that calling the OnValidate-trigger of Shipment Date makes sense.
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • Markandey_PandeyMarkandey_Pandey Member Posts: 178
    lvanvugt wrote:
    Changing the Posting Date will also change the Document Date. Did you have a look at the code in the OnValidate-trigger of the field Posting Date how this is achieved?

    PS: be sure that doing it in a similar way for the Shipment Date that calling the OnValidate-trigger of Shipment Date makes sense.

    i am not able to find any code under onValidate trigger of Posting Date.

    Can u guide me plz
    Markandey Pandey
  • lvanvugtlvanvugt Member Posts: 774
    Open table 36 in design mode and search for Posting Date field (field 20). Open C/Al editor (F9) and see the code of the OnValidate-trigger of Posting Date field:
    Posting Date - OnValidate()
    TestNoSeriesDate(
      "Posting No.","Posting No. Series",
      FIELDCAPTION("Posting No."),FIELDCAPTION("Posting No. Series"));
    TestNoSeriesDate(
      "Prepayment No.","Prepayment No. Series",
      FIELDCAPTION("Prepayment No."),FIELDCAPTION("Prepayment No. Series"));
    TestNoSeriesDate(
      "Prepmt. Cr. Memo No.","Prepmt. Cr. Memo No. Series",
      FIELDCAPTION("Prepmt. Cr. Memo No."),FIELDCAPTION("Prepmt. Cr. Memo No. Series"));
    
    VALIDATE("Document Date","Posting Date");
    
    IF ("Document Type" IN ["Document Type"::Invoice,"Document Type"::"Credit Memo"]) AND
       NOT ("Posting Date" = xRec."Posting Date")
    THEN
      PriceMessageIfSalesLinesExist(FIELDCAPTION("Posting Date"));
    
    IF "Currency Code" <> '' THEN BEGIN
      UpdateCurrencyFactor;
      IF "Currency Factor" <> xRec."Currency Factor" THEN
        ConfirmUpdateCurrencyFactor;
    END;
    
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • Markandey_PandeyMarkandey_Pandey Member Posts: 178
    Thanx,

    i got it.
    Markandey Pandey
Sign In or Register to comment.