1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Form personalization to make a field mandatory

Discussion in 'Oracle Apps Technical' started by jagadekara, Mar 3, 2015.

  1. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Dear All,

    Through Form personalization I made a field mandatory at PO Distribution form.

    First I enter the PO header details and then enter the line details and save the record. It is saved. But It shouldn't save because at distribution level our mandatory field is null. So How can I restrict that?

    Any Ideas?
     
  2. RG Hegde

    RG Hegde Forum Advisor

    Messages:
    185
    Likes Received:
    35
    Trophy Points:
    310
    Location:
    Pune
    Hello Jagadekara,

    While entering the data once just open that po distribution form and do not enter anything on the field . then try to save that and confirm will it through the error .
     
  3. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    No,

    It's not giving any error. It shows no changes to save at bottom as a hint.
     
  4. RG Hegde

    RG Hegde Forum Advisor

    Messages:
    185
    Likes Received:
    35
    Trophy Points:
    310
    Location:
    Pune
    ok . May I know the apps release . and could you please let me know on which field you try to make as mandatory. Is that relating to accounts field?

    Is that oracle forms/OAF pages ?
     
  5. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Hi,

    I am using Oracle Apps R12.
    Deliver To Location field in PO Distributions Form.
    Yes it's Oracle Form, Not OAF Page.
     
  6. RG Hegde

    RG Hegde Forum Advisor

    Messages:
    185
    Likes Received:
    35
    Trophy Points:
    310
    Location:
    Pune
    Hello Jagadekara,
    You can try below logic to meet your requirement.

    Declare a global variable and initialize a value to that i.e 'N'

    In PO Line for each and every record check the global variable if it is not 'Y' then pop up a message to enter Deliver to location.

    Once that is entered then change the global variable to 'Y' . Now it will allow user to click on Approval button.

    For the next record again the global variable will be initialized to 'N' so for each and very record user should enter Deliver to in PO distribution.

    Hope this logic will help you
     
    jagadekara likes this.
  7. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Thanks.

    But I done it like below.

    My main aim is, Before approving the PO user should enter Deliver to location at distribution for all lines. So I done form personalization based on Approve button.

    I took when new item instance trigger and trigger object is PO_APPROVE.APPROVE.
    Then in condition used this...

    ( SELECT COUNT(*) FROM PO_DISTRIBUTIONS_ALL
    WHERE PO_HEADER_ID = :pO_HEADERS.PO_HEADER_ID AND
    DELIVER_TO_LOCATION_ID IS NULL ) > 0

    Then go to actions.

    seq: 10
    type: message
    message type: show
    message text: ='Deliver To Location is Mandatory for line number : '||(select rtrim (xmlagg (xmlelement (e, line_num || ',')).extract ('//text()'), ',') line_num
    from
    (SELECT pod.po_header_id,POL.LINE_NUM
    FROM PO_DISTRIBUTIONS_ALL POD,
    PO_LINES_ALL POL
    WHERE POD.PO_HEADER_ID = :pO_HEADERS.PO_HEADER_ID
    AND DELIVER_TO_LOCATION_ID IS NULL
    AND POL.PO_LINE_ID = POD.PO_LINE_ID
    )
    group by
    po_header_id
    )

    then one more action

    seq: 20
    type: Builtin
    Builtin Type: GO_ITEM
    Argument: PO_LINES.ITEM_NUMBER

    So now user enter 6 lines and enter deliver to location for only for line num 2 and 4 then he click on approve. Then it shows popup as

    Deliver To Location is Mandatory for line number:1,3,5,6