Views:

Description

When using the CreateRecord or UpdateRecord functions this function allows you to set fields of type partylist.

Signature 1

SetAttributePartyList('fieldname', 'entitylogicalname', 'guid', 'guid')

Signature 2

SetAttributePartyList('fieldname', '#', 'entitycollection', 'fieldname')

 

 





Example 1

SetAttributePartyList('to',
                      'systemuser',
                      '30dd379c-4444-11db-8314-0800200c9a55',
                      '88dd379c-7777-11db-9999-0800200c9a55') 
See xRM Sample 81

Example 2

SetAttributePartyList('to',
                      'systemuser', 
                      '30dd379c-4444-11db-8314-0800200c9a55,88dd379c-7777-11db-9999-0800200c9a55') 
See xRM Sample 96

Example 3

SetAttributePartyList('to', 
                'systemuser',
                'entitycollection',
                'field_reference_from_entitycollection')
 See xRM Sample 24

Example 4

This example shows how to use execute a fetch-xml query which returns an entity collection of emails that you can use in the email. 

 CreateRecord('email', 
    SetAttribute('subject', 'Test Email: ' + UtcDateTime()),  
    SetAttributePartyList('to', 
                          '#',
                          FindRecordsValue(FindRecordsFD('Find Test Email'),
                                           'from'),
                                           'partyid'))

Example 5

This example shows how the to & cc fields can send emails to unresolved email address via the 'AddressedUsed' property of the ActivityParty

 CreateRecord('email',
    SetAttribute('subject', 'Test Email: ' + UtcDateTime()),
    SetAttributePartyList('to', 'contact', '8d7484bc-a63c-ed11-9db1-000d3aaa0218', 'bill@microsoft.com'  ),
    SetAttributePartyList('cc', '', 'steve@microsoft.com'),
)

Parameters

NameTypeDescriptionRequired
fieldnamexxxxxxxxxxxx
entitylogicalnamexxxxxxxxxxxx
guidxxxxxxxxxxxx
guidxxxxxxxxxxxx