Skip to main content
This section shows how we can add a link using the NetServer Services layer. The link to a related sale appears in the Links tab of the Follow-up dialog. Links tab of the Follow-up dialog -screenshot

Code

In this example, we use the AppointmentAgent 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 the Links 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.
By calling the agent’s SaveAppointmentEntity method, we save the follow-up and the established link.