Issue with When Validate Trigger firing multiple times

Hi guys,
I have Designed a Form Personalization on a Form which Fires a concurrent Program (built in:execute Procedure) when a Record is Saved.
Below are the issues I am facing:
1.Concurrent Program is Firing Multiple Times after Saving the Record.
2.2 input Values to Concurrent Program are passed as NULL though I have Data but they are in Different Block of Form.
Note :I have When Validate trigger on 1 Block but i am trying to pass 2 Values on Another Block as input parameters for Concurrent program.But those values are getting as null when program fires.
Thanks.

If EBS then post in {forum:id=475}

Similar Messages

  • Problem with when validate trigger

    Hi All,
    I am using oracle forms 10g.
    I have developed a custom form In that i have two block Header block and Detail block.In the header block some fields like Po number, po amount , supplier name, supplier site etc. And in the detail block i have po line details.
    I have written a validation trigger under supplier name and supplier site, IF block.supplier_name is null then
    message('enter supplier name') same under every field.
    Now when the user enter po number it will go to po amount field and now when the user press tab it will go to the details block and query all the po related line,so i have written key-next under po_amount go-block and my code, Its works fine and giving the correct output. But the problem is When validate trigger fires when i press tab in PO Amount fields, Once i press ok it going to details block and querying.
    Can any one explain me what i have done wrong. The validation trigger is firing and giving message.
    Regards
    Srikkanth

    Srikkanth.M wrote:
    Hi All,
    I am using oracle forms 10g.
    I have developed a custom form In that i have two block Header block and Detail block.In the header block some fields like Po number, po amount , supplier name, supplier site etc. And in the detail block i have po line details.
    I have written a validation trigger under supplier name and supplier site, IF block.supplier_name is null then
    message('enter supplier name') same under every field.
    Now when the user enter po number it will go to po amount field and now when the user press tab it will go to the details block and query all the po related line,so i have written key-next under po_amount go-block and my code, Its works fine and giving the correct output. But the problem is When validate trigger fires when i press tab in PO Amount fields, Once i press ok it going to details block and querying.Hey, Srikkanth
    Once you said
    when the user enter po number it will go to po amount field and now when the user press tab it will go to the details block and query all the po related line,so i have written key-next under po_amount go-block and my code, Its works fine and giving the correct output.again you said
    But the problem is When validate trigger fires when i press tab in PO Amount fieldsSo, i'm not getting you..
    Can you clear it any more ? or any other way..

  • Issue with WHEN-VALIDATE-ITEM trigger in Forms 6i

    I am working with a form(A) which displays a modal window(B) with some database fields on it when a button on the form was pressed.
    First as soon as I pressed the button on the form A the modal window B appears with the values as (for example)
    Scenario - 0
    field 1 - OTHER
    field 2 - 123-456
    field 3 - 14-JUN-2006
    field 4 - Old Contract
    Scenario - 1
    If field 1 is changed/updated to a value NONE then the remaining fields should grey out and should not allow the user to edit/update those fields. Also it should clear all the data in the fields and should display only blank fields. Now the only updatable field in this case is field 1 which has value NONE at this moment.
    field 1 - NONE
    field 2 - NULL
    field 3 - NULL
    field 4 - NULL
    Only if the user exits the modal window B and clicks on SAVE button which is on the form A then only the data changes are committed to the database tables.
    At this moment I don't want to exit the modal window B which means the data changes are not yet committed to the database.
    Scenario - 2
    Now if field 1 is again changed/updated to a value ANOTHER then the remaining fields has to be populated accordingly using the values from the form A and B and it should allow the user to edit/update the remaining fields in window B.
    field 1 - ANOTHER
    field 2 - 123-456
    field 3 - 14-JUN-2006
    field 4 - Old Contract
    Now if you observe Scenario - 0 and Scenario - 2 only field 1 is differing. Rest of the three fields are same. As I didn't exit from the modal window the changes were not committed to the database.
    If the order of the scenarios is like below:
    Case1 : Scenario - 1 & Scenario - 2
    Case2 : Scenario - 1 & Scenario - 0
    I am able to successfully handle the above two cases as initially the three other fields are set to NULL and the user will be able to update the data and can commit the data.
    If the order of the scenarios is like below:
    Case3 : Scenario - 0 & Scenario - 1
    Case4 : Scenario - 0 & Scenario - 2
    I am also able to successfully handle the above two cases as finally the three other fileds are set to NULL and the user will be not be able to modify them and obviously NULL values will be stored in the database when committed.
    Now the problem is with the following order.
    Case5 : Scenario - 0 & Scenario - 1 & Scenario - 2
    Case6 : Scenario - 2 & Scenario - 1 & Scenario - 0
    In the above cases we can successfully handle until Scenario - 1 but when comes to Scenario - 2 how can we be able to display the data as shown.
    I have tried to perform this using WHEN-VALIDATE-ITEM on field 1. When the field 1 is changed from OTHER to NONE I have assigned NULL to the remaining fields. So it's working fine as I mentioned earlier. Now if I change field 1 from NONE to ANOTHER its allowing to update the remaining fields but its not populating the data.
    Can anyone help with this?
    Thanks for the patience in reading the problem....

    Yes, if you use the debugger as Gerd said you can get and see the data as the code executes line-by-line. You can also use message statements in your code to display the data.

  • Problem with ActionListener firing multiple times

    I have a GUI class, GUIView, with a no-arg constructor and a static getInstance() method.
    The GUI class has a JButton called btnB1 with a method:
         void addB1Listener(ActionListener al){
              btnB1.addActionListener(al);
         }The Controller class has an instance of the GUI and the Model.
    The Controller has a constructor which assigns a new ActionListener to the JButton from the GUI.
    private GUI m_gui;
         FTController(GUIView view){
              m_gui = view;
              m_gui.addButtonListener(new AddButtonListener());
         }The Controller has an inner class:
    class AddButtonListener implements ActionListener{
              @Override
              public void actionPerformed(ActionEvent e) {
                          // do stuff
    }The model has a constructor which accepts a GUIView.
    My main method setups instances of the objects:
         private GUIView view;
         private Model model;
         private Controller controller;
         public static void main(String [] args){
              view = GUIView.getInstance();
              model = new Model(view);
              controller = new Controller(view);
         }This action listener for btnB1 is firing multiple times, but I don't understand why.
    Edited by: user10199598 on Jan 9, 2012 2:56 PM

    Here is the actual Controller class
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.IOException;
    import javax.swing.JOptionPane;
    import com.esri.arcgis.carto.FeatureLayer;
    import com.esri.arcgis.carto.IActiveView;
    import com.esri.arcgis.carto.Map;
    import com.esri.arcgis.interop.AutomationException;
    public class FTController{
         private FTView m_arraView;
         private FTModel m_arraModel;
         private Map m_map;
         FTController(FTView view, FTModel model, Map map){
              m_arraView = view;
              m_arraModel = model;
              m_map = map;
              m_arraView.addPointListener(new AddPointListener());
              m_arraView.addExitListener(new AddExitListener());
              m_arraView.addResetListener(new AddResetListener());
         public FTView getM_arraView() {
              return m_arraView;
         // Inner class used as the ActionListener for the btnAddPoint in FTView
         class AddPointListener implements ActionListener {
              @Override
              public void actionPerformed(ActionEvent e) {
                   FeatureLayer fl = (FeatureLayer) m_arraModel.getLayerByName("arra_field_teams", m_map);
                   try {
                        // Start the process to add a new feature point
                        m_arraModel.addPoint(fl, (IActiveView) m_map.getActiveView());
                        // Reset and dispose of the ARRA Field Teams form.
                        m_arraView.getCboTeam().setSelectedIndex(0);
                        m_arraView.getCboAgency().setSelectedIndex(0);
                        m_arraView.getTxtLatitude().setText("");
                        m_arraView.getTxtLongitude().setText("");
                        m_arraView.getTxtGridL().setText("");
                        m_arraView.getTxtGridN().setText("");
                        m_arraView.getTxtQuadrant().setText("");
                        m_arraView.getFtf3IC().setText("0.002");
                        m_arraView.getFtf3FC().setText("0.002");
                        m_arraView.getFtf3IO().setText("0.002");
                        m_arraView.getFtf3FO().setText("0.002");
                        m_arraView.getFtfAgxCartridge().setText("0.000");
                        m_arraView.getFtfBGCM().setText("50.000");
                        m_arraView.getFtfBGURHR().setText("0.002");
                        m_arraView.getTxtTimeOfReading().setText("");
                        m_arraView.dispose();
                        // Refresh the map window
                        m_map.getActiveView().refresh();
                   } catch (AutomationException e1) {
                        e1.printStackTrace();
                   } catch (IOException e1) {
                        e1.printStackTrace();
         } // end AddPointListener
         // Inner class used as the ActionListener for the btnExit in FTView
         class AddExitListener implements ActionListener{
              @Override
              public void actionPerformed(ActionEvent e) {
                   m_arraView.getCboTeam().setSelectedIndex(0);
                   m_arraView.getCboAgency().setSelectedIndex(0);
                   m_arraView.getTxtLatitude().setText("");
                   m_arraView.getTxtLongitude().setText("");
                   m_arraView.getTxtGridL().setText("");
                   m_arraView.getTxtGridN().setText("");
                   m_arraView.getTxtQuadrant().setText("");
                   m_arraView.getFtf3IC().setText("0.002");
                   m_arraView.getFtf3FC().setText("0.002");
                   m_arraView.getFtf3IO().setText("0.002");
                   m_arraView.getFtf3FO().setText("0.002");
                   m_arraView.getFtfAgxCartridge().setText("0.000");
                   m_arraView.getFtfBGCM().setText("50.000");
                   m_arraView.getFtfBGURHR().setText("0.002");
                   m_arraView.getTxtTimeOfReading().setText("");
                   m_arraView.dispose();
         } // end AddExitListener
         // Inner class used as the ActionListner for the btnReset in FTView
         class AddResetListener implements ActionListener{
              @Override
              public void actionPerformed(ActionEvent e) {
                   FeatureLayer fl = (FeatureLayer) m_arraModel.getLayerByName("field_teams", m_map);
                   try {
                        // Actually, "Reset" is deleting all features from the shapefile, poor choice of labels.
                        m_arraModel.resetFeatures(fl, (IActiveView) m_map.getActiveView(), (Map) m_map);
                        // Refresh the map window
                        m_map.getActiveView().refresh();
                   } catch (AutomationException e1) {
                        e1.printStackTrace();
                   } catch (IOException e1) {
                        e1.printStackTrace();
    }Here is where the application starts:
    import java.awt.event.MouseEvent;
    import java.io.IOException;
    import java.text.DecimalFormat;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import javax.swing.UIManager;
    import javax.swing.UnsupportedLookAndFeelException;
    import com.esri.arcgis.addins.desktop.Tool;
    import com.esri.arcgis.arcmap.Application;
    import com.esri.arcgis.arcmapui.IMxDocument;
    import com.esri.arcgis.arcmapui.MxDocument;
    import com.esri.arcgis.carto.IActiveView;
    import com.esri.arcgis.carto.IFeatureLayer;
    import com.esri.arcgis.carto.Map;
    import com.esri.arcgis.framework.IApplication;
    import com.esri.arcgis.geodatabase.Feature;
    import com.esri.arcgis.geodatabase.IFeatureClass;
    import com.esri.arcgis.geometry.Point;
    import com.esri.arcgis.interop.AutomationException;
    public class FTTool extends Tool {
         private IApplication app;
         private IActiveView av;
         private IMxDocument mxDocument;
         private Map map;
         private FTView arraView;
         private FTModel model;
         private FTController controller;
         private int left;
         private int top;
          * Called when the tool is activated by clicking it.
          * @exception java.io.IOException if there are interop problems.
          * @exception com.esri.arcgis.interop.AutomationException if the component throws an ArcObjects exception.
         @Override
         public void activate() throws IOException, AutomationException {
         @Override
         public void init(IApplication app) throws IOException, AutomationException {
              this.app = app;
              try {
                 try {
                        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                   } catch (ClassNotFoundException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                   } catch (InstantiationException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                   } catch (IllegalAccessException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                   } catch (UnsupportedLookAndFeelException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                   // Initialize our map document, map and active view
                   mxDocument = (IMxDocument)app.getDocument();
                   av = mxDocument.getActiveView();
                   map = (Map)mxDocument.getMaps().getItem(0);
                   // Get an instance of the ARRAView JFrame, and setup the model and controller for this tool add-in
                   arraView = FTView.getInstance();
    //               arraView.addWindowListener(arraView);
                   // Set up the model and controller objects
                   model = new FTModel(arraView);
                   controller = new FTController(arraView, model, map);
              } catch (AutomationException e) {
                   e.printStackTrace();
              } catch (IOException e) {
                   e.printStackTrace();
         @Override
         public void mousePressed(MouseEvent mouseEvent) {
              super.mousePressed(mouseEvent);
              // Cast IMxDocument into MxDocument so we can get the Parent which returns an Application
              MxDocument mxd = (MxDocument)mxDocument;
              Application application;
              // Create an Application object so we can get the left and top properties of the window
              //  so we can position the Field Teams GUI.
              try {
                   application = new Application(mxd.getParent());
                   left = application.getLeft() + 75;
                   top = application.getTop() + 105;
              } catch (IOException e2) {
                   e2.printStackTrace();
              try {
                   // Call the model to convert the screen coordinates to map coordinates and project the point to WGS_1984
                   Point p1 = new Point();
                   p1.putCoords((double)mouseEvent.getX(), (double)mouseEvent.getY());
                   Point p2 = (Point) model.getMapCoordinatesFromScreenCoordinates(p1, av);
                   Point point = (Point)model.handleToolMouseEvent(mouseEvent, av);
                 // Format the decimal degrees to six decimal places
                   DecimalFormat df = new DecimalFormat("#.######");
                   // Assign the point2 values to double
                   double x = point.getX();
                   double y = point.getY();
                   // Set the text of the lat/long fields.
                   arraView.getTxtLatitude().setText(df.format(y));
                   arraView.getTxtLongitude().setText(df.format(x));
                   // Set the Time of Reading text field
                   Date now = new Date();
                   SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
                   arraView.getTxtTimeOfReading().setText(sdf.format(now).toString());
                   // Determine whether the mouse click point intersects the arra_grid_quad.
                   //  If so, iterate over that feature cursor to update the gridl, gridn and quadrant fields...
                   IFeatureLayer featLayer = (IFeatureLayer) model.getLayerByName("arra_grid_quads", map);     
                   IFeatureClass featClass = featLayer.getFeatureClass();
                   Feature iFeat = (Feature) model.queryArraGridQuads(featClass, p2);
                   if(iFeat != null){
                        // Fill in the grid and quadrant values if there are any.
                        String gridl = (String) iFeat.getValue(iFeat.getFields().findField("GRID_L"));
                        String gridn = (String) iFeat.getValue(iFeat.getFields().findField("GRID_N"));
                        String quadrant = (String) iFeat.getValue(iFeat.getFields().findField("QUADRANT"));
                        arraView.getTxtGridL().setText(gridl);
                        arraView.getTxtGridN().setText(gridn);
                        arraView.getTxtQuadrant().setText(quadrant);
                   } else {
                        // Revert values back to empty string after clicking in the grid, then outside of the grid.
                        arraView.getTxtGridL().setText("");
                        arraView.getTxtGridN().setText("");
                        arraView.getTxtQuadrant().setText("");
                   // Set the Field Team Readings form to visible, or redisplay it if it is already visible
                   arraView.setBounds(left, top, 325, 675);
                   arraView.setVisible(true);
              } catch (Exception e) {
                   e.printStackTrace();
         @Override
         public boolean deactivate() throws IOException, AutomationException {
              return super.deactivate();
         @Override
         public boolean isChecked() throws IOException, AutomationException {
              return super.isChecked();
         public FTView getArraView() {
              return arraView;
         public IApplication getApp() {
              return app;
         public Map getMap() {
              return map;
         public FTModel getModel() {
              return model;
    }Is this enough?
    Edited by: user10199598 on Jan 9, 2012 3:20 PM

  • Trigger is firing multiple times

    Hi
      we have a table in database , which has multiple triggers defined by Vendor. I have created our own custom trigger on this table also , which fires last. Goal of this custom trigger is to send an email, when ever update happens on table. But somehow
    trigger is firing multiple times for same update, so it is sending multiple email for same update also
       Any advice?
    thanks
    Drew

    ALTER trigger [dbo].[AB_TABLEXXX_IUD_TR]
    on [dbo].[TABLEXXX]
    after insert,update,delete
    as
    begin
        set nocount on
        declare @sub varchar(1024)
        declare @tmpstr nvarchar(max)
     DECLARE @action as char(1);
     declare @id as int
     declare @send as int
        SET @action = 'I'; -- Set Action to Insert by default.
        declare @insCount int
     declare @delCount int
     DECLARE @newLineChar AS CHAR(2) = CHAR(13) + CHAR(10)
     DECLARE @tab as CHAR(1)=char(9)
        declare @vendorId char(30)  
     declare @detailmsg varchar(500)
     declare @ovname varchar(30),@nvname varchar(100)
     declare @ovchkname varchar(100),@nvchkname varchar(100)
     declare @oaddress1 varchar(100),@naddress1 varchar(100)
     declare @oaddress2 varchar(100),@naddress2 varchar(100)
     declare @oaddress3 varchar(100),@naddress3 varchar(100)
     declare @ouserdef1 varchar(100),@nuserdef1 varchar(100)
     declare @ovndclsid varchar(11),@nvndclsid varchar(11)
     select @tmpstr=''
     select @insCount = count(*) from INSERTED
     select @delCount = count(*) from DELETED
        if(@insCount > 0 or @delCount > 0)--if something was actually affected, otherwise do nothing
        Begin
            if(@insCount = @delCount)
                set @action = 'U'--is update
            else if(@insCount > 0)
                set @action = 'I' --is insert
            else
                set @action = 'D' --is delete
        End
     else
      select @action='X'
     if(@action='X') RETURN
     select @sub='Not Found'
     set @send=0
        if (@action='I')
     begin
      select top 1 @vendorId=rtrim(VENDORID),@nvname=rtrim(VENDNAME),@nvchkname=rtrim(VNDCHKNM), @naddress1=rtrim(ADDRESS1) ,
        @naddress2=rtrim(ADDRESS2),@naddress3=rtrim(ADDRESS3),@nuserdef1=rtrim(USERDEF1),@nvndclsid=rtrim(VNDCLSID) from inserted 
      select @sub=ORIGINAL_LOGIN()+' : '+'Data inserted in table ''TABLEXXX'''
      select @send=1
      select @sub=ORIGINAL_LOGIN()+' : '+'New Vendor
    '''+@nvname+''' is added'
      select @tmpstr=@sub
      select @tmpstr =@tmpstr+@newLineChar +'Inserted On: '+ Convert(varchar(50),sysdatetime())+@newLineChar
      select @tmpstr=@tmpstr+@newLineChar+'Vendor ID:
    '+@vendorId
      select @tmpstr=@tmpstr+@newLineChar+'Vendor Name:
    '+@nvname
      select @tmpstr=@tmpstr+@newLineChar+'Check Name:
    '+@nvchkname
      select @tmpstr=@tmpstr+@newLineChar+'Address1:
    '+@naddress1
      select @tmpstr=@tmpstr+@newLineChar+'Address2:
    '+@naddress2
      select @tmpstr=@tmpstr+@newLineChar+'Address3:
    '+@naddress3
      select @tmpstr=@tmpstr+@newLineChar+'User Def:
    '+@nuserdef1
      select @tmpstr=@tmpstr+@newLineChar+'Class ID:
    '+@nvndclsid
     end
     if (@action='U')
     begin
      select @sub=ORIGINAL_LOGIN()+':''Data Updated in table ''TABLEXXX'''  
      declare @iTotal int
      select @iTotal =0
      select @detailmsg=''
      create table #new_values(
       VENDORID varchar(100) NULL,
       processed char(1) NULL
      insert into #new_values
         select distinct VENDORID,NULL from inserted  
      while ((select count(*) from #new_values where processed is null)>0 and @iTotal<=50)
      begin
         --PRINT 'UPDATE Entered ' +@action
       select @iTotal=@iTotal+1
       select top 1 @vendorId=VENDORID from #new_values where processed is null
       update #new_values set processed='Y' where
    VENDORID=@vendorId and processed is null
       select @detailmsg=''
       select
         top 1       
           @ovname=o.VENDNAME, @nvname=n.VENDNAME,
        @ovchkname=o.VNDCHKNM,@nvchkname=n.VNDCHKNM,
        @oaddress1=o.ADDRESS1,@naddress1=n.ADDRESS1,
        @oaddress2=o.ADDRESS2,@naddress2=n.ADDRESS2,
        @oaddress3=o.ADDRESS3,@naddress3=n.ADDRESS3,
        @ouserdef1=o.USERDEF1,@nuserdef1=n.USERDEF1,
        @ovndclsid=o.VNDCLSID,@nvndclsid=n.VNDCLSID
       from  inserted n,deleted o
       where n.VENDORID=o.VENDORID and n.VENDORID
    =@vendorId
       if (update(VENDNAME) and @ovname<>@nvname) select @detailmsg
    =@detailmsg+ @newLineChar
    +@tab+'Vendor Name: '+rtrim(@ovname)+' => '+rtrim(@nvname)
       if (update(VNDCHKNM) and @ovchkname<>@nvchkname) select @detailmsg
    =@detailmsg+ @newLineChar
    +@tab+'Check Name: '+rtrim(@ovchkname)+' => '+rtrim(@nvchkname)
       if (update(ADDRESS1) and @oaddress1<>@naddress1) select @detailmsg
    =@detailmsg+ @newLineChar
    +@tab+'Address1: '+rtrim(@oaddress1)+' => '+rtrim(@naddress1)
       if (update(ADDRESS2) and @oaddress2<>@naddress2) select @detailmsg
    =@detailmsg+ @newLineChar
    +@tab+'Address2: '+rtrim(@oaddress2)+' => '+rtrim(@naddress2)
       if (update(ADDRESS3) and @oaddress3<>@naddress3) select @detailmsg
    =@detailmsg+ @newLineChar
    +@tab+'Address3: '+rtrim(@oaddress3)+' => '+rtrim(@naddress3)
       if (update(USERDEF1) and @ouserdef1<>@nuserdef1) select @detailmsg
    =@detailmsg+ @newLineChar
    +@tab+'User Def: '+rtrim(@ouserdef1)+' => '+rtrim(@nuserdef1)
       if (update(VNDCLSID) and @ovndclsid<>@nvndclsid) select @detailmsg
    =@detailmsg+ @newLineChar
    +@tab+'Class ID: '+rtrim(@ovndclsid)+' => '+rtrim(@nvndclsid)
       if(len(@detailmsg)>0)
       begin
           select @send=1
        if (len(@tmpstr)<=0)
        begin
          select @sub=ORIGINAL_LOGIN()+' : '+'Vendor '''+rtrim(@ovname)+''' Updated in table TABLEXXX'
          select @tmpstr='Vendor '''+rtrim(@ovname)+''' Updated'
          select @tmpstr
    =@tmpstr+@newLineChar +@tab+'Updated On: '+ Convert(varchar(50),sysdatetime())+@newLineChar
          select @tmpstr
    =@tmpstr+@newLineChar +@tab+'Vendor ID: '+rtrim(@vendorId)
        end
        select @tmpstr=@tmpstr +@detailmsg
       end
      end
     end
     if (@action='D')
     begin
      select top 1 @vendorId=rtrim(VENDORID),@nvname=rtrim(VENDNAME),@nvchkname=rtrim(VNDCHKNM), @naddress1=rtrim(ADDRESS1) ,
        @naddress2=rtrim(ADDRESS2),@naddress3=rtrim(ADDRESS3),@nuserdef1=rtrim(USERDEF1),@nvndclsid=rtrim(VNDCLSID) from deleted 
      select @send=1
      select @sub=ORIGINAL_LOGIN()+' : '+'Vendor
    '''+@nvname+''' is DELETED'
      select @tmpstr=@sub
      select @tmpstr =@tmpstr+@newLineChar +'Deleted On: '+ Convert(varchar(50),sysdatetime())+@newLineChar
      select @tmpstr=@tmpstr+@newLineChar+'Vendor ID:
    '+@vendorId
      select @tmpstr=@tmpstr+@newLineChar+'Vendor Name:
    '+@nvname
      select @tmpstr=@tmpstr+@newLineChar+'Check Name:
    '+@nvchkname
      select @tmpstr=@tmpstr+@newLineChar+'Address1:
    '+@naddress1
      select @tmpstr=@tmpstr+@newLineChar+'Address2:
    '+@naddress2
      select @tmpstr=@tmpstr+@newLineChar+'Address3:
    '+@naddress3
      select @tmpstr=@tmpstr+@newLineChar+'User Def:
    '+@nuserdef1
      select @tmpstr=@tmpstr+@newLineChar+'Class ID:
    '+@nvndclsid
     end
     if (@action<>'X' and @send=1)
     begin
      Exec msdb.dbo.sp_send_dbmail
       @profile_name='default',   
       @recipients='[email protected]',
       @subject= @sub,
       @body=@tmpstr
     end
    end
    Drew

  • WHEN-VALIDATE-TRIGGER trigger looping so many times

    Hi,
    Below is the code written in WHEN-VALIDATE-TRIGGER trigger and after raise FORM-TRIGGER_FAILURE
    the process is not stopping and the trigger message looping without end when
    I tab to the next field or try to save the record. I am not sure why the flow did not stop
    after the raise FORM_TRIGGER_FAILURE exception and the trigger looping again and again.
    Please help me to know what is wrong in the code. This trigger written in ITEM level.
    declare
                     msg_type varchar2(3);
                  msg_text varchar2(2000);
                  continue       boolean;
                begin
                  if :pom1_b22.qty < 0 then
                    message_ppkg.get_msg_from_db('RET','04060',msg_type,msg_text);
                    message(msg_text || '.');
                    bell;
                    raise form_trigger_failure;
                  else
                    continue := TRUE;
                    if :pom1_b22.qty is not null and :pom1_b22a.b22_query = 'FALSE' then
                      if nvl(:pom1_b22.irt_created,'N') = 'Y' then
                        if :pom1_b22.qty <> :pom1_b22.save_qty and
                          :pom1_b22.save_qty is not null then                    
                          if check_order_status then
                            continue := TRUE;
                          else
                            continue := FALSE;
                             message_ppkg.get_msg_from_db('RET','04061',msg_type,msg_text);
                             message(msg_text);   
                            bell;
                            :pom1_b22.qty := :pom1_b22.save_qty;
                            raise form_trigger_failure;
                          end if;
                        end if;
                      end if;                
                      if continue then
                        if :pom1_b22.save_qty is null then
                          if :pom1_b22.qty > :pom1_b22a.total_qty then
                             message_ppkg.get_msg_from_db('RET','04057',msg_type,msg_text);
                             message(msg_text || to_char(:pom1_b22a.total_qty) || '.');   
                            bell;
                            raise form_trigger_failure;
                          end if;
                        else
                          if :pom1_b22.qty <> nvl(:pom1_b22.save_qty,0) then
                            if :pom1_b22.qty > :pom1_b22a.total_qty +
                                               (nvl(:pom1_b22.save_qty,0) -
                                                :pom1_b22.qty) then
                                                    message_ppkg.get_msg_from_db('RET','04056',msg_type,msg_text);
                             message(msg_text || to_char(:pom1_b22a.total_qty +
                                              (nvl(:pom1_b22.save_qty,0) -
                                               :pom1_b22.qty)));                 
                              bell;
                              raise form_trigger_failure;
                            end if;
                          end if;
                        end if;
                      end if;
                    end if;
                  end if;
                end;

    Your Raise form_Trigger_failure Condition is not met hence not stopping the rest trigger body.

  • When validate getting fired in Clear_block(No_Validate)

    When validate getting fired in Clear_block(No_Validate)
    In my button where code for clear block is present there is navigation to some of the blocks where when-validate triggers are present.
    As suggested in one of the solutions posted in metalink I cannot set the mouse navigate property of the button to No due to design constraints. Also navigation to other blocks cannot be prevented.
    The code in when-validate tests whether the field is null or not.Hence it bombs after a clear block (no validate).
    As a work around I created a timer in when validate and placed my code for validation in the whentimer expired trigger.It works fine, but does not seem to be a good patch.
    Can you suggest a better solution.
    Regards,
    Vinson

    The code in when-validate tests whether the field is
    null or not. Hence it bombs after a clear block (no
    validate). In your when-validate, do this first:
    If :system.record_status = 'NEW' then
      Return;
    End if;
    The return causes the when-validate to exit successfully, before it checks the field for null. You will want to place some validation somewhere else (in the key-commit or in the commit button wbp trigger) to ensure your field is not null before a commit is executed.

  • Problem using when-validate-trigger

    Dear Experts,
    After validating a item value, I want to navigate to a specified item besed on that item value. If i use go_item('item1') in when-validate-trigger, error comes, beacuse we cannot use restricted built-in go_item in when-validate-trigger. If i use key-next-item on 'item1' for validating item value then while navigating through mouse it does'nt fire.
    Please let me know which triiger i should use?
    Thanks
    Abhishek Rustagi

    There is no easy way to do this, however you could create a timer in your when-validate-item trigger which expires immediately, and place all of your navigational code in the when-timer-expired trigger - this way you could check the value which has been entered and navigate accordingly.

  • When validate trigger block level

    Hi,
    I Have a form application. On the entrance page If a user forget to enter his name or Password the form prompt the message to aware him about what is missing.
    SO I wrote the folloing code on when validate trigger block level, but it did not work according to my needs, should I replace this trigger with other?
    Sharbat
    BEGIN
         if:Block1.User is null then
         message('Please enter the user name);
         raise form_trigger_failure;
         if:Block1.password is null then
         message('Please enter the password'););
              raise form_trigger_failure;
              end if;
    end if;
    end;

    use
    if:Block1.User is null then
    message('Please enter the user name);
    raise form_trigger_failure;
    end if;
    on key-next-item of user textbox
    and
    if:Block1.password is null then
    message('Please enter the password'););
    raise form_trigger_failure;
    end if;
    on the key-next-item of the password text box

  • When validate trigger forms 6i

    Please help me to create when validate item trigger.
    There is one table "job" - id, status
    status is X or null. i want to do in forms. when someone is entering value for id, it should check first the status for that id in job table status field.
    if status is null then it should show msg "this id is already open for another job"
    Edited by: only.ashish99 on Dec 26, 2012 1:44 PM

    Hi,
    So You mean that if the user dosent enter the staus then u need to show a message and if the entered status is there in ur table and then u need to show a message.
    Just write in the when validate trigger
    declare
    v_status number;
    begin
    select count(status) into v_status from table;
    If :Block.field_name is null then
    message('');
    Else
    If v_status=0 then
    ur action
    else
    Message('this job is exist for another');
    End if;
    end if;
    End;
    Try this.
    Regards
    Sri

  • Problem in using when-validate-trigger

    Dear Experts,
    After validating a item value, I want to navigate to a specified item besed on that item value. If i use go_item('item1') in when-validate-trigger, error comes, beacuse we cannot use restricted built-in go_item in when-validate-trigger. If i use key-next-item on 'item1' for validating item value then while navigating through mouse it does'nt fire.
    Please let me know which triiger i should use?
    Thanks
    Abhishek Rustagi

    Hi, the way I use to solve this problem is using both: key-next-item and when-validate-item. In the w-v-i you make the validations you need (this control mouse navigation) and in the k-n-i code write:
    -- first validate the values, to avoid invalid values
    execute_trigger ('when-validate-item');
    -- if trigger fire corectly then you can go to the item you want..
    if my_item = 'A' then
    go_item(my_next_item1);
    elsif my_item = 'B' then
    go_item(my_next_item2);
    end if;
    Ruben.

  • Form_trigger_failure in when-validate-record fired message three times

    Hello all,
    I have a problem with one of my forms. Indeed, I have used when-validate-record trigger to validate fields block.
    So, when user fills a duplicate I display an error message with two choices. Accept or proceed to change. The action button 1 is impeccable.
    But when the user clicks the button 2 of the message, I raise form_trigger_failure exception. What is strange is that my error message appears three times if I get out of the record by the mouse but once I get out of line by the tab.
    Is there someone who can help me on that?
    Please, find below the code that produce this result :
    IF :CTRL2.MATCH_REC > 1 then
         L_ALERT := SHOW_ALERT('ALERTE_1');
         IF L_ALERT = ALERT_BUTTON1 Then
    NULL;
         elsif L_ALERT = ALERT_BUTTON2 Then
         raise Form_trigger_failure;
         end IF;
    end IF;
    Thank you in advance

    Dear CraigB,
    Thank you for your answer but I still working without success.
    I found that the trigger W-V-R is fired thee times so the value of :CTRL2.MATCH_REC is recalculated every time (as shown by Kevin D Clarke about validating duplicate http://forums.oracle.com/forums/profile.jspa?userID=8905) witch is correct.
    If I affect 0 or null to :CTRL2.MATCH_REC, it's not raising finally the form_trigger_failure (F_T_F), so it's working has button 1.
    Note that I found after catching others exception (exception when others then...) a 100501 non-oracle exception.
    I don't know if my repetition is caused by this exception?
    Note again that, when I put other statement instead of raising F_T_F, it's working fine. His just only when I raise F_T_F that I have this behaviour.
    Do you have any idea ?
    Thanks in advance
    Edited by: pkn87897 on Oct 23, 2008 7:09 AM

  • CFSchedule firing multiple times

    Hi Everyone,
    i still have not found a solution to this. if anyone has any
    other suggestions please let me know.
    Also i would like to report this as a bug, what is the proper
    procedure for reporting this?
    thanks to all
    Tim
    Original- Hi All,
    i have had issues since upgrading from 6 to 7 with
    cfschedule. sometimes it runs fine, other times it will run the
    same task multiple times in a row, other times it will wait an hour
    then run the same task again.
    This may not sound like a big deal, but the tasks send out
    several thousands of emails. talk about spam!!
    I have been screamed at on a weekly basis to make this stop.
    Now since the the DST change, the tasks that were scheduled
    at 3pm run at 3pm and again at 4pm!!
    Please someone help!!!!!!!!!!!!!!!!!!!!!
    Thanks in advance.
    Tim

    Hi BK,
    in my task is setup to run every 15 with a start date of a
    few days ago and no end date or time.
    it calls a file on the same server via its dsn name.
    The file it calls is this:
    [code]
    <cfset testtext = "Testing st #now()#">
    <cfset testSTname = "d:\st_test_" &
    #DateFormat(now(),"yyyymmdd")#&""&#TimeFormat(now(),"HHmmss")#
    &".txt">
    <!--- <cffile action="write" file="#testSTname#"
    output="#testtext#" nameconflict="makeunique"> --->
    <cfmail to="[email protected]" from="[email protected]"
    subject="st timer test">
    #Dateformat(now(),"mm/dd/yyyy")#
    #TimeFormat(now(),"hh:mm:ss:l")#
    </cfmail>
    [/code]
    If you notice i commented out the file write. something was
    puzzling about it, it would write fine for an hour then once in
    awhile write multiples (by comparing the date created on the file
    in windows.
    I then found the calls in my IIS log file, every single call
    was done twice at exactly the same time.
    (edited for security)
    [code]
    2007-07-30 22:15:06 x.x.x.x GET /tools/test_ts.cfm - 80 -
    x.x.x.x CFSCHEDULE 200 0 0
    2007-07-30 22:15:06 x.x.x.x GET /tools/test_ts.cfm - 80 -
    x.x.x.x CFSCHEDULE 200 0 0
    2007-07-30 22:30:06 x.x.x.x GET /tools/test_ts.cfm - 80 -
    x.x.x.x CFSCHEDULE 200 0 0
    2007-07-30 22:30:06 x.x.x.x GET /tools/test_ts.cfm - 80 -
    x.x.x.x CFSCHEDULE 200 0 0
    2007-07-30 22:45:08 x.x.x.x GET /tools/test_ts.cfm - 80 -
    x.x.x.x CFSCHEDULE 200 0 0
    2007-07-30 22:45:08 x.x.x.x GET /tools/test_ts.cfm - 80 -
    x.x.x.x CFSCHEDULE 200 0 0
    [/code]
    So i decieded to make it send an email, this way there is a
    queue so to speak for the messages to be written, i think this is
    why i saw speratic multiples with cffile.
    Email 1 contents: {ts '2007-07-31 01:30:00'} 01:30:00:769
    Email 2 contents: {ts '2007-07-31 01:30:00'} 01:30:00:909
    So far, i am only getting 2 copies for every fire of the
    task, but i have seen in other tasks that email, up to 6 copies.
    i can see this in IIS Logs, the test cfm file being called at
    least twice per task for long periods, then other tasks will fire
    and i only see a single call to the test cfm file. but its next
    execution time is duplicated if there is no other tasks running
    during the same time period
    I have dug through all the logs for each task, so far all of
    the task that have no end date fire multiple times.
    I can see the results (files written, db records inserted,
    emails sent, IIS log files).
    all show duplicates during same creation time Except the
    scheduler.log it only shows each of those tasks firing once.
    I can only assume that the scheduler log is being updated
    correctly which leads me to belive that this log entry is done some
    time before the scheduler payload execution or the scheduler code
    dosnt log multiple triggers on its actions.
    So i am going to set the End date for this test task to see
    if the duplicates stop.
    more to come
    Tim

  • Form disappears when clicking search help multiple times

    Hi All,
    I have created an interactive adobe form with Web dynpro application.
    We have multiple multiple search helps (custom and standard) on the form.
    when the user clicks on any search helps multiple times (4-5 times), the whole form disappears.
    Please provide some solution / hints.
    Best regards,
    Meep.

    We are not facing this problem on Adobe 9.4. The newest v10.1 has this problem.
    Also, this issue is only on 1 server and on other, it works fine.
    We are using Native control with ZCI layout.

  • Issue with instead of trigger on a view

    Gurus,
    I have an issue with an instead of trigger on a view. The trigger is listed below. The insert and update seem to be working fine but the delete section is not.
    From the application, we have a screen on which we attach images. We trigger of an insert and update when we attach images. We are using hibernate as our object relational mapping tool.
    We have added some logging into the delete section but that portion of the trigger does not seem to be executing at all.
    Please advise.
    Thanks
    Hari
    CREATE OR REPLACE TRIGGER trg_vw_result_image_uid
    INSTEAD OF
    INSERT OR DELETE OR UPDATE
    ON vw_result_image
    REFERENCING NEW AS NEW OLD AS OLD
    DECLARE
    v_cnt number(38);
    v_cnt_old number(38);
    v_err_msg VARCHAR2 (250);
    BEGIN
    -- v_rslt_id number(38);
    -- v_cnt number(38);
    select count(1) into v_cnt from result_image_master
    where RSLT_IMAGE_ID = :new.RSLT_IMAGE_ID;
    --select count(1) into v_cnt from result_image_master
    -- where ACC_BLKBR_ID = :new.ACC_BLKBR_ID
    -- and upper(RSLT_IMAGE_NM) = upper(:new.RSLT_IMAGE_NM);
    select count(1) into v_cnt_old from result_image_master
    where RSLT_IMAGE_ID = :old.RSLT_IMAGE_ID;
    insert into t2( TEXT_VAL, DT1, seq1)
    values (' before v_cnt', sysdate, t6.NEXTVAL);
    --if v_cnt = 0
    --****INSERTING
    IF INSERTING
    THEN
    insert into t2( TEXT_VAL, DT1, seq1)
    values (' v_cnt is 0 and inserting into result_image_master', sysdate, t6.NEXTVAL);
    insert into t2( TEXT_VAL, DT1, seq1)
    values (' inserted bb id :'||:new.ACC_BLKBR_ID, sysdate, t6.NEXTVAL);
    insert into result_image_master (
    RSLT_IMAGE_ID
    ,RSLT_IMAGE_HBR_VER
    ,RSLT_IMAGE_TYPE_ID
    ,RSLT_IMAGE_NM
    ,RSLT_IMAGE_LABEL
    ,RSLT_IMAGE_SEQ
    ,RSLT_SHOW_ON_RPT
    ,RSLT_SLIDE_NO
    ,RSLT_CELL_NO
    ,RSLT_X_COORD
    ,RSLT_Y_COORD
    ,ACC_BLKBR_ID
    ,CREATED_BY
    ,DATE_CREATED
    ,MODIFIED_BY
    ,DATE_MODIFIED
    values (
    :new.RSLT_IMAGE_ID
    ,:new.RSLT_IMAGE_HBR_VER
    ,:new.RSLT_IMAGE_TYPE_ID
    ,:new.RSLT_IMAGE_NM
    ,:new.RSLT_IMAGE_LABEL
    ,:new.RSLT_IMAGE_SEQ
    ,:new.RSLT_SHOW_ON_RPT
    ,:new.RSLT_SLIDE_NO
    ,:new.RSLT_CELL_NO
    ,:new.RSLT_X_COORD
    ,:new.RSLT_Y_COORD
    ,:new.ACC_BLKBR_ID
    ,:new.CREATED_BY
    ,:new.DATE_CREATED
    ,:new.MODIFIED_BY
    ,:new.DATE_MODIFIED
    insert into result_image_blob (
    RSLT_IMAGE_ID
    ,rslt_image_blob
    values (
    :new.RSLT_IMAGE_ID
    ,:new.rslt_image_blob
    --****UPDATING
    ELSIF UPDATING
    -- v_cnt > 0 --
    THEN
    insert into t2( TEXT_VAL, DT1, seq1)
    values (' updating result_image_master', sysdate, t6.nextval);
    insert into t2( TEXT_VAL, DT1, seq1)
    values (' updating bb id :'||:new.ACC_BLKBR_ID, sysdate, t6.nextval);
    update result_image_master
    set RSLT_IMAGE_HBR_VER = RSLT_IMAGE_HBR_VER + 1
    ,RSLT_IMAGE_TYPE_ID = :new.RSLT_IMAGE_TYPE_ID
    ,RSLT_IMAGE_NM = :new.RSLT_IMAGE_NM
    ,RSLT_IMAGE_LABEL = :new.RSLT_IMAGE_LABEL
    ,RSLT_IMAGE_SEQ = :new.RSLT_IMAGE_SEQ
    ,RSLT_SHOW_ON_RPT = :new.RSLT_SHOW_ON_RPT
    ,RSLT_SLIDE_NO = :new.RSLT_SLIDE_NO
    ,RSLT_CELL_NO = :new.RSLT_CELL_NO
    ,RSLT_X_COORD = :new.RSLT_X_COORD
    ,RSLT_Y_COORD = :new.RSLT_Y_COORD
    ,ACC_BLKBR_ID = :new.ACC_BLKBR_ID
    ,MODIFIED_BY = :new.MODIFIED_BY
    ,DATE_MODIFIED = :new.DATE_MODIFIED
    where RSLT_IMAGE_ID = :new.RSLT_IMAGE_ID;
    update result_image_blob
    set rslt_image_blob = :new.rslt_image_blob
    where RSLT_IMAGE_ID = :new.RSLT_IMAGE_ID;
    END IF;
    IF DELETING OR v_cnt_old > 0
    THEN
    insert into t2( TEXT_VAL, DT1, seq1) values (' deleting rows ...', sysdate, t6.NEXTVAL);
    DELETE from result_image_blob where RSLT_IMAGE_ID = :old.RSLT_IMAGE_ID;
    insert into t2( TEXT_VAL, DT1, seq1) values ('deleting result_image_blob : '||:old.RSLT_IMAGE_ID , sysdate, t6.NEXTVAL);
    DELETE from result_image_master where RSLT_IMAGE_ID = :old.RSLT_IMAGE_ID;
    insert into t2( TEXT_VAL, DT1, seq1) values ('deleting result_image_master : '||:old.RSLT_IMAGE_ID , sysdate, t6.NEXTVAL);
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    v_err_msg := SQLERRM;
    insert into t2( TEXT_VAL, DT1, seq1) values (v_err_msg, sysdate, t6.nextval);
    END;
    Edited by: bhanujh on Sep 13, 2010 7:55 AM

    bhanujh wrote:
    The error msg that we are getting is
    09/08/2010 4:02:09 PM: Unable to save the results :: Could not execute JDBC batch updateSorry, we don't recognize this message as any valid Oracle error.
    :p

Maybe you are looking for

  • Mapping to an IDOC

    Hello, I'm mapping an XML structure to an IDOC and the mapping goes through the compilation but when I test the mapping nothing happens??? Are there any possibility to look to a log file and see what the server is doing. I mean the way you do in webM

  • How to stop monitor from going black after no activity for a short time while reading a document?

    When I'm reading an e-mail or document without moving my mouse, the screen turns black after only about one minute and then switches to my screen saver.  I must move the mouse constantly to keep my active window open.  I can't find out how to turn th

  • Ubuntu on ipod as external drive

    I have no idea if this is where I should put this, but here goes: Ubuntu is on my iPod as an external drive. While it will boot to a pc that has both windows and ubuntu on it, it will not boot to my mac, because my mac won't recognize it as an extern

  • Adicom30.ins(102) permission_denied

    Hi, I am running Windows 7 and don't know much about ADI. At my job I was tasked to do an ADI install for one of our users on Windows 7. During the installation I get an ERROR INFORMATION window saying adicom30.ins(102): PERMISSION_DENIED while getti

  • Modify html file on apps but no change

    i created a html file that's uploaded to apps. After that i modified it, uploaded and replaced again I run it but no change from old file url: http://server:port/OA_HTML/test.htm could you help me ?