Don't worry, your English is terrific.

What action is firing the trigger (Add, Update, Delete)?
You write the MOMAST is locked when you edit MODATA data.
Is it the ROW in MOMAST that is locked or is it the table MOMAST?
If it's a record lock execute the command DSPRCDLCK FILE(AMFLIB/MOMAST) 
and get the name of the job holding the lock.
Is it the trigger program holding the lock?

Do you have your trigger on the MOMAST table or do you let MAPICS (program 
AMZTRG3C ) manage your trigger?
 

You don't mention the type of trigger (Add, Update, Delete) but here's the 
basic structure I use on Update triggers.
In this case the trigger is built on ORDATC so you'd need to change it to 
MOMAST.
      //
      // DECLARE THE STRUCTURES THAT ARE TO BE PASSED INTO THIS PROGRAM.
      //
      // Trigger Data Structure
     D TrgBuffer       DS
      // Physical File Name
     D  TFileName                    10          Physical File Name
      // Library Name
     D  TLibraryName                 10          Library Name
      // Member Name
     D  TMemberName                  10          Member Name
      // TRigger Event
     D  TEvent                        1          Trigger Event
      // Trigger Time
     D  TTime                         1          Trigger Time
      // Commit Lock Level
     D  TCommitLock                   1          Commit Lock Level
      // Reserved
     D  TFill01                       3          Reserved
      // Coded Character Set ID (CCSID)
     D  TCCSID                       10I 0       Coded Character Set
      // Relative Record Number
     D  TRRN                         10I 0       Relative Record Nbr
      // Reserved
     D  TFILL02                      10I 0       Reserved
      // Offset to the Original  Record
     D  TOldOffset                   10I 0       Offset to Orig rcd
      // Length of the Original Record
     D  TOldLength                   10I 0       Length of Orig Rcd
      // Offset to the Original Record NULL Byte Map
     D  TOldNullOff                  10I 0       Null Offset
      // Length of the Null Byte Map
     D  TOldNullLen                  10I 0       Length of Null Map
      // Offset to the New Record
     D  TNewOffset                   10I 0       Offset to New Record
      // Length of the New Record
     D  TNewLength                   10I 0       Length of New Record
      // Offset to the New Record NULL Byte Map
     D  TNewNullOff                  10I 0       New Null Offset
      // Length of the NULL Byte Map
     D  TNewNullLen                  10I 0       Length of Null Map
 
      // Length of the trigger buffer
     D TrgBufferLen    S             10I 0       Trigger Buffer Lngth

      // Contains the values in the ORDATC row BEFORE the update
     D OldRecord     E DS                  ExtName(ORDATC) Prefix(O_)  
Prefix Columns
     D                                     Based(OldRecPtr)      Old 
Record Pointer
      // Contains the values in the ORDATC row AFTER the update
     D NewRecord     E DS                  ExtName(ORDATC)      New Record
     D                                     Based(NewRecPtr)      New 
Record Pointer 
      //**************************************************************
      // THE ENTRY PARAMETER LIST.
      //**************************************************************
     C     *ENTRY        PLIST
     C                   PARM                    TrgBuffer
     C                   PARM                    TrgBufferLen
      //*****************************************************************
      /FREE
      //*****************************************************************
      // OldRecPtr - Pointer to record values BEFORE the update
      // NewRecPtr - Pointer to record values AFTER the update
      // Map the values from the trigger buffer to the external data 
      //   structure. 
      //*****************************************************************
         OldRecPtr = %ADDR(TrgBuffer) + TOldOffSet;    //Map DS to data
         NewRecPtr = %ADDR(TrgBuffer) + TNewOffSet;    //Map DS to New 
Data 
                
//*****************************************************************
        //  Insert your logic below


Ron Hankey - CPIM
Business Intelligence Team


Agnes wrote:
>I'm just starting to write triggers in Mapics, and I need to build one 
for MOMAST ; it works when I go to Mfg Order >Master but if I go to 2. Mfg 
Order Operations Detail, it tells me that MOMAST is locked ... 
<SNIP>

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].