NetTalk Central

Author Topic: Disable insert button  (Read 3475 times)

bramkip

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
    • Intellisoft
    • Email
Disable insert button
« on: February 04, 2008, 01:06:36 AM »
Hi,

I want to disable the insert button based on the records in a view (browse). Can somebody help me with this?

Thank you.

Bram Kip

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11194
    • View Profile
Re: Disable insert button
« Reply #1 on: February 04, 2008, 07:08:36 AM »
Hi Bram,

The most important thing to remember is that the Insert Button is added to the window at _generate_ time. So it's not "trivial" to disable the Insert button depending on which row is highlighted. Possible, but not trivial.

To make the existence of the Insert button conditional, use the Condition, next to the "Insert" setting, on the Form tab of the Browse.

Cheers
Bruce


bramkip

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
    • Intellisoft
    • Email
Re: Disable insert button
« Reply #2 on: February 04, 2008, 12:40:38 PM »
Hi Bruce,

Is it possible to make the insert button conditional based on the records in a browse?

Thanks.

Bram

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11194
    • View Profile
Re: Disable insert button
« Reply #3 on: February 04, 2008, 11:52:14 PM »
Hi Bram,

I'm not really sure what you mean. The number of records? something in the records?

Cheers
Bruce


bramkip

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
    • Intellisoft
    • Email
Re: Disable insert button
« Reply #4 on: February 05, 2008, 08:28:20 AM »
Hi Bruce,

Example: In the table 'customers' I have a numeric field. Based on the value of that field I want to limit the records of an other table 'contacts'.

Thanks for your help.

Best regards,
Bram
« Last Edit: February 05, 2008, 10:00:21 AM by bramkip »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11194
    • View Profile
Re: Disable insert button
« Reply #5 on: February 06, 2008, 04:21:30 AM »
Hi Bram,

Ok, getting clearer.
So you have a window (a NetWebForm I presume?) , and it has 2 browses.
the one is a child of the other?

You want to limit the number of records in the child browse, depending on the number stored in the parent browse record.

Ok, so the child browse presumably has a filter of some description, limiting it to the parent browse.

Actually, the answer is the same, even if the setup is different.

The short answer is yes, you can use the condition on the "Form" tab, next to the "Insert" checkbox.

Let's say you set this condition to loc:something
then all you need to do is prime loc:something appropriately.

You've got the Session Value, of the parent file's ID field (presumably you're using this in the filter). So to get the "numbers allowed" value you'd need to
Open
Get
loc:something = whatever
Close

Cheers
Bruce