Preventing InLine Query allowing New Records

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
eagles9999
Posts: 2197
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Preventing InLine Query allowing New Records

Post by eagles9999 »

I have a situation where I want to show a range of records in an Query that has Inline Editing enabled.
I want the user to be able to inline edit those records but I do not want to allow a new record to be created as they tab right at the end of the last record.

Any suggestions please?
Cheers,
Mark
_________________
AwareIM 6.0, 8.4, 8.5b (build 2806) MS SQL Server 2012 / MariaDB, Windows 10, Ubuntu Linux, Theme: Default, Browser: Chrome
Upcloud, AWS
Image
eagles9999
Posts: 2197
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Preventing InLine Query allowing New Records

Post by eagles9999 »

I guess a Rule on the BO will work....

MyBO IS NEW AND MyBO.date IS UNDEFINED

REPORT ERROR 'Whoops! You Cannot Add a Record Here."

Dynamic.
Cheers,
Mark
_________________
AwareIM 6.0, 8.4, 8.5b (build 2806) MS SQL Server 2012 / MariaDB, Windows 10, Ubuntu Linux, Theme: Default, Browser: Chrome
Upcloud, AWS
Image
eagles9999
Posts: 2197
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Preventing InLine Query allowing New Records

Post by eagles9999 »

Hmmmm.... That doesn't work. :-/
Cheers,
Mark
_________________
AwareIM 6.0, 8.4, 8.5b (build 2806) MS SQL Server 2012 / MariaDB, Windows 10, Ubuntu Linux, Theme: Default, Browser: Chrome
Upcloud, AWS
Image
eagles9999
Posts: 2197
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Preventing InLine Query allowing New Records

Post by eagles9999 »

Retract that...

It sort of works.

Allows the user to traverse the new row and in fact does not pop up an error until the user tries to create a second row (but different error... Not the REPORT ERROR error)

BUT.... the records are not saved.

Would be nice to be able to disable the creation of a new row completely
Cheers,
Mark
_________________
AwareIM 6.0, 8.4, 8.5b (build 2806) MS SQL Server 2012 / MariaDB, Windows 10, Ubuntu Linux, Theme: Default, Browser: Chrome
Upcloud, AWS
Image
Jaymer
Posts: 1828
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Preventing InLine Query allowing New Records

Post by Jaymer »

Ctrl-c then tab to the option “allow create” and set to No
Voila! It’s magic
Click Here to see a collection of my tips & hacks on this forum? Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
bondicoffee
Posts: 110
Joined: Tue Dec 03, 2013 10:19 pm

Re: Preventing InLine Query allowing New Records

Post by bondicoffee »

Jaymer wrote:Ctrl-c then tab to the option “allow create” and set to No
Voila! It’s magic
Could you please brief little bit, I am unable to find option "Allow Create"
eagles9999
Posts: 2197
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Preventing InLine Query allowing New Records

Post by eagles9999 »

Hi BondiCoffee (you must live in Sydney, yes?)

Jaymer's comment was a personal joke that he know I would get. It is not related to Aware. ;-)
Cheers,
Mark
_________________
AwareIM 6.0, 8.4, 8.5b (build 2806) MS SQL Server 2012 / MariaDB, Windows 10, Ubuntu Linux, Theme: Default, Browser: Chrome
Upcloud, AWS
Image
johntalbott
Posts: 586
Joined: Wed Jun 17, 2015 11:16 pm
Location: Omaha, NE

Re: Preventing InLine Query allowing New Records

Post by johntalbott »

Try this in the query init script ...

Code: Select all

config.edit = function(e){

     if(e.model.isNew()) {
          var grid = e.sender
          grid.cancelChanges()
     } 		
}
VocalDay Solutions - Agility - Predictability - Quality

We specialize in enabling business through the innovative use of technology.

Services:
-Web/Mobile App Design/Development
-Project Management - Agile, Scrum, Kanban
-Business Analysis
-Testing
Jaymer
Posts: 1828
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Preventing InLine Query allowing New Records

Post by Jaymer »

From Support:

In render script of a query:
parser.m_doNotAddNewOnTab = true;

added in bld 2464
https://www.awareim.com/forum/viewtopic.php?f=1&t=10421

keyword: create allow prevent disable

--> JaymerTip
Last edited by Jaymer on Fri Jan 24, 2020 5:07 am, edited 1 time in total.
Click Here to see a collection of my tips & hacks on this forum? Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Post Reply