customization of sales invoice emailing

mustafaAlsoufi
Member Posts: 66
Three email fields have been created, and I want to take all those emails from all those three fields and add them to the "To" field. Anyone knows which event I should subscribe to or what needs to be done to include those emails?




0
Answers
-
To include emails from multiple fields into the "To" field, you can subscribe to the OnValidate trigger of the record containing the email fields. Within this trigger, you can concatenate the email addresses from the three fields and populate the "To" field.
This is a sample code snippet you can change it.tableextension 50100 MyTableExt extends MyTable { trigger OnValidate() var Email1@field: Text[100]; Email2@field: Text[100]; Email3@field: Text[100]; EmailTo@field: Text[100]; begin EmailTo := ''; if Email1 <> '' then EmailTo += Email1 + ';'; if Email2 <> '' then EmailTo += Email2 + ';'; if Email3 <> '' then EmailTo += Email3 + ';'; Modify(); end; }
By subscribing to the OnValidate trigger and implementing the logic, the email addresses from the three fields will be combined and stored in the "To" field whenever the record is validated.0 -
@Explore
I found a mail management codeunit #9520 I thought I could subscribe to one of their events(I might be wrong here) but I couldn't find any event where I could subscribe in order to assign those Email 2 and Email 3 to be in the CCList field instead of "To".
Any suggestions?0 -
@mustafaAlsoufiOnValidate is a field trigger in Microsoft Dynamics NAV, and it is triggered when a value in a field is validated. Validation happens when you enter or modify the value in a field and then move the focus away from that field.
It is commonly used to write custom code that should run after a value has been entered into a field and that value has been validated. You can use this trigger to check the validity of a value or to automatically populate other fields based on the value of the validated field.
You can utilize the OnValidate trigger for the fields "Email", "Email 2" and "Email 3". Following this, the EmailTo variable ( that will be set as a SourceExpression in the "To" field on Page Designer) can be used to combine the email addresses from all three fields. The code snippet provided above serves as an example to help illustrate how to use onValidate trigger. If you're unfamiliar with the OnValidate trigger, it suggests that you might not have a development background. Therefore, you may find it beneficial to seek assistance from a developer within your organization.
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions