Hello,
I have notes/links(more or equal to 1) for a service order.
I have a form, when I open the form these links should come separated by comas for a single service order.
can anyone tell me how to achieve this in x++ code.
I don't see how your code is related to your requirement.
By the way, please use Insert > Insert Code (in the rich-formatting view) to paste source code.
can't we write in form's datasource(docuref) init method.
If not separated with comas can we just get only one link for a service order.
qbds1 = this.query().dataSourceTable(tableNum(DocuRef));
qbds2 = qbds1.addDataSource(tableNum(Acx_ServiceCard));
qbds2.addRange(fieldnum(Acx_ServiceCard, serviceorderno)).value(Acx_ServiceCard.serviceorderno);
qbds2.joinMode(JoinMode::InnerJoin);
qbds2.relations(false);
qbds2.addLink(fieldNum(DocuRef, RefRecId), fieldNum(Acx_ServiceCard, RecId));
I wrote the above one to pick only link in init() method bt its nt working at all.
The more straightforward, but potentially problematic for performance, is using a display method.
More complicated, but more efficient, is combining notes in a computed column of a view that you'd join with service orders.
I have those notes in Douref table and and service orders in Acx_ServiceCard table.
qbds2.addLink(fieldNum(DocuRef, RefRecId), fieldNum(Acx_ServiceCard, RecId));
The above one is the relation
Where do you store the notes/links? In a table with N:1 with service orders?
By the way, let me chantge the category from "Other", because your question is clearly about developmment and we do have a category for that.
André Arnaud de Cal...
292,160
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156