Skip to main content

Notifications

Dynamics 365 Community / Forums / Finance forum / to clear the value in ...
Finance forum
Suggested answer

to clear the value in multislect lookup using backspace

editSubscribe (2) ShareShare
ReportReport
Posted on by 1,416
I have created multiselect lookup on the standard form using event handler but  when i tried to clear the value using backspace the value does not get clear , can any one guide me on this how can i get this done .
 
 
 
thanks,
Regards,
Dinesh
  • Dineshkarlekar Profile Picture
    Dineshkarlekar 1,416 on at
    to clear the value in multislect lookup using backspace
    hi rajborad  ,
    Thanks For the reply , 
    can you please guide me how can i get this done , can you please share the code .i want to do something like that .
     
    thanks,
    Regards,
    Dinesh 
  • Dineshkarlekar Profile Picture
    Dineshkarlekar 1,416 on at
    to clear the value in multislect lookup using backspace
    hi ,thanks for reply , is it possible to create the multiselect lookup on form string control using coc i am trying it but seems like i am not getting the form datasource below is my code , 
    class DTProductionOrderDetailslookup_Eventhandler
    {
         <summary>
        
         </summary>
         <param name="sender"></param>
        /// <param name="e"></param>
        [FormDataSourceEventHandler(formDataSourceStr(ProdTableCreate, ProdTable), FormDataSourceEventType::Initialized)]
        public static void ProdTable_OnInitialized(FormDataSource sender, FormDataSourceEventArgs e)
        {
            var overrides = DTProductionOrderDetailslookup_Eventhandler::construct();
    
            sender.object(fieldNum(ProdTable, DTSalesId)).registerOverrideMethod(methodStr(FormDataObject, lookup),
                methodStr(DTProductionOrderDetailslookup_Eventhandler,ItemId_OnLookup), overrides);
        }
    
        public void ItemId_OnLookup(FormStringControl _callingControl)
        {
    
            FormDataObject                 DTSalesId_do = any2Object(this) as FormDataObject;
            FormDataSource                 ProdTable_ds   = DTSalesId_do.datasource();
            FormStringControl ProdTable_DTSalesId = ProdTable_ds.formRun().design().controlName(formControlStr(ProdTableCreate, ProdTable_DTSalesId));
    
            QueryBuildDataSource qbds,qbds1;
            Query query = new Query();
            qbds = query.addDataSource(tableNum(SalesTable));
            qbds.addGroupByAndSelectionField(fieldNum(SalesTable,SalesId));
            TableId multiSelectTableNum = tableNum(SalesTable);
            container selectedFields = [multiSelectTableNum, fieldName2id(multiSelectTableNum, fieldStr(SalesTable,SalesId))];
            //MultiSelectInvoices.text(con2Str(SysLookupMultiSelectCtrl::constructWithQuery(element, this, query, false, selectedFields).getSelectedFieldValues(),';'));
            SysLookupMultiSelectGrid    lookupMS = new SysLookupMultiSelectGrid();
            lookupMS.parmCallingControl(_callingControl);
            //lookupMS.parmCallingControlId(CarrierTypeIdRecId);
            //lookupMS.parmCallingControlStr(CarrierTypeIdStr);
            lookupMS.parmQuery(query);
            //lookupMS.parmQueryRun(_queryRun);
            lookupMS.parmSelectField(selectedFields);
            lookupMS.run();
            container CarrierTypeCon = str2con(ProdTable_DTSalesId.text(),";");
            ProdTable_ds.object(fieldNum(ProdTable, DTSalesId)).setValue(con2Str(CarrierTypeCon, " ,"));
    
        }
    
        public static DTProductionOrderDetailslookup_Eventhandler construct()
        {
            return new DTProductionOrderDetailslookup_Eventhandler();
        }
    
    }
    please guide me if it is possible 
     
    thanks ,
    REGARDS,
    Dinesh
  • Suggested answer
    rajborad Profile Picture
    rajborad 170 on at
    to clear the value in multislect lookup using backspace
    Hi,
     
    You can select multiple records by selecting from the lookup and also by typing in the text box itself.
    As you see, it displayed separated with ";"
    You can also clear the value using backspace in the text box.
     
    Thank you,
    Raj Borad
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,495 Super User on at
    to clear the value in multislect lookup using backspace
    See basically this works same as multiple records selection in form where you can't just click backspace to unselect the selected records. Here if you want to unselect them, then you need to come to the Sales order name in the above and click and then it will give you name like begins with. Simply click clear and it will clear all selected records in the lookup.
  • Dineshkarlekar Profile Picture
    Dineshkarlekar 1,416 on at
    to clear the value in multislect lookup using backspace
    I have created multislect lookup , it is working well , but when i tried to clear the values using backspace it does not clear the values the selected values appear again , i can only clear the selected values by deselect then , but i want it to get clear by backspace.

Helpful resources

Quick Links

Take the Community feedback survey!

Answer this brief 15-question survey about your Community experience…

Demystifying Copilot: Service Edition with Sundar Raghavan

Sundar answers more questions about Copilot for Service...

Dynamics 365 Business Central vs Finance and SCM

Take a look at the key differences between Business Central and…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,375 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 223,308 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,140

Featured topics

Product updates

Dynamics 365 release plans