I am facing an issue where I am trying to use method clearLinks() on the form Datasource Query, but it is not working as expected and instead it is adding the same datasource over and over again to the parent datasource whenever executeQuery() method is called. Any suggestions as to how this issue can be resolved ??
No, clearLinks() isn't adding the same data source again. It seems that you have your code calling addDataSource() every time.
Consider if you must add the data source in code - maybe you should add it in the form designer and merely disable it in code when you don't need it.
If you must add it in code, and it must be in executeQuery(), not init(), you can store the QueryBuildDataSource object in a form-level variable. When calling executeQuery() again, you'll use the object from the variable, if set. Alternatively, you could check if the query already contains the data source (e.g. by using SysQuery::findOrCreateDataSource()).
Was this reply helpful?YesNo
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.