Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Need to clear mark fro...
Finance forum
Suggested answer

Need to clear mark from multi select lookup

Posted on by 16
Hi All,
 
In form , Suppose I have two lines
 
 
So, here the recepie store group is MultiselectLookup column.
 
 
Suppose I have select the two values from the lookup as mentioned in above pic then click on select.
 
Now In second line click on lookup. The moment I select the lookup in 2nd line , it will show the marked values in lookup which I already selected for the previous line in below picture
 
 
The requirement is , the moment when we click on the multiselect lookup it SHOULD NOT MARK any values in lookup.  How I can remove the mark from the mutiselect lookup?
 
Code - 
 
public SysLookupMultiSelectCtrl    msCtrl;       /// <summary>    /// Building the DocuType query    /// </summary>    /// returns the Docutype Query    public Query buildDocuTypeQuery()    {        Query       docuTypeQry = new Query(queryStr(UCLRecipeGroupsQry));        return docuTypeQry;    }[FormEventHandler(formStr(UCLModifierGroup), FormEventType::Initialized)]    public  void UCLModifierGroup_OnInitialized(xFormRun sender, FormEventArgs e)    {        Query               docuTypeQry         =   this.buildDocuTypeQuery();                       FormStringControl   DocuTypes        =   this.design().controlName('UCLModifierGroupLine_UCLRecipeStoreGroups');        InventParameters    inventParameters    =   InventParameters::find();                 msCtrl   = SysLookupMultiSelectCtrl::construct(this,                                            DocuTypes,                                            querystr(UCLRecipeGroupsQry),                                            false,                                            [tableNum(UCLRecipeStoreGroup), fieldNum(UCLRecipeStoreGroup,Name)]);                msCtrl.refreshQuery(docuTypeQry);        UCLModifierGroupLine    line    =   this.dataSource(FormDataSourceStr(UCLModifierGroup, UCLModifierGroupLine)).cursor() as UCLModifierGroupLine;        if(line.RecId)        {            msCtrl.set(this.getSelectedNotes(this.getSelectedFields()));        }                          }    public str getSelectedFields()    {        container selectedfields;                str ret;        UCLRecipeStoreGroup groupStore;        while select groupStore        {            selectedfields+=groupStore.Name;        }                ret = con2Str(selectedfields,';');        return ret;    }    /// <summary>    ///    /// </summary>    /// <param name=/sender/></param>    /// <param name=/e/></param>    [FormControlEventHandler(formControlStr(UCLModifierGroup, UCLModifierGroupLine_UCLRecipeStoreGroups), FormControlEventType::Modified)]    public  void UCLModifierGroupLine_UCLRecipeStoreGroups_OnModified(FormControl sender, FormControlEventArgs e)    {        FormRun     formRun = sender.formRun();                UCLModifierGroupLine    line    =   formRun.dataSource(FormDataSourceStr(UCLModifierGroup, UCLModifierGroupLine)).cursor() as UCLModifierGroupLine;        if(Line)        {           line.UCLRecipeStoreGroups     =   con2Str(msCtrl.getSelectedFieldValues(), ';');                                }                  }
 
 
  • Community member Profile Picture
    Community member 16 on at
    Need to clear mark from multi select lookup
    Hi Mohit, thanks for the response.
     
    Sorry, not understand what changes are required for me to resolve my issue.
     
    I hope you understand my issue.
     
    Kindly elaborate please 
  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,545 Moderator on at
    Need to clear mark from multi select lookup
    Hi, it looks like a custom form.If yes then you don't need to create event handler methods like OnInitialized, init method can be overrided directly. Regarding your issue, check these articles
     
     
    https://ax2012anant.blogspot.com/2021/04/multi-select-lookup-on-form-control-in.html
     
     

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

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

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,556 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,625 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans