web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Error: A control with the name 'Fld1_1_Ids' already exists on the form.

(0) ShareShare
ReportReport
Posted on by 465

I want to make a contract parameter with MultiSelect, but whenever i open the dialog i get this error : "A control with the name 'Fld1_1_Ids' already exists on the form"

Here's what i did:

[DataContractAttribute,
SysOperationContractProcessingAttribute(classStr(MyUIBuilder))]
class MyContract
{
    List            invoiceIds;


    [DataMemberAttribute,
        SysOperationLabelAttribute('InvoiceId'),
        AifCollectionTypeAttribute('return', Types::String)]
       public List parmInvoiceIds(List _invoiceIds = invoiceIds)
    {
        invoiceIds = _invoiceIds;
        return invoiceIds;
    }
}

class MyUIBuilder extends SysOperationAutomaticUIBuilder
{
    DialogField invoiceIdsField;

    public void postBuild()
    {
            super();

        invoiceIdsField = this.bindInfo().getDialogField(this.dataContractObject(),
            methodStr(MyContract, parmInvoiceIds));
    }
    
    public void postRun()
    {
        super();

        Query                   query1 = new Query(queryStr(MyQuery));
        SysLookupMultiSelectCtrl::constructWithQuery(this.dialog().dialogForm().formRun(), invoiceIdsField.control(), query1);

    }
}

pastedimage1592606767807v2.png

pastedimage1592608232301v1.png

If i use custInvoiceId EDT instead of List, the error will go but the problem is, it won't fit alot of data,

So if i select these Invoices CIV-00001,CIV-00002,CIV-00003... In the debug i will only get this: CIV-00001,CIV-   (the data is corrupted and not complete)

I have the same question (0)
  • Vishal Dhavgaye Profile Picture
    405 on at

    Cant figure it out from above information but there is tutorial class 'Tutorial_LookupMultiSelectDialog'.

    Please take a look at that, that should help you with this.

  • D365FO user Profile Picture
    465 on at

    this tutorial is for RunBaseBatch, but i tried, but using their way, they are creating a new control not from the contract. So to test if in the service class i'll get all selected values and not corrupted i need to know how can i get the values from a dialog control.

    For example : the contract parameter i was able to get them in the service class by saying _contract.Parm()... but what about dialog field how can i get their values?

  • saiijima Profile Picture
    on at

    Hi!

    I'm sorry, but I haven't seen the relevant error.

  • ArunGarg Profile Picture
    3,926 on at

    Did you get the solution for this error.

    If yes please share it I am also having same issue

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 467 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 420 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 241 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans