Hi Community User,
In the other thread, I've asked you to add the Site as a datasource to the dirPartyPostalAddress Query and not the view, when you add the datasource to the query, then from the view, you can just drag and drop the SiteName and that's it, as the view contains the query --
please put your questions there and I can help you to have all the answers you need. let's leave the answers here related to the original question.
Now for this question, here's what you need:
1. As I told you in the previous reply, you need to add a display method for your siteName similar to the display method for officeLocationAddress (you can enhance the code if you want as I think we can access hcmWorker directly)
[ExtensionOf(formDataSourceStr(HcmWorker, HcmWorkerTitle))]
final class HcmWorkerFDS_Extension
{
public display str site()
{
DirPartyPostalAddressView officeLocationPostalAddressView;
HcmWorkerTitle hcmWorkerTitle = this.cursor();
hcmworker hcmworker = hcmworker::find(hcmWorkerTitle.worker);
select firstonly SiteId from officeLocationPostalAddressView
where officeLocationPostalAddressView.Party == hcmworker.Person
&& officeLocationPostalAddressView.Location == hcmWorkerTitle.Location;
return officeLocationPostalAddressView.SiteName;
}
}
2. You need to add a string control to HcmWorkerV2 form (which is control (SiteName) that you want it to appear in workerSummary) And link it to the display method like this:
![](/api/data/v9.1/msdyn_richtextfiles%289b457099-628d-ee11-8179-000d3a4e9eae%29/msdyn_imageblob/$value?size=full)
And that's it, you don't even need to override the "HcmWorkerAssignToOfficeLocation" --- it will work by itself -- at first i thought u want to do certain logic
Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future