Alpha Video Training
Results 1 to 3 of 3

Thread: How to Disable DetailView toolbar (saverecord or deleterecord) based on Field value

  1. #1
    Member
    Real Name
    Andiyanto Bun
    Join Date
    Dec 2007
    Posts
    108

    Default How to Disable DetailView toolbar (saverecord or deleterecord) based on Field value

    i would like to know whether is it possible to disable detailview toolbar saverecord or deleterecord based on field value, for example: i have field on detail view status_posted, what i want to do is if field status_posted is "1" then i would like to disable deleterecord and savebutton button on detailview toolbars. any advise will be appreciated


    thanks,
    Andy

  2. #2
    "Certified" Alphaholic mmaisterrena's Avatar
    Real Name
    Mauricio Maisterrena
    Join Date
    Nov 2006
    Location
    Torreon, Mexico
    Posts
    1,435

    Default Re: How to Disable DetailView toolbar (saverecord or deleterecord) based on Field val

    You could just disable all other fields when that field is checked in the enable/disable expression property

    just put this expression
    status_posted = 1
    (is case sensitive)

    for the deleting part you could use the can delete record event:

    function CanDeleteRecord as v (DataSubmitted as P, Args as p, PageVariables as p, Result as p)
    with PageVariables

    if status_posted = 1
    Result.Cancel = .t.
    Result.ErrorHTML = "This record can not be deleted. The status has already been posted"
    end if

    end with
    end function
    Cheers
    Mauricio


  3. #3
    Member
    Real Name
    Andiyanto Bun
    Join Date
    Dec 2007
    Posts
    108

    Default Re: How to Disable DetailView toolbar (saverecord or deleterecord) based on Field val

    hi mauricio,

    Thank you for your advise, currently i am doing it just like you describe, but i want to know is it possible to disable detailview toolbars for deleterecord directly rather than using function CanDeleteRecord event.

    Regards,
    Andy

Similar Threads

  1. link to detailview
    By Henkie in forum Application Server Version 9 - Web/Browser Applications
    Replies: 1
    Last Post: 06-03-2008, 12:15 PM
  2. Help with Disable Field
    By dad6l in forum Alpha Five Version 8
    Replies: 4
    Last Post: 12-19-2007, 03:23 PM
  3. Enable/disable button based on full or runtime A5
    By Dave Wilson in forum Alpha Five Version 6
    Replies: 2
    Last Post: 09-29-2004, 07:37 AM
  4. ToolBar Disable
    By Charles Hoens in forum Alpha Five Version 5
    Replies: 4
    Last Post: 02-24-2003, 07:42 AM
  5. Activate SaveRecord & CancelChanges?
    By Hasan Muhammad in forum Alpha Five Version 5
    Replies: 3
    Last Post: 01-20-2003, 12:59 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •