Service Contract - Last preventative maintenance

armela20armela20 Member Posts: 71
Does anyone know at what point the "Last preventative maintenance " date on the Service contract line is updated ???
I would think during the posting of a service order type Maintenance, however I can not seem to find the code.
Any help is appreaciated to help locate where the code that updates the above fields is located.

Thanks

Comments

  • SD-JRSD-JR Member Posts: 94
    Hi

    The update code is in codeunit 5900 (Serv Order MGM) and in the clac contract dates function. It seems fairly useless def does not get updated based on service order type.

    Have reviewed all the key service objects in text and no other mention of this field so no other update source.
    IF ServContractLine.GET(
      ServContractLine."Contract Type"::Contract,
      ServItemLine."Contract No.",
      ServItemLine."Contract Line No.")
    THEN BEGIN
      ServContractLine.SuspendStatusCheck(TRUE);
      IF ServHeader."Finishing Date" <> 0D THEN
        ServContractLine."Last Service Date" := ServHeader."Finishing Date"
      ELSE
        ServContractLine."Last Service Date" := ServHeader."Posting Date";
      ServContractLine."Last Planned Service Date" :=
        ServContractLine."Next Planned Service Date";
      ServContractLine.CalculateNextServiceVisit;
      [color=#FF0000]ServContractLine."Last Preventive Maint. Date" := ServContractLine."Last Service Date";[/color]
    END;
    ServContractLine.MODIFY;
    
    Regards,

    Ger
    Simply Dynamics Ltd
    skype: gf.simplydynamics
    Web: www.simplydynamics.ie
Sign In or Register to comment.