Code
In this example, we use theAppointmentAgent to retrieve an AppointmentEntity. Then we relate the follow-up to a sale using its Links property.
Walk-through
There is no tool available through the services layer to just add a link to theLinks property. Therefore, we need to create an array of type Link and copy the data that is held in the appointment’s Links property using the CopyTo command. Then we create a new Link type, assign values to its properties, and assign the link to the last element of our created Link array.
By creating the new array
Links.Length + 1, we avoid accidentally modifying any existing data items stored.SaveAppointmentEntity method, we save the follow-up and the established link.