...
ServContractLine.SETRANGE("Service Item No.",ServItem."No.");
ServContractLine.SETRANGE("Contract Status",ServContractLine."Contract Status"::Signed);
ServContractLine.SETRANGE("Contract Type",ServContractLine."Contract Type"::Contract);
ServContractLine.SETRANGE("Customer No.",ServHeader."Customer No.");
ServContractLine.SETFILTER("Starting Date",'<=%1',ServHeader."Order Date");
// Delete the following line.
ServContractLine.SETFILTER("Contract Expiration Date",'>%1 | =%2',ServHeader."Order Date",0D);
// End of the deleted line.
ServContractLine.FILTERGROUP(0);
IF ServContractLine.FIND('-') THEN
IF ServContractLine.NEXT > 0 THEN BEGIN
IF CONFIRM(Text047,TRUE,"Service Item No.") THEN BEGIN
...
...
ServContractLine.SETRANGE("Service Item No.",ServItem."No.");
ServContractLine.SETRANGE("Contract Status",ServContractLine."Contract Status"::Signed);
ServContractLine.SETRANGE("Contract Type",ServContractLine."Contract Type"::Contract);
ServContractLine.SETRANGE("Customer No.",ServHeader."Customer No.");
ServContractLine.SETFILTER("Starting Date",'<=%1',ServHeader."Order Date");
// Add the following line.
ServContractLine.SETFILTER("Contract Expiration Date",'>=%1 | =%2',ServHeader."Order Date",0D);
// End of the added line.
ServContractLine.FILTERGROUP(0);
IF ServContractLine.FIND('-') THEN
IF ServContractLine.NEXT > 0 THEN BEGIN
IF CONFIRM(Text047,TRUE,"Service Item No.") THEN BEGIN
...
...
ServContractLine.SETRANGE("Contract Type",ServContractLine."Contract Type"::Contract);
ServContractLine.SETRANGE("Customer No.",ServHeader."Customer No.");
ServContractLine.SETRANGE("Service Item No.","Service Item No.");
ServContractLine.SETRANGE("Contract Status",ServContractLine."Contract Status"::Signed);
ServContractLine.SETFILTER("Starting Date",'<=%1',ServHeader."Order Date");
// Delete the following line.
ServContractLine.SETFILTER("Contract Expiration Date",'>%1 | =%2',ServHeader."Order Date",0D);
// End of the deleted line.
ServContractLine.FILTERGROUP(0);
ServContractList.SETTABLEVIEW(ServContractLine);
ServContractList.LOOKUPMODE(TRUE);
IF ServContractList.RUNMODAL = ACTION::LookupOK THEN BEGIN
ServContractList.GETRECORD(ServContractLine);
...
...
ServContractLine.SETRANGE("Contract Type",ServContractLine."Contract Type"::Contract);
ServContractLine.SETRANGE("Customer No.",ServHeader."Customer No.");
ServContractLine.SETRANGE("Service Item No.","Service Item No.");
ServContractLine.SETRANGE("Contract Status",ServContractLine."Contract Status"::Signed);
ServContractLine.SETFILTER("Starting Date",'<=%1',ServHeader."Order Date");
// Add the following line.
ServContractLine.SETFILTER("Contract Expiration Date",'>=%1 | =%2',ServHeader."Order Date",0D);
// End of the added line.
ServContractLine.FILTERGROUP(0);
ServContractList.SETTABLEVIEW(ServContractLine);
ServContractList.LOOKUPMODE(TRUE);
IF ServContractList.RUNMODAL = ACTION::LookupOK THEN BEGIN
ServContractList.GETRECORD(ServContractLine);
...