Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Values should be displayed separated by comas in a form

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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.

  • Martin Dráb Profile Picture
    Martin Dráb 230,962 Most Valuable Professional on at
    RE: Values should be displayed separated by comas in a form

    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.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Values should be displayed separated by comas in a form

    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.

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,962 Most Valuable Professional on at
    RE: Values should be displayed separated by comas in a form

    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.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Values should be displayed separated by comas in a form

    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

  • Martin Dráb Profile Picture
    Martin Dráb 230,962 Most Valuable Professional on at
    RE: Values should be displayed separated by comas in a form

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,160 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans