I have ( with help from here ) , managed to create a workflow that creates an email and attaches a PDF file. One question I have is when creating the To party list, how does it know which email address to grab if I have 2 email address fields in my entity. Does it grab both email addresses, or can you specify which email is required i.e. 1 for the To address and one for the CC address
Dim UpdateEmail As New Entity("email")
Dim recordGuid As New Guid(_resultEntity.Id.ToString)
' Need to lookup Supplier email
Dim LookupSupplierID As Guid
Dim SupplierList As New QueryByAttribute("new_remittancesuppliers")
SupplierList.ColumnSet = New ColumnSet("new_remittancesuppliersid")
SupplierList.Attributes.AddRange("new_supplierref")
SupplierList.Values.AddRange(new_supplier.[Get](executionContext))
Dim ReturnedSupplierList As EntityCollection = service.RetrieveMultiple(SupplierList)
For Each ReturnedSupplier In ReturnedSupplierList.Entities
LookupSupplierID = ReturnedSupplier.GetAttributeValue(Of Guid)("new_remittancesuppliersid")
' new_supplierref is unique so once found exit
Exit For
Next
Dim Toparty As New Entity("activityparty")
Toparty("partyid") = New EntityReference("new_remittancesuppliers", LookupSupplierID)
UpdateEmail.Id = recordGuid
UpdateEmail("to") = New Entity() {Toparty}
service.Update(UpdateEmail)
*This post is locked for comments
No, it will not work that way.
Just a thought, can you put multiple email addresses in one field ie email1@somewhere.com; email2@somewhere.com
would that work ?
It's always using first email address that is found on the entity. For example you have 3 email fields on contact entity (emailaddress1, emailaddress2, emailaddress3) it will use the first email that is not null.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156