[master] - Changing the contact of a Customer Subscription Contract doesn't update the email of the contract.#9712
Open
DhavalMore88 wants to merge 1 commit into
Conversation
DhavalMore88
marked this pull request as ready for review
July 24, 2026 11:33
djukicmilica
approved these changes
Jul 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug 643982: [master] [All-e] Changing the contact of a Customer Subscription Contract doesn't update the email of the contract.
AB#643982
Issue: When a Customer Subscription Contract's "Sell-to Contact No." is changed to a different contact, the contract's email ("Sell-to E-Mail") is not refreshed. It keeps the previous/customer email, so subscription communication can be sent to the wrong contact.
Cause: In the UpdateSellToCust procedure in CustomerSubscriptionContract.Table.al (invoked from the "Sell-to Contact No." OnValidate trigger), the resolved Contact record's details were never copied to the contract — the email/phone lines present in the standard BaseApp Sales Header pattern were omitted. The email was only ever populated from the Customer during "Sell-to Customer No." validation (CopySellToCustomerAddressFieldsFromCustomer), never from the selected contact.
Solution: Added "Sell-to Phone No." := Cont."Phone No."; and "Sell-to E-Mail" := Cont."E-Mail"; in UpdateSellToCust after the contact is resolved, mirroring the standard Sales Header behavior. Now any Validate("Sell-to Contact No.", ...) — from UI, AL, API, or background — overrides the contract email with the selected contact's email (strict override, including blank), while preserving existing validations and the OnAfterUpdateSellToCust event.