Home » Developer & Programmer » Forms » Problem in Showing Alert (Forms 6i)  () 1 Vote
Problem in Showing Alert [message #394597] Sat, 28 March 2009 05:35 Go to next message
sivajyothi.kalikiri
Messages: 29
Registered: March 2009
Junior Member
Dear All,
What's my requirement is, in Detail block if have one item ACCNM, If that has service tax flag then i should display one alert message, service tax is applicable or not.If i click button1 i.e YES, i should get service tax as ACCNM and its corresponding code in the next record.

I am getting everything, but the alert message is coming twice.
I wrote the following code in WHEN-NEW-RECORD-INSTANCE

DECLARE
	v_chkActive VARCHAR2(10);
	v_ret_alert NUMBER;

BEGIN
    GO_BLOCK('T_CBJ_DTL');
    FIRST_RECORD;
    IF :T_CBJ_DTL.ACCD IS NOT NULL THEN
    SELECT ser_tax
    INTO   v_chkactive
    FROM    m_acmst
    WHERE  accd = :T_CBJ_DTL.ACCD;
    
       IF v_ChkActive = 'Y' 
       THEN
         v_ret_alert := show_alert('SERVICETAX_ALERT');
         IF v_ret_alert = ALERT_BUTTON1 
     	 THEN 
       	   NEXT_RECORD;
      	     :T_CBJ_DTL.SL_NO := :SYSTEM.CURSOR_RECORD;
	     :T_CBJ_DTL.ACCD := 9695;
	     :T_CBJ_DTL.ACNM := 'Service Tax';    	
        END IF;
      END IF;  
    END IF;      
END; 

[EDITED by LF: applied [code] tags]

[Updated on: Sat, 28 March 2009 16:10] by Moderator

Report message to a moderator

Re: Problem in Showing Alert [message #394613 is a reply to message #394597] Sat, 28 March 2009 11:22 Go to previous messageGo to next message
itech
Messages: 168
Registered: May 2008
Location: Fsd, Pakistan
Senior Member

that can because u are alling

NEXT_RECORD;

and this in turn call the when-new-record-instance trigger.

i think u are applying the logic at wrong palce / trigger.

why u are using


GO_BLOCK('T_CBJ_DTL');
FIRST_RECORD;


as user can navigate to it from master block to detail block. you can set the property to change data block for the master block.
Re: Problem in Showing Alert [message #394732 is a reply to message #394613] Sun, 29 March 2009 23:41 Go to previous messageGo to next message
sivajyothi.kalikiri
Messages: 29
Registered: March 2009
Junior Member
Why i used NEXT_RECORD is it should display in the next_record I mean in the second record. If i am not mentioning NEXT_RECORD means it is over writing in the first record.
Re: Problem in Showing Alert [message #394734 is a reply to message #394732] Sun, 29 March 2009 23:54 Go to previous messageGo to next message
sivajyothi.kalikiri
Messages: 29
Registered: March 2009
Junior Member
It will check the first recoed in the detail block whether it has service tax or not, if it is there means it should show alert message as service tax is applicable or not, if i press 'YES' means it should go the next record and print accd as 9695 and acnm as service tax, where acnm and accd are fields in the detail block.
Re: Problem in Showing Alert [message #394758 is a reply to message #394613] Mon, 30 March 2009 03:45 Go to previous messageGo to next message
sivajyothi.kalikiri
Messages: 29
Registered: March 2009
Junior Member
please tell me the solution to my problem
Re: Problem in Showing Alert [message #394814 is a reply to message #394597] Mon, 30 March 2009 07:04 Go to previous messageGo to next message
cookiemonster
Messages: 12415
Registered: September 2008
Location: Rainy Manchester
Senior Member
As itech suggested you're doing this in the wrong place.
You shouldn't try and use WHEN-NEW-RECORD instance - even if you got it to stop showing the alert twice do you want it to show the alert everytime the user navigates to the record in question?

Consider using a button.

That said, why aren't you creating this 2nd record at the same time as the first?
Re: Problem in Showing Alert [message #394820 is a reply to message #394814] Mon, 30 March 2009 07:24 Go to previous messageGo to next message
sivajyothi.kalikiri
Messages: 29
Registered: March 2009
Junior Member
i suggested to my project leader of using a button.
he doesn't want to put a button.

i tried with other triggers also WHEN-VALIDATE-RECORD by removing NEXT_RECORD and GO_BLOCK code.
it's not working. when i removes NEXT_RECORD means it will over write the first_record.
How can i create 2nd record at the same time as the first.
i don't have any idea. can u tell me how to get that.
Actually i used one pushbutton to get first record accd,acnm fields.
i asked my project leader i will use that push button to get second record fields accd,acnm.
But he is not agreeing for that. after entering the last item in the first record only he wants to display the alert message
and should display the fields accd,acnm in second record.
What is the solution for this.


Re: Problem in Showing Alert [message #394861 is a reply to message #394597] Mon, 30 March 2009 10:58 Go to previous messageGo to next message
cookiemonster
Messages: 12415
Registered: September 2008
Location: Rainy Manchester
Senior Member
Let's just clarify what the process is.
Is it like this:
1) user enters record in T_CBJ_DTL block.
2) If the ser_tax for the entered account is 'Y' then you want an alert to appear.
3) If the user clicks on Yes then you want a new record to appear in the T_CBJ_DTL block with some hard-coded values.

I'm assuming that the WHEN-NEW-RECORD-INSTANCE trigger from your first post is on the T_CBJ_DTL block?
Re: Problem in Showing Alert [message #394967 is a reply to message #394861] Mon, 30 March 2009 23:02 Go to previous messageGo to next message
sivajyothi.kalikiri
Messages: 29
Registered: March 2009
Junior Member
Yes,that is my requirement.
What i have to do?
Re: Problem in Showing Alert [message #395101 is a reply to message #394861] Tue, 31 March 2009 05:22 Go to previous messageGo to next message
sivajyothi.kalikiri
Messages: 29
Registered: March 2009
Junior Member
Finally, I solved that problem.
Re: Problem in Showing Alert [message #395122 is a reply to message #394597] Tue, 31 March 2009 07:02 Go to previous message
cookiemonster
Messages: 12415
Registered: September 2008
Location: Rainy Manchester
Senior Member
Glad to hear it.

Care to share your solution?
Previous Topic: Form to Ms Access database
Next Topic: detail block not displaying values when master block is executed
Goto Forum:
  


Current Time: Wed Dec 07 20:22:14 CST 2016

Total time taken to generate the page: 0.19040 seconds