Skip to content

Commit

Permalink
fixed: optional location code
Browse files Browse the repository at this point in the history
  • Loading branch information
plakna committed Oct 3, 2024
1 parent df1be68 commit ce80929
Showing 1 changed file with 25 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ codeunit 6611 "FS Setup Defaults"

FSIntegrationMgt.EnableServiceOrderArchive();
end;

SetCustomIntegrationsTableMappings(FSConnectionSetup);
end;

Expand Down Expand Up @@ -135,6 +135,7 @@ codeunit 6611 "FS Setup Defaults"
FSWorkOrderProduct: Record "FS Work Order Product";
JobJournalLine: Record "Job Journal Line";
CDSCompany: Record "CDS Company";
InventorySetup: Record "Inventory Setup";
CDSIntegrationMgt: Codeunit "CDS Integration Mgt.";
IsHandled: Boolean;
EmptyGuid: Guid;
Expand Down Expand Up @@ -204,12 +205,13 @@ codeunit 6611 "FS Setup Defaults"
IntegrationFieldMapping.Direction::FromIntegrationTable,
'', true, false);

InsertIntegrationFieldMapping(
IntegrationTableMappingName,
JobJournalLine.FieldNo("Location Code"),
FSWorkOrderProduct.FieldNo(WarehouseId),
IntegrationFieldMapping.Direction::FromIntegrationTable,
'', true, false);
if InventorySetup.Get() and (InventorySetup."Location Mandatory") then
InsertIntegrationFieldMapping(
IntegrationTableMappingName,
JobJournalLine.FieldNo("Location Code"),
FSWorkOrderProduct.FieldNo(WarehouseId),
IntegrationFieldMapping.Direction::FromIntegrationTable,
'', true, false);

OnAfterResetProjectJournalLineWOProductMapping(IntegrationTableMappingName);

Expand Down Expand Up @@ -708,6 +710,7 @@ codeunit 6611 "FS Setup Defaults"
ServiceLine: Record "Service Line";
FSWorkOrderProduct: Record "FS Work Order Product";
CDSCompany: Record "CDS Company";
InventorySetup: Record "Inventory Setup";
CDSIntegrationMgt: Codeunit "CDS Integration Mgt.";
EmptyGuid: Guid;
IsHandled: Boolean;
Expand Down Expand Up @@ -771,19 +774,21 @@ codeunit 6611 "FS Setup Defaults"
IntegrationFieldMapping.Direction::Bidirectional,
'', true, false);

InsertIntegrationFieldMapping(
IntegrationTableMappingName,
ServiceLine.FieldNo("Location Code"),
FSWorkOrderProduct.FieldNo(WarehouseId),
IntegrationFieldMapping.Direction::Bidirectional,
'', true, false);

InsertIntegrationFieldMapping(
IntegrationTableMappingName,
ServiceLine.FieldNo("Location Code"),
FSWorkOrderProduct.FieldNo(LocationCode),
IntegrationFieldMapping.Direction::ToIntegrationTable,
'', true, false);
if InventorySetup.Get() and (InventorySetup."Location Mandatory") then begin
InsertIntegrationFieldMapping(
IntegrationTableMappingName,
ServiceLine.FieldNo("Location Code"),
FSWorkOrderProduct.FieldNo(WarehouseId),
IntegrationFieldMapping.Direction::Bidirectional,
'', true, false);

InsertIntegrationFieldMapping(
IntegrationTableMappingName,
ServiceLine.FieldNo("Location Code"),
FSWorkOrderProduct.FieldNo(LocationCode),
IntegrationFieldMapping.Direction::ToIntegrationTable,
'', true, false);
end;

InsertIntegrationFieldMapping(
IntegrationTableMappingName,
Expand Down

0 comments on commit ce80929

Please sign in to comment.