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
customaware
Posts: 2431
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Preventing InLine Query allowing New Records

Post by customaware »

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.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
customaware
Posts: 2431
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Preventing InLine Query allowing New Records

Post by customaware »

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.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
customaware
Posts: 2431
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Preventing InLine Query allowing New Records

Post by customaware »

Hmmmm.... That doesn't work. :-/
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
customaware
Posts: 2431
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Preventing InLine Query allowing New Records

Post by customaware »

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.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
Jaymer
Posts: 2528
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: 130
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"
customaware
Posts: 2431
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Preventing InLine Query allowing New Records

Post by customaware »

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.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
johntalbott
Posts: 620
Joined: Wed Jun 17, 2015 11:16 pm
Location: Omaha, Nebraska
Contact:

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.

AwareIM app with beautiful UI/UX - https://screencast-o-matic.com/watch/crfUrrVeB3t
Jaymer
Posts: 2528
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