Page 1 of 1

Query Builder Request

Posted: Wed Oct 28, 2020 6:17 pm
by treed
I just spent a bunch of time rebuilding a complicated where clause that was overwritten when I opened the query builder without remembering that I had manually entered changes. I understand it would be really difficult to make a bi-directional query builder, however it might be pretty easy to just look at the length of the stored query for the browse screen vs. the one stored for the query builder and let the user know they are/maybe about to overwrite something important.

Re: Query Builder Request

Posted: Thu Oct 29, 2020 6:57 am
by kev1n
treed,

Thanks for your input. Inputs help improve nuBuilder!

I think it can easily be done by checking the current sql with the one from the SQL Builder. If they don't match, show a warning.
nuselect_warning.gif

In the meantime, add this snippet in the (Setup ->) Header (Click Save and log in again to test it).

Code: Select all

function nuOnLoad() {
	if (nuCurrentProperties().form_id == 'nuselect') {
		var s = $("textarea[id='sfo_browse_sql']", window.parent.document);
		if (s.length == 1) {
			if (s.val() !== $('#sse_sql').val()) {
				nuMessage([nuTranslate('<b>Caution!</b><br>The Browse SQL was changed manually and will be overwritten when changes are made.')]);
			}
		}  
	}
}

Re: Query Builder Request

Posted: Sun Nov 01, 2020 12:47 am
by admin
treed,

Setting SQL to Edit Manually will stop this from happening
man.PNG
I have added this explanation to the Wiki...

https://wiki.nubuilder.cloud/ ... uilder#SQL


Steven