Make attachment mandatory

i am trying to make attachment mandatory in iSupplier (in a flow train page) ( /oracle/apps/ap/invoice/request/webui/MatchedInvoicePG )
following other threads, i tried below in process Form request but always get null object for line1 and line2 will result in exception. I tried with name "Attachmen" "Attachments" and "AttachmentLink" nothing is working. i need to make attachments manadatory in order to proceed to next page
line 1 OAMessageAttachmentLinkBean attbean= (OAMessageAttachmentLinkBean)webBean.findChildRecursive("AttachmentLink");
line2 String ssdn = (String)attbean.getAttributeValue(pageContext.getRenderingContext(), TEXT_ATTR);
i cannot figure out how to get around this. please help.

Understand below code, may help. make neccessary changes as required. Below code allows maximum (4) number of attachments.
--Check attachments
public void checkAttachment(com.sun.java.util.collections.HashMap hsMap)
OAPageContext oapagecontext = (OAPageContext)hsMap.get("PageContextObject");
OAWebBean oawebbean = (OAWebBean)hsMap.get("WebBeanObject");
OAApplicationModule am = oapagecontext.getApplicationModule(oawebbean);
String amName = "";
String objectivesAMName = "OAAttachmentsAM"; //-- Standard attachment AM
String objectiveVOName = "FndAttachedDocumentsDomExtensionVO"; //-- Attachment VO
String nestedAMArray[] = am.getApplicationModuleNames();
OAApplicationModule currentAM = null;
OAViewObject vo = null;
currentAM = am;
for(int i = 0; i < nestedAMArray.length; i++)
amName = nestedAMArray.toString();
oapagecontext.writeDiagnostics(this,"Nested AM Name=>"+amName + "and amName.indexOf(objectivesAMName) "+amName.indexOf(objectivesAMName),1);
currentAM = (OAApplicationModule)am.findApplicationModule(amName);
if(!(amName.indexOf(objectivesAMName)==-1))
String[] viewNames = currentAM.getViewObjectNames();
for (int j =0 ;j<viewNames.length ;j++ )
if(viewNames[j].indexOf(objectiveVOName) > 0)
vo = (OAViewObject)currentAM.findViewObject(viewNames[j]);
int attchcount = vo.getFetchedRowCount();
if(attchcount>4)
throw new OAException("XXC","XXC_MAX_ATTACHMENTS");
//return isAttachmentFound;

Similar Messages

  • How to make attachment mandatory in E-Separation ?

    How to make attachment mandatory in E-Separation in ESS screen while submitting the resignation?

    Hello,
    Apologies for delayed response. Please find the below steps :
    1) Extend ReviewCO (pkg - oracle.apps.per.selfservice.review.webui.ReviewCO)
    2) In PFR – check button event is Submit then call function ( that check whether doc is attached or not )
    3) Funtion returns True and False. If false display message.
    Pls. let me know if you need any more information.
    Thanks,
    Sudhakar

  • Make attachment mandatory in IExpense page by using workflow

    Hi All,
    I have one requirement in which need to make attachment mandatory in IExpense page.
    how do I achieve that. Which process or function,packge do I need to modify to complete the requirement.
    Please Guide.
    Thanks,
    Priyanka

    Hi,
    Take the help of ABPer to get solution for your requirement.  before posting PR try to check document is attached or not with BADI "ME_REQ_POSTED".
    May be this will help you...
    Thanks...

  • Make Attachment Mandatory in ME51N

    Hello,
    We have requirement for certain type of purchase requisition should have to have attachment.
    Is there any way to ensure that the user has attached atleast one document at the time of saving it?
    Regards,
    Khan
    Edited by: Owais on Oct 22, 2010 7:22 PM

    Hi,
    Take the help of ABPer to get solution for your requirement.  before posting PR try to check document is attached or not with BADI "ME_REQ_POSTED".
    May be this will help you...
    Thanks...

  • How To make attachment as mandatory

    HI,
    I have One requirement to make attachment link as mandatory. I used below code and it is not at all effecting. Pls check below code and suggest.
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    OAApplicationModule oam = pageContext.getApplicationModule(webBean);
    if (pageContext.getParameter("HrSubmit")!= null)
    OAMessageAttachmentLinkBean uploadBean = (OAMessageAttachmentLinkBean)webBean.findChildRecursive("AttachmentLink");
    String ssdn = (String)uploadBean.getAttributeValue(pageContext.getRenderingContext(), TEXT_ATTR);
    if ("None".equals(ssdn.trim()))
    throw new OAException("There is no attachment kindly click on add button and browse your attachment",OAException.ERROR);
    else
    //throw new OAException("link val = " + ssdn);
    super.processFormRequest(pageContext, webBean);
    else
    //System.out.println("There exists an attachment to the expense claim. The process will now continue");
    super.processFormRequest(pageContext, webBean);
    }

    Hi Roopesh,
    Thanks for your quick reply..
    I extended Review Co only, but after clicking submit it is not showing
    any message, it is going to next page.
    Pls find below code....
    package xxoa.oracle.apps.per.selfservice.review.webui;
    import oracle.apps.per.dor.common.DocsOfRecordUtilities;
    import oracle.apps.fnd.framework.OAViewObject;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import com.sun.java.util.collections.HashMap;
    import java.io.Serializable;
    import java.math.BigDecimal;
    import java.util.Hashtable;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageChoiceBean;
    import oracle.apps.per.selfservice.review.webui.ReviewCO;
    import java.util.StringTokenizer;
    import oracle.apps.fnd.framework.webui.OANavigation;
    import oracle.apps.per.common.CommonUtils;
    import oracle.apps.per.selfservice.review.common.ReviewParams;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.OARow;
    import oracle.apps.fnd.framework.server.OADBTransaction;
    import oracle.apps.fnd.framework.webui.OADialogPage;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.TransactionUnitHelper;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.webui.beans.form.OAFormValueBean;
    import oracle.apps.fnd.framework.webui.beans.form.OASubmitButtonBean;
    import oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageLovInputBean;
    import oracle.apps.fnd.framework.webui.beans.nav.OAPageButtonBarBean;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
    import oracle.apps.fnd.framework.webui.beans.OAImageBean ;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageFileUploadBean;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageAttachmentLinkBean;
    import oracle.apps.fnd.framework.webui.OAInnerDataObjectEnumerator;
    import oracle.apps.fnd.framework.webui.beans.table.OAAdvancedTableBean;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageStyledTextBean;
    import oracle.apps.per.selfservice.workflowservice.server.WFUtility;
    import oracle.cabo.ui.data.DataObject;
    import oracle.jbo.ViewObject;
    import oracle.apps.per.selfservice.common.SSHRParams;
    import oracle.apps.per.selfservice.workflowservice.server.WFUtility;
    import oracle.jbo.domain.Date;
    public class xxReviewCO extends ReviewCO
    public static final String RCS_ID = "$Header: ZensarReviewCO.java 120.8.12010000.11 2010/05/28 10:36:58 tkghosh ship $";
    public static final boolean RCS_ID_RECORDED = VersionInfo.recordClassVersion("$Header: ZensarReviewCO.java 120.8.12010000.11 2010/05/28 10:36:58 tkghosh ship
    $", "%packagename%");
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    OAApplicationModule oam = pageContext.getApplicationModule(webBean);
    if (pageContext.getParameter("HrSubmit")!= null)
    OAMessageAttachmentLinkBean uploadBean = (OAMessageAttachmentLinkBean)webBean.findChildRecursive("AttachmentLink");
    String ssdn = (String)uploadBean.getAttributeValue(pageContext.getRenderingContext(), TEXT_ATTR);
    //TEXT_ATTR
    // String s1 = new String("None");
    // string s2 = new String(""View);
    if ("None".equals(ssdn.trim()))
    throw new OAException("There is no attachment kindly click on add button and browse your attachment",OAException.ERROR);
    else
    //throw new OAException("link val = " + ssdn);
    super.processFormRequest(pageContext, webBean);
    else
    //System.out.println("There exists an attachment to the expense claim. The process will now continue");
    super.processFormRequest(pageContext, webBean);
    }

  • Make Create attach mandatory

    Hi all,
    I need to make the "Create attach" mandatory for TCode ME51N / ME52N.
    Please provide me help.
    Regards,
    Moshior Sohel

    Hi Aamir,
    Thanks for your help.
    ME_REQ_POSTED is the actual BADi which u told.
    Can you please help me with sample code for that badi which will make the attachment mandatory.
    Thanks
    Moshior

  • How can i create a SP transaction to make Dimension1 Mandatory

    Hi All
    How can i create a SP transaction to make Dimension1 Mandatory
    Best regards
    Rashid

    Dear Rashid,
    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    go
    ALTER proc [dbo].[SBO_SP_TransactionNotification]
    @object_type nvarchar(25),                     -- SBO Object Type
    @transaction_type nchar(1),     -- [A]dd, <u>pdate, [D]elete, [C]ancel, C[L]ose
    @num_of_cols_in_key int,
    @list_of_key_cols_tab_del nvarchar(255),
    @list_of_cols_val_tab_del nvarchar(255)
    AS
    begin
    -- Return values
    declare @error  int                    -- Result (0 for no error)
    declare @error_message nvarchar (200) -- Error string to be displayed
    select @error = 0
    select @error_message = N'Ok'
    IF (@object_type = '30' AND @transaction_type= 'A')
    BEGIN
    IF EXISTS (SELECT DocEntry FROM [dbo].[JDT1] WHERE (ProfitCode IS NULL OR ProfitCode = '') AND DocEntry = @list_of_cols_val_tab_del)
    BEGIN
    SELECT @error =1, @error_message = 'Profit Center cannot be blank -Enter Plant Code'
    END
    END
    select @error, @error_message
    END
    Jeyakanthan

  • Make VPRS Mandatory at billing, not at Sale Order

    Hi
    I want to make VPRS mandatory at Billling (VF01)....
    I know that as a std setting. it can be made mandatory from Pricing Procedure in SD.. But that will prevent creation of Sale Order
    What the user wants it it shud allow creation of sale order, but at VF01, it shud hard stop.... So that the user goes and updates the VPRS price in Sale Order by means of "Update/Re-determine Price" Feature in Sale order
    Any ideas?
    Regards
    Ajay

    Hi
    Unfortunately, some postings have happened in Prod client where VPRS posted was zero
    Even, i was of the opinion that if the std cost is Zero @ the time when SO is created, but was released later on and PGI happened based on the released cost, then VPRS shud have been populated in COPA
    Am i missing some thing??
    Regards,
    Ajay

  • How to make it mandatory to enter a value in a collection?

    Is it possible in Wave 7 CLM - Contract Management to make it mandatory for a collection to have at least one record?
    We have created a custom collection and placed it on the Supplier tab of agreements and we would now like to make it mandatory for at least one record to be entered into this collection.
    So far, I have tried setting the UI_override on the field name of one of the fields in the collection to mandatory but that did not work.
    In WYSIWYG for Master Agreements, collections are uneditable.
    I have thought of creating an additional simple hidden field, making that mandatory and then developing a script to copy that field into the first field of the collection, but that seems to be an unnecessarily complex solution.

    Hello Chris,
    I think this can be acheived by writing a script that checks the size of the collection. If the size = 0, then raise an exception. This script can be made to execute On Validate target.
    Hope this helps.
    Thanks
    Devesh

  • Make "division" mandatory in material master !!

    Hi
    I want to make division mandatory while creating material .i.e. in MM01 and MM02 for all material types.
    I go to OMSR and find tht field selection group is 90
    Now I go to OMS9 and make division mandatory.
    But the problem is that it makes all fields mandatory which are in field selection group 90
    How to overcome this issue??
    Any help friends??
    Thank You

    Dear Aditi,
    please follow below steps :
    1) OMSR
    2) select 90 field group
    3) click on green arrow
    4) You will find field selection group of 90. i.e. field ref , hide,display,reqd entry,opt entry.
    5) select mm01 line and mm02 line
    6) select radio button on reqd entry.
    7) save.
    Vijay.
    Maharashtra.

  • Help Desk - make fields mandatory and sub catagories

    Is there a way to make fields mandatory (not in the portal) but on the ticket?
    Also, when creating custom attributes, is there a way to make a 'sub attribute' show up based on another attribute?
    thanks!
    This topic first appeared in the Spiceworks Community

    Hello Alex,
    To add a message, you can modify the EH_ONSAVE method of the controller class.
    For a sample code, please see below.
    I hope this helps.
    Kind regards,
    Kristoff.
    data: lv_entity         TYPE REF TO cl_crm_bol_entity,
            lv_coll             TYPE REF TO if_bol_entity_col,
            lv_current        TYPE REF TO if_bol_bo_property_access,
            lv_country          TYPE string,
    Address Data
    *navigate down to Address
        try.
          lv_coll = lv_entity->get_related_entities(
                   iv_relation_name = 'BuilStandardAddressRel' ).
          lv_current = lv_coll->get_current( ).
          catch CX_CRM_GENIL_MODEL_ERROR.
        endtry.
        if lv_current is not bound.
          return.
        endif.
        lv_entity ?= lv_current.
        lv_country = lv_entity->IF_BOL_BO_PROPERTY_ACCESS~GET_PROPERTY_AS_STRING( 'COUNTRY' ).
        IF lv_country IS INITIAL.
              lv_msgsrv->add_message( iv_msg_type = 'E' iv_msg_id = 'Z_CRM_IC' iv_msg_number = '001' ).
              lv_input_nok = 'X'.
        ENDIF.

  • How to make it mandatory for a call off order to reference a contract.

    Hi,
    How do I make it mandatory for my call-off orders to reference contracts?
    Thanks.

    Hi,
    Make the field: "Outline Agreement" in the field selection group assigned to your calloff PO document type.
    Umakanth R

  • How ot make classifications mandatory in service order

    Hi,
    We are using classifications configured through category modeler in interaction center for service orders. How can we make classifications mandatory for the service orders. We are using SAP CRM 7.0.
    Thanks
    Dan

    Hi.
    The fields are on the service order details screen?
    If so, you may set each of the categorization fields as required using the UI configuration tool.
    Regards.

  • How to make fields mandatory in cost center

    Hi Sap Experts,
    How to make fields mandatory in cost center.
    Please give me advise.
    Regards,
    Raj

    If you want to make "Profit Center" field as mandatory, then OBA5 transaction code
    Application Area - KS
    Number 096
    make this as error for online and batch input. Then profit center will become mandatory.

  • How to make Fields mandatory in service entry sheet

    Dear Experts,
    I need to make  "Quality of Service" and "Service Timeliness" fields mandatory for user entry  in VENDOR EVALN tab during Service Entry Sheet.
    Kindly help..

    Check the note attached to the configuration node.
    + for required (mandatory) field
    . for optional field
    - for hide
    for display
    Double click on the line showing ...+++...
    It will open up a list of fields grouped logically and you now have a radiobutton style way of changing status.

Maybe you are looking for