Results 1 to 2 of 2

Thread: [Answers] Trigger

  1. #1
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135

    [Answers] Trigger

    Lianja does support CREATE TRIGGER. One thing to note - do not use double-quotes ("") within the AS <expression>, use single-quotes ('') or square brackets ([]) for strings.
    In addition to the Visual FoxPro FOR DELETE | INSERT | UPDATE Triggers, Lianja supports additional Triggers 'after' operations: FOR DELETE | ONAFTERDELETE | INSERT | ONAFTERINSERT | UPDATE | ONAFTERUPDATE (http://www.lianja.com/doc/index.php/CREATE_TRIGGER).
    You can also write trigger procedures within the Data Workspace:



    Note that in the Data Workspace, Triggers are listed as onbeforeoperation and onafteroperation.



    ​All topics in [Answers] alphabetically:http://www.lianja.com/community/show...ll=1#post12352
    Last edited by josipradnik; 2016-03-01 at 02:28.

  2. #2
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135
    Q:
    In my "documenti" table, I've added a datetime field called "modified"
    In the OnAfterUpdate trigger, i've wrote:
    Code:
    // Trigger onafterupdate for table documenti
    replace documenti.modified with datetime()
    return .t.
    but work only if I open the table with Browse... not in section..
    A:
    If the trigger is being called, but the replaced value is being reset as you navigate, please try this:
    Code:
    // Trigger onafterupdate for table documenti
    replace documenti.modified with datetime()
    skip 0
    return .t.


    ​All topics in [Answers] alphabetically:http://www.lianja.com/community/show...ll=1#post12352
    Last edited by josipradnik; 2016-03-01 at 02:27.

Bookmarks

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
  •  
Journey into the Cloud
Join us