Skip to main content

Notifications

Announcements

No record found.

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

To filter the warehouse on another form using the check box click

(1) ShareShare
ReportReport
Posted on by 1,457
Hi , everyone ,
I have created the check box form and i select the warehouse on this form and select the check box to yes so when the check box is yes  for the slected warehouse i need to se the records of only that warehouse hou can i get this done please guide me on this .below is the tab on my form .
thanks,
Regards,
Dinesh
  • Suggested answer
    Waed Ayyad Profile Picture
    Waed Ayyad 6,556 Super User 2024 Season 2 on at
    To filter the warehouse on another form using the check box click
    Hi,
     
    As I told you, you should follow this link in order to override the lookup:
     
    Did you try it? Do you still need help?
     
    Thanks,
    Waed Ayyad
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,587 Super User 2024 Season 1 on at
    To filter the warehouse on another form using the check box click
    Coc on the lookup will not work here. You need to write onlookup event handler on that control which will correctly cancel super call. 
  • Dineshkarlekar Profile Picture
    Dineshkarlekar 1,457 on at
    To filter the warehouse on another form using the check box click
    hi , 
    everyone ,
     i have tried debugging , the debugger is hitting the standard lookup method not my method . how can i overcome this i have tried to cancel super  call but still debugger hits stander code , please tell me .
     
     
    thanks ,
    regards,
    Dinesh
  • Dineshkarlekar Profile Picture
    Dineshkarlekar 1,457 on at
    To filter the warehouse on another form using the check box click
    hi ,
    Everyone 
    Do i need to use register overrride method here , please let me know , i am very much stuck here.
  • Dineshkarlekar Profile Picture
    Dineshkarlekar 1,457 on at
    To filter the warehouse on another form using the check box click
    hi ,
    thanks for reply ,
     my code is below i have replace the container with while loop but i am getting 2 queries in query .
    below is my code . its not hitting when i debug the original lookup is opening , what i want to do is if stock field is yes then my lookup should open else original lookup open .can you please guide me on this .
     
    [ExtensionOf(formDataFieldStr(SalesCreateOrder,SalesTable,InventLocationId))]
    final class DTSalesCreateOrderForm_TransactionAcess_Extension
    {
    
        public void lookup(FormControl _formControl, str _filterStr)
            {
                next lookup( _formControl, _filterStr);
                UserId    userid ;
                UserInfo  userInfo;
                container      inventLocationId;
                //inventLocationId    inventId;
                Query                            query = new Query();
                QueryBuildDataSource             queryBuildDataSource;
                QueryBuildRange                  queryBuildRange;
                DTSalesTransactionAccess         salesTranAccess;
                      //FormControlEventArgs e;     
    
           userid = curUserId();
            select id from  userInfo
                where userInfo.id == userid;
    
            while select * from salesTranAccess
                where salesTranAccess.UserId == userInfo.id
                && salesTranAccess.Stock == NoYes::Yes
            {
                if(salesTranAccess)
                { 
                        inventLocationId  += salesTranAccess.inventLocationId;    
                }
              
            }
    
            queryBuildDataSource = query.addDataSource(tableNum(InventLocation));
            queryBuildRange = queryBuildDataSource.addRange(fieldNum(InventLocation, inventLocationId));
            queryBuildRange.value(con2Str(inventLocationId));
    
            SysTableLookup          sysTableLookup;
            sysTableLookup          = SysTableLookup::newParameters(tableNum(InventLocation), _formControl);
    
            sysTableLookup.addLookupField(fieldNum(InventLocation, InventLocationId));
    
            sysTableLookup.parmQuery(query);
            sysTableLookup.performFormLookup();
              
            //FormControlCancelableSuperEventArgs ce = e as FormControlCancelableSuperEventArgs;
            //ce.CancelSuperCall();
               
            }
    
    }
     
    thanks ,
    REGARDS ,
    dinesh
     
  • Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,587 Super User 2024 Season 1 on at
    To filter the warehouse on another form using the check box click
    Can you show us the code where you are passing range value in a container to query range?
  • Dineshkarlekar Profile Picture
    Dineshkarlekar 1,457 on at
    To filter the warehouse on another form using the check box click
    hi , thanks for reply ,
    lookup is working but i am getting issue in passing multiple value in query range of lookup , i tried to pass the value in lookup using container but the lookup appears to be blank ,  i am getting the value in container but still lookup is getting only one value.
  • Waed Ayyad Profile Picture
    Waed Ayyad 6,556 Super User 2024 Season 2 on at
    To filter the warehouse on another form using the check box click
    Hi,
     
    Did you try my solution? does your lookup now return values?
    If yes, verify my answers in order to help others who will face the same issue.
     
     
    Thanks,
    Waed Ayyad
     
     
  • Suggested answer
    Waed Ayyad Profile Picture
    Waed Ayyad 6,556 Super User 2024 Season 2 on at
    To filter the warehouse on another form using the check box click
    Hi,
     
    Now, your code isn't working, so try this link to guide you how to override the lookup:
     
    Also, since the check box is on another form DataSource you can simply use select statement, but my question is you want to add filter to what? to the Warehouse field? do you want to return on Lookup only the warehouses that have your checkbox field is checked? 
     
     
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the 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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,703 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,433 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans