RAISE form_trigger_failure not working in purchase order form

Hi,
I am working on a customization in Purchase Order Form (poxpoepo)
This is what I tried to do.
CURSOR 1_cur IS
SELECT pol.LINE_NUM v_line
,gcc.segment1 v_seg
FROM gl_code_combinations gcc
,PO_DISTRIBUTIONS_ALL pod
,po_lines_all pol
WHERE SUBSTR(gcc.SEGMENT1,1,1) = 'X'
AND gcc.code_combination_id = pod.code_combination_id
AND pod.PO_LINE_ID = pol.PO_LINE_ID
AND pol.po_line_id = v_po_line
AND pol.PO_HEADER_ID = v_po_header;
CURSOR 2_cur IS
SELECT pol.LINE_NUM v_line
,gcc.segment1 v_seg
FROM gl_code_combinations gcc
,PO_DISTRIBUTIONS_ALL pod
,po_lines_all pol
WHERE SUBSTR(gcc.SEGMENT1,1,1) = 'X'
AND gcc.code_combination_id = pod.code_combination_id
AND pod.PO_LINE_ID = pol.PO_LINE_ID
AND pol.PO_HEADER_ID = v_po_header;
BEGIN
v_error_found := false ;
IF (form_name = 'POXPOEPO' AND
(block_name IN ('PO_LINES' ,
'PO_SHIPMENTS',
'PO_DISTRIBUTIONS') AND
event_name = 'WHEN-NEW-ITEM-INSTANCE') OR
(block_name = 'PO_HEADERS' AND
event_name = 'WHEN-NEW-RECORD-INSTANCE' AND
name_in('SYSTEM.BLOCK_STATUS') = 'QUERY' ) OR
(block_name = 'PO_APPROVE' AND
event_name = 'WHEN-NEW-BLOCK-INSTANCE' )
) AND
NAME_IN('PO_LINES.PO_HEADER_ID') IS NOT NULL AND
NAME_IN('PO_LINES.PO_LINE_ID') IS NOT NULL AND
name_in('PO_LINES.LINE_NUM') >= 1 ) THEN
v_po_header_id := NAME_IN('PO_LINES.PO_HEADER_ID');
v_po_line_id := NAME_IN('PO_LINES.PO_LINE_ID');
v_line_num := NAME_IN('PO_LINES.LINE_NUM');
IF block_name in ('PO_LINES' , 'PO_SHIPMENTS', 'PO_DISTRIBUTIONS') THEN
v_seg := null;
FOR cursor1 in 1_cur
LOOP
if cursor1.v_seg = 'X' THEN
v_seg := 'X';
v_line_num := cursor1.v_line;
EXIT;
end if;
END LOOP;
ELSIF block_name in ('PO_HEADERS','PO_APPROVE') THEN
FOR cursor2 in 2_cur
LOOP
if cursor2.v_seg = 'X' THEN
v_seg := 'X';
v_line_num := cursor2.v_line;
EXIT;
end if;
END LOOP;
END IF;
IF v_seg = 'X' then
fnd_message.set_string('custom message to be displayed.');
FND_MESSAGE.ERROR;
IF block_name = 'PO_APPROVE' THEN
go_block('PO_HEADERS');
raise form_trigger_failure;
END IF;
END IF;
END IF;
END;
I actually want to achieve somewhat like this. When ever the charge account field start with 'X' or in other words if segment1 is 'X' and if changes are made to that line like note to supplier is changed and saved then the user should not be allowed to approve/reapprove the order and it shall pop up the message and ONLY restrict from going further if the user hits the APPROVE button. Highlighted in bold should have actually taken care of the requirement from proceeding to the next level of approval but it is not. I have had several debug messages and I am pretty sure that it is satisfying the condition of going to the PO_APPROVE block and still not raising form trigger failure. Could you please help me handle this scenario?

Your Raise works -- it will terminate your procedure, Change_Detail_Block_Status.
But, how are you calling the procedure? It is in THAT place that you should look for your problem.
If you call the procedure, and then have coded EXCEPTION WHEN OTHERS THEN.... or something similar, you might be ignoring the "Raise FTF".
In addition, you probably need to add these lines in your form where navigation or a commit or similar code causes a trigger to call your procedure:
If not Form_Success then
Raise Form_Trigger_Failure;
End if;

Similar Messages

  • Buitin RAISE FORM_TRIGGER_FAILURE not working in forms Personalization

    Hi,
    I create a SIT where i dn't want user to create more than 1 record. I successfully able to set the condition and popup error message in action tab when more than 1 record is entered by the user. Now I want to stop further processing and for that purpose I use built-in RAISE FORM_TRIGGER_FAILURE. But it won't work and user can able to process further easily.
    Can any one guide me how I acheive this using forms personalization?

    Pl see ML Doc 420518.1 on why this does not work
    HTH
    Srini

  • Raise Form_Trigger_Failure Not Working

    On my form I have a button. This button updates 3 base table items from it's when-button-pressed trigger.
    My problem is that when another user comes along and clicks the button for the same record before a previous user has committed their changes the following messages are displayed 3 times (once for each item that the button attempts to update fields?):
    1. Could not reserve record (2 tries). Keep trying?
    2. FRM-40501: ORACLE error: unable to reserve record for update or delete
    My desired result would be that these messages only appear once regardless of how many items the button attempts to update and that the form processing would be stopped after the first messages are displayed. This isn't happening.
    To try to accomplish this I am using an On-Error trigger to capture the FRM-40501 error message and instead display my own custom message followed by "Raise Form_Trigger_Failure".
    Despite the On-Error trigger displaying my custom message successfully, the "Raise Form_Trigger_Failure" doesn't seem to stop the form from processing the remaining code in the when-button-pressed trigger. These messages still appear multiple times in a row and the remainder of the when-button-pressed trigger code continues to run.
    So my question is why isn't my "Raise Form_Trigger_Failure" working to suppress subsequent messages? Is there a way I can address this?
    Any help would be greatly appreciated. Thanks.
    Edited by: sharpe on Jul 13, 2012 9:39 AM

    The FORM_TRIGGER_FAILURE in the ON-ERROR-trigger will not stop the code in your WHEN-BUTTON-PRESSED-trigger. Could you post the code from your trigger?

  • Stastical Condition Type is not working in Purchase Order

    Hi All,
    I created a pricing procedure and Bank charges are created as a condition type which is stastical. I assigned a account Key and Accural key for the same condition type. We activated Purchase Account Management
    Purchase order is raised with USD 100, ank charges(%) which will be calculated on Base price, for example Bank charges is 1% then bank charges will be USD1.
    I want these bank charges should not be added to the material cost. But when we are doing GR accounting entries as below.
    Stock account 101     +       
    GR/IR     100     -       
    Pur acc     100     +       
    Pur Offset     101     -       
    Bank chargesAccount key     10 +       
    Accural     10     -     
    In the above Bank Charges are added to Stock account which is not required.
    Even though I created the Bank charges Condition type as Statical still the value is adding to  the stock account.
    Thanks and Regards
    durga

    Hi Durga,
    Most importantly whenever we create a condition type with statistical check box it means that value will not be included in Net price calculation this is the only purpose of statistical check box.(Like any freight charges it will go to your stock a/c even though statistical check box is there in your Pricing procedure)
    When you create condition type for any charges with Cond.category B Delivery costs and Accrual check box in M/06 by default it will go to stock account, but you can restrict that by using a functionality
    Check this link for complete process
    http://wiki.sdn.sap.com/wiki/display/ERPLO/PostingplanneddeliverycosttoNon-inventoryaccount

  • When new record instance not firing on Purchase Order form

    I query a purchase order and click on the shipment lines button. There are 2 shipment lines in this example. I am using CUSTOM.pll to inject some specific code to restrict the cancel functionality. One line I want to restrict the cancel functionality and the other line I don't want to restrict. The problem arises when I click between the two rows on the Org or Ship to fields. No event or trigger gets fired that I can see; hence, the CUSTOM.pll code does not get injected and the user will be able to cancel both lines. Any ideas? Thank you for your time,
    -Kevin

    What does that mean? In the middle of creating a record?
    But how come system allows me to go to the 2nd tab when it goes to the last record and doesnt allow me to go the 2nd tab when i create in middle of the record
    Seems that there is some difference in the data of the two records, maybe one record passing validation and the other one not.Validations are same, both the scenario it just creates a new record.

  • Search functionality not working in Purchase order

    Hi all,
    We are using extended classic scenerio's .But we are unable to search the Purchase orders against status "order ,awaiting approval etc"
    However, we are able to search only "Status Held" PO's
    Could you please tell me the soultion for this. Seems to be search functionality not properly activated.
    Thanks and regards
    Harish shetty

    Hi Harish,
    See if the following OSS notes are helpful:
    Note 1138911 - BBP_POC - Search issue in purchase order
    Note 1128758 - BBP_POC: Search Issue in Purchase Order
    Thanks,
    Pradeep

  • Purchase Order form printing error.

    Hi all experts,
    I am not sure which category I should put this question to. Please guide me if I have raised the question in the wrong category, so that I can raise it at the right category. Sorry!
    I am having some problems in printing Purchase Order form using Simple Mail, let's say I am using output type MAHN. Whenever the PO is generated in Simple Mail, a print preview screen with Output Device is pop up, and require me to key in the details like printer name in order to proceed to next step (which is not necessary for my case).
    Whereas, in normal print preview, there is no such pop up display.
    I am suspecting of it is caused of the setting. But I do not know how to solve it.
    Anyone experienced this before? Please help.
    Thanks in advance.

    Hi Sachin D C,
    I am sorry for the confusing query. Actually what I wanted to say is: -
    1) printing the PO - maintain condition records for output type NEU (working fine)
    2) printing Dunning Deliv Remind - output type MAHN (working fine in manual print out)
    3) printing Dunning Deliv Remind - output type MAHN (not working in simple mail)
    Whenever the Dunning Deliv Remind is generated in Simple Mail, a print preview screen with Output Device is pop up and following by another pop up screen Output Processing analysis.
    Do you have better understanding now?
    Please help.

  • Purchase Order form printout error.

    Hi all experts,
    I am not sure which category I should put this question to. Please guide me if I have raised the question in the wrong category, so that I can raise it at the right category. Sorry!
    I am having some problems in printing Purchase Order form using Simple Mail, let's say I am using output type MAHN. Whenever the PO is generated in Simple Mail, a print preview screen with Output Device is pop up, and require me to key in the details like printer name in order to proceed to next step (which is not necessary for my case).
    Whereas, in normal print preview, there is no such pop up display.
    I am suspecting of it is caused of the setting. But I do not know how to solve it.
    Anyone experienced this before? Please help.
    Thanks in advance.

    Hi Sachin D C,
    I am sorry for the confusing query. Actually what I wanted to say is: -
    1) printing the PO - maintain condition records for output type NEU (working fine)
    2) printing Dunning Deliv Remind - output type MAHN (working fine in manual print out)
    3) printing Dunning Deliv Remind - output type MAHN (not working in simple mail)
    Whenever the Dunning Deliv Remind is generated in Simple Mail, a print preview screen with Output Device is pop up and following by another pop up screen Output Processing analysis.
    Do you have better understanding now?
    Please help.

  • Open Purchase Order Form in Find Mode

    Hi,
    I have to open the Purchase Order Form in Find Mode.How to open in Find mode?.
    I Used the Following Code in Form_Load  && Action_Success=true
    if(oForm.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE)
            oForm.Mode = SAPbouiCOM.BoFormMode.fm_FIND_MODE
    But it is not working.Please help me to solve this.
    Regards,
    M.Dhivya

    call
    ActivateMenuItem( "1281")
    in application object.

  • MM - Purchase Order Form Setup

    Hi Experts,
    I am from FICO area but unfortunately my client wants me to support on MM module (only in small areas) and I need support on below:
    Currently we are printing Purchase Order form for vendors but now there was change in purchase order form so I copied old form and created new form (used SE71 for form development).
    My current issue is I do not know where to setup to form in MM so that printing is done with new form.
    Looking for your assistance
    thanks & regards,
    prashant rane

    hi..
    Go to
    SPRO- > MM -> Puchasing- > Purchase Order ->Forms for Messages ->Assign Form and Output Program for Purchase Order
    open this and assign the programs name and form name for any particular output type which you want to use for your PO output.
    After that go to me21n. then Goto menu and messages..
    here in the output column assing your output type and ente the communication method button...assign output device there..
    It will work..
    And if you using ouw defind output type then you have to do lot of congig like defien message type and message determination schema....
    Thanks..

  • How to show default supplier in purchase order form

    hi folks,
    the requirement is purchase order form should show me a default supplier/default supplier for an item and with other suppliers from list of values.
    thanks,
    sri

    Hi Sri,
    There is no such requirement in PO window unless you do some form personalisations.
    But even if you go for a form personalisation it should pick for the combination of item and supplier...not sure how this works :-(
    Other than that I can think of an option of Copying the existing PO to a new PO.
    Thanks
    -Arif.

  • Alignment Changing in the Purchase Order Form

    Hi,
    We are using 11i( 11.5.10.2) with oracle 9i database. I am adding one text item in the Standard Purchase Order form.next to the Unit price text item. when i change the canvas.total alignment is changing and also coming blank space in the form when i open in the application.
    Can anybody suggest on that issue.
    Thanks.

    Hi,
    I am adding one text item in the Standard Purchase Order formI believe this is not supported -- See (Note: 105127.1 - FAQ (Customization)) for details.
    However, if you still want to have this working please verify that you have compile the form successfully after doing the necessary changes.
    Thanks,
    Hussein

  • Need help on purchase order form

    Hi friends,
    Is it possible to put one folder ( tab) in purchase order form. I am trying to put folder in po screen. if i put any button object in po form it works. but when i put folder it is not showing folder and no errors.
    can anybody help me.....

    Hi Manish,
    it is possible to add the folder to purchase order form.
    you get the reference to Tax Folder of Purchase Order as Item.
    oItem=poForm.Items,Item("2013")
    then set the properties for your folder
    oFolderItem.visible=true
    oFolderItem.left=oItem.Right
    oFolderItem.top=oItem.Top
    oFolderItem.height=oItem.height
    oFolderItem.Width=oItem.width
    oFolderItem.frompane=0
    oFolderItem.topane=0
    oFolderItem.Specific.caption="asdf"
    oFolderItem.Specific.GroupWith("2013")
    Hope it helps you
    Regards
    Vishnu

  • Problem in matrix on purchase order form

    Hi ,
    After filling the records ,I am trying to make the whole matrix non-editable on purchase order form .It works perfectly.when I again about to fill the matrix , It does not let me make the columns editable through code.
    I don't want to use the Form settings.. from the menu,where i can make the columns active.
    please tell me , how can i make the matrix editable after making it non editable.
    please help..
    thanx

    Barend,
    when I make it editable = true the it gives me an eror
    that "item is not a user defined item"
    I am using the following code..
    oMatrix.Columns.Item(i).Editable  =true;

  • Raise form_trigger_failure not wokring on validate records

    hi,
    I wrotea block level trigger WHEN-VALIDATE-RECORD, which do some screen level validation and
    in case of failure i use RAISE FORM_TRIGGER_FAILURE. working fine if i move records
    another trigger is KEY-COMMIT on form level.
    which calling a program unit where a command is FIRST_RECORD
    now when i save the records using the save button
    its call FIRST_RECORD, because of this command its executing WHEN-VALIDATE-ITEM
    and execute RAISE FORM-TRIGGER-FAILURE
    but system continue the executaion and jump back to key-commit triiger
    why WHEN-VALIDATE-RECORDS 's raise is not working...
    thanks

    hi
    its call FIRST_RECORD, because of this command its executing WHEN-VALIDATE-ITEM
    another trigger is KEY-COMMIT on form level.
    and execute RAISE FORM-TRIGGER-FAILURE
    If when-validate-item trigger is not set at item-level plz set it at item-level and check.
    set key-commit-trigger at block level.
    may it helps u.
    sarah

Maybe you are looking for

  • Clients not able to connect to MS exchange server over a cisco switch

    Hello, I have a Cisco L3 switch. I have a Exchange server and until i split the network into every thing was working ok, meaning the clients can connect to the Exchange without issues. But after i split the network into 2 vlans, moving the exchange i

  • How to add my 1 year premium code

    Hello , i recently received a code for  a 12 months subscription for premium on skype. When i add the code i get this message : Sorry, you have reached your monthly voucher redemption limit. Please try again later. I never added any code or anything

  • A new mac without snow leopard

    my parents just got a new macbook 15 inch from best buy.... it doesnt come with snow leopard!!! i have snow leopard but i bought it for one mac... will it install on their mac? Anyway shouldnt they get it free they just got a new mac???

  • Satellite Pro S300 EZ1514 - Cannot initialize Solid State Drive (SSD)

    I have a Satellite Pro S300 EZ1514. Recently I purchased a SATA II Cavalry 64GB SSD to replace the current hard drive. First I tried to install XP with SATA drivers streamlined in. The install process recognized the SSD and did the initial file copy

  • For developers in South America

    There is a new web site for developers using JDeveloper in Latin America - http://www.jdeveloperla.com/ Just thought it is worth a mention here.