KVSMEDDeliveryCallLib#
Procedures#
CreateSalesOrdersWithFilterCode(Code[20], Code[10], Boolean) : Integer#
Summary: Creates sales orders based on a given customer number and filter code. The procedure first initializes the necessary records and report. If the provided filter code is not already present in the KVSMEDCallfromSchedFilter record, a new entry is created with the given filter code and set to default values. If the UseTempDeliveryScheduleCall boolean is true, the procedure checks if a manual care period is allowed and sets the delivery schedule accordingly. Afterward, it sets the filter for the delivery report, sets the range for the customer record based on the provided customer number, and defines the error codes for the delivery schedule. The procedure also configures the error handling and validation dialog visibility based on the 'ShowError' input parameter, and runs the delivery schedule report modally. Finally, it retrieves the list of sales headers generated by the report. A boolean value that determines whether to show error dialogs during the sales order creation process.
procedure CreateSalesOrdersWithFilterCode(CustomerNo: Code[20]; FilterCode: Code[10]; ShowError: Boolean): Integer
Parameters:
CustomerNo
:FilterCode
:ShowError
:
Returns:
CreateSalesOrders(Text, Text, Text, Record KVSMEDCallfromSchedFilter) : Integer#
Summary: This function is used in Scheduled Delivery
procedure CreateSalesOrders(CustomerFilter: Text; ProcessPeriodFilter: Text; DelSchedCallFilter: Text; KVSMEDCallfromSchedFilter: Record "KVSMEDCallfromSchedFilter"): Integer
Parameters:
CustomerFilter
:ProcessPeriodFilter
:DelSchedCallFilter
:KVSMEDCallfromSchedFilter
:
Returns:
GetSalesHeaderList(Record Sales Header) :#
Summary: Retrieves a list of created sales headers and stores them in a temporary table. If no sales headers are found, the procedure exits without performing any actions
procedure GetSalesHeaderList(var TempSalesHeader: Record "Sales Header" temporary):
Parameters:
TempSalesHeader
:
DefDeliveryScheduleCalls(Record KVSMEDDeliveryScheduleCall) : Boolean#
Summary: Defines the delivery schedule calls using the temporary table TempKVSMEDDeliveryScheduleCall. The function returns true if at least one delivery schedule call was found in TempKVSMEDDeliveryScheduleCall table, otherwise false. A temporary record of KVSMEDDeliveryScheduleCall to be used for defining the delivery schedule calls. Returns a Boolean value indicating the success of the operation. Returns false if no delivery schedule call was found in the provided TempKVSMEDDeliveryScheduleCall table. This procedure will delete all existing temporary records in the TempDeliveryScheduleCall table before populating it with the records from TempKVSMEDDeliveryScheduleCall. If no records are found in TempKVSMEDDeliveryScheduleCall table, the function will exit with a return value of false.
procedure DefDeliveryScheduleCalls(var TempKVSMEDDeliveryScheduleCall: Record "KVSMEDDeliveryScheduleCall" temporary): Boolean
Parameters:
TempKVSMEDDeliveryScheduleCall
:
Returns:
Events#
OnCreateSalesOrderBeforeReleaseSalesDoc(Codeunit Release Sales Document, Record Sales Header) :#
[IntegrationEvent(false, false)]
local procedure OnCreateSalesOrderBeforeReleaseSalesDoc(var ReleaseSalesDoc: Codeunit "Release Sales Document"; var SalesHeader: Record "Sales Header"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSMEDDeliveryCallLib", 'OnCreateSalesOrderBeforeReleaseSalesDoc', '', false, false)]
local procedure DoSomethingOnCreateSalesOrderBeforeReleaseSalesDoc(var ReleaseSalesDoc: Codeunit "Release Sales Document"; var SalesHeader: Record "Sales Header")
begin
end;
OnCreateSalesLineOnBeforeAssignAgentAndPhysicianBins(Record Sales Line, Record KVSMEDDeliveryScheduleCall, Boolean) :#
[IntegrationEvent(false, false)]
local procedure OnCreateSalesLineOnBeforeAssignAgentAndPhysicianBins(var SalesLine: Record "Sales Line"; KVSMEDDeliveryScheduleCall: Record "KVSMEDDeliveryScheduleCall"; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSMEDDeliveryCallLib", 'OnCreateSalesLineOnBeforeAssignAgentAndPhysicianBins', '', false, false)]
local procedure DoSomethingOnCreateSalesLineOnBeforeAssignAgentAndPhysicianBins(var SalesLine: Record "Sales Line"; KVSMEDDeliveryScheduleCall: Record "KVSMEDDeliveryScheduleCall"; var IsHandled: Boolean)
begin
end;