-
Notifications
You must be signed in to change notification settings - Fork 688
Description
Why do you need this change?
We have to create a second version of report 6036 "Create Contract Service Orders" to allow us to create the service orders for contracts for a specific work types.
All the code works in this except 2 lines of code that call procedures in ServContractManagement that are marked as internal
ServContractManagement.CheckServiceItemBlockedForAll("Service Contract Line");
ServContractManagement.CheckItemServiceBlocked("Service Contract Line");
Describe the request
[GB][codeunit][5940][ServContractManagement]
Change the below procedures to be non Internal
#region Service Item Blocked checks
procedure CheckServiceItemBlockedForServiceContract(var ServiceContractLine: Record "Service Contract Line")
var
ServiceItem: Record "Service Item";
begin
if ServiceContractLine."Service Item No." = '' then
exit;
ServiceItem.SetLoadFields(Blocked);
ServiceItem.Get(ServiceContractLine."Service Item No.");
ServiceItem.ErrorIfBlockedForServiceContract();
end;
procedure CheckServiceItemBlockedForAll(var ServiceContractLine: Record "Service Contract Line")
var
ServiceItem: Record "Service Item";
begin
if ServiceContractLine."Service Item No." = '' then
exit;
ServiceItem.SetLoadFields(Blocked);
ServiceItem.Get(ServiceContractLine."Service Item No.");
ServiceItem.ErrorIfBlockedForAll();
end;
# endregion Service Item Blocked checks
# region Item Service Blocked checks
procedure CheckItemServiceBlocked(var ServiceContractLine: Record "Service Contract Line")
var
Item: Record Item;
ItemVariant: Record "Item Variant";
begin
if ServiceContractLine."Item No." = '' then
exit;
Item.SetLoadFields(Blocked, "Service Blocked");
Item.Get(ServiceContractLine."Item No.");
Item.TestField(Blocked, false);
Item.TestField("Service Blocked", false);
if ServiceContractLine."Variant Code" <> '' then begin
ItemVariant.SetLoadFields(Blocked, "Service Blocked");
ItemVariant.Get(ServiceContractLine."Item No.", ServiceContractLine."Variant Code");
ItemVariant.TestField(Blocked, false);
ItemVariant.TestField("Service Blocked", false);
end;
end;
# endregion Item Service Blocked checks
I am not sure why these have been marked as Internal. Many Thanks