Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9710,7 +9710,7 @@ table 36 "Sales Header"
exit(Result);

Contact.FilterGroup(2);
if ("Sell-to Customer No." <> '') and ("Document Type" <> "Document Type"::Quote) then
if "Sell-to Customer No." <> '' then
if Contact.Get("Sell-to Contact No.") then
Contact.SetRange("Company No.", Contact."Company No.")
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9571,7 +9571,7 @@ table 36 "Sales Header"
exit(Result);

Contact.FilterGroup(2);
if ("Sell-to Customer No." <> '') and ("Document Type" <> "Document Type"::Quote) then
if "Sell-to Customer No." <> '' then
if Contact.Get("Sell-to Contact No.") then
Contact.SetRange("Company No.", Contact."Company No.")
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9600,7 +9600,7 @@ table 36 "Sales Header"
exit(Result);

Contact.FilterGroup(2);
if ("Sell-to Customer No." <> '') and ("Document Type" <> "Document Type"::Quote) then
if "Sell-to Customer No." <> '' then
if Contact.Get("Sell-to Contact No.") then
Contact.SetRange("Company No.", Contact."Company No.")
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9541,7 +9541,7 @@ table 36 "Sales Header"
exit(Result);

Contact.FilterGroup(2);
if ("Sell-to Customer No." <> '') and ("Document Type" <> "Document Type"::Quote) then
if "Sell-to Customer No." <> '' then
if Contact.Get("Sell-to Contact No.") then
Contact.SetRange("Company No.", Contact."Company No.")
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9667,7 +9667,7 @@ table 36 "Sales Header"
exit(Result);

Contact.FilterGroup(2);
if ("Sell-to Customer No." <> '') and ("Document Type" <> "Document Type"::Quote) then
if "Sell-to Customer No." <> '' then
if Contact.Get("Sell-to Contact No.") then
Contact.SetRange("Company No.", Contact."Company No.")
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9541,7 +9541,7 @@ table 36 "Sales Header"
exit(Result);

Contact.FilterGroup(2);
if ("Sell-to Customer No." <> '') and ("Document Type" <> "Document Type"::Quote) then
if "Sell-to Customer No." <> '' then
if Contact.Get("Sell-to Contact No.") then
Contact.SetRange("Company No.", Contact."Company No.")
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9545,7 +9545,7 @@ table 36 "Sales Header"
exit(Result);

Contact.FilterGroup(2);
if ("Sell-to Customer No." <> '') and ("Document Type" <> "Document Type"::Quote) then
if "Sell-to Customer No." <> '' then
if Contact.Get("Sell-to Contact No.") then
Contact.SetRange("Company No.", Contact."Company No.")
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9541,7 +9541,7 @@ table 36 "Sales Header"
exit(Result);

Contact.FilterGroup(2);
if ("Sell-to Customer No." <> '') and ("Document Type" <> "Document Type"::Quote) then
if "Sell-to Customer No." <> '' then
if Contact.Get("Sell-to Contact No.") then
Contact.SetRange("Company No.", Contact."Company No.")
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10284,7 +10284,7 @@ table 36 "Sales Header"
exit(Result);

Contact.FilterGroup(2);
if ("Sell-to Customer No." <> '') and ("Document Type" <> "Document Type"::Quote) then
if "Sell-to Customer No." <> '' then
if Contact.Get("Sell-to Contact No.") then
Contact.SetRange("Company No.", Contact."Company No.")
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9855,7 +9855,7 @@ table 36 "Sales Header"
exit(Result);

Contact.FilterGroup(2);
if ("Sell-to Customer No." <> '') and ("Document Type" <> "Document Type"::Quote) then
if "Sell-to Customer No." <> '' then
if Contact.Get("Sell-to Contact No.") then
Contact.SetRange("Company No.", Contact."Company No.")
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9567,7 +9567,7 @@ table 36 "Sales Header"
exit(Result);

Contact.FilterGroup(2);
if ("Sell-to Customer No." <> '') and ("Document Type" <> "Document Type"::Quote) then
if "Sell-to Customer No." <> '' then
if Contact.Get("Sell-to Contact No.") then
Contact.SetRange("Company No.", Contact."Company No.")
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9632,7 +9632,7 @@ table 36 "Sales Header"
exit(Result);

Contact.FilterGroup(2);
if ("Sell-to Customer No." <> '') and ("Document Type" <> "Document Type"::Quote) then
if "Sell-to Customer No." <> '' then
if Contact.Get("Sell-to Contact No.") then
Contact.SetRange("Company No.", Contact."Company No.")
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10060,7 +10060,7 @@ table 36 "Sales Header"
exit(Result);

Contact.FilterGroup(2);
if ("Sell-to Customer No." <> '') and ("Document Type" <> "Document Type"::Quote) then
if "Sell-to Customer No." <> '' then
if Contact.Get("Sell-to Contact No.") then
Contact.SetRange("Company No.", Contact."Company No.")
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9570,7 +9570,7 @@ table 36 "Sales Header"
exit(Result);

Contact.FilterGroup(2);
if ("Sell-to Customer No." <> '') and ("Document Type" <> "Document Type"::Quote) then
if "Sell-to Customer No." <> '' then
if Contact.Get("Sell-to Contact No.") then
Contact.SetRange("Company No.", Contact."Company No.")
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9541,7 +9541,7 @@ table 36 "Sales Header"
exit(Result);

Contact.FilterGroup(2);
if ("Sell-to Customer No." <> '') and ("Document Type" <> "Document Type"::Quote) then
if "Sell-to Customer No." <> '' then
if Contact.Get("Sell-to Contact No.") then
Contact.SetRange("Company No.", Contact."Company No.")
else
Expand Down
29 changes: 29 additions & 0 deletions src/Layers/W1/Tests/Marketing/TestContactLookup.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,35 @@ codeunit 134837 "Test Contact Lookup"
SalesQuote."Sell-to Contact No.".AssertEquals(Contact."No.");
end;

[Test]
[HandlerFunctions('ContactListModalPageHandler')]
procedure SellToContactLookupOnSalesQuoteWithCustomerTest()
Comment thread
neeleshsinghal marked this conversation as resolved.
var
Customer: Record Customer;
SalesHeader: Record "Sales Header";
SalesQuote: TestPage "Sales Quote";
begin
// [FEATURE] [Sales Quote]
// [SCENARIO 642199] When "Sell-to Customer No." is set in a Sales Quote then on "Sell-to Contact No." look up the contact list is filtered by the customer's contact "Company No." instead of showing all contacts.
Initialize();

// [GIVEN] Create Customer with a Contact.
LibrarySmallBusiness.CreateCustomer(Customer);
Customer.Validate(Contact, StrSubstNo('%1 %2', LibraryUtility.GenerateRandomText(10), LibraryUtility.GenerateRandomText(10)));

// [GIVEN] Create a Sales Quote for the created customer.
LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader."Document Type"::Quote, Customer."No.");
SalesQuote.OpenEdit();
SalesQuote.GotoRecord(SalesHeader);

// [WHEN] Look up contact list from "Sell-to Contact No.".
LibraryVariableStorage.Enqueue(Customer."Primary Contact No.");
SalesQuote."Sell-to Contact No.".Lookup();

// [THEN] Verify the contact list is filtered by the "Company No." of the customer's contact.
// Verification in ContactListModalPageHandler
end;

local procedure Initialize()
var
ObjectOptions: Record "Object Options";
Expand Down
Loading