Unable to perform search query against custom property

Hi,
I'm trying to perform search against specific property yet I'm getting empty result set.
I have list with some data on it and the field in question has it's value filled. I done full crawl on the site and the crawled property is present under search administration. Property has "Enable full-text search" checked and I'm able to
find these list items when I simply type something like 123 in the search box. Yet I'm unable to perform search against that property using syntax like
DocumentNumber:123.
According to this
http://msdn.microsoft.com/en-us/library/office/ee558911.aspx I need to setup managed properties first so I did. I created required managed property called
DocumentNumber I checked Searchable and Queryable boxes on and mapped it to crawled property. After that I performed full crawl again as it is required (http://technet.microsoft.com/en-us/library/jj219667.aspx)
but still unable to retrieve result when performing search against specific property. I does however return results when I perform search against default columns like
Created or Author.
Some guy had similar issue
http://social.msdn.microsoft.com/Forums/en-US/1f9782ca-5105-4802-b477-ccdee392c6eb/keyword-query-search-on-custom-managed-property yet that solution does not work for me. I tried it with SharePoint 2013 Search Query Tool and it returns nothing.
Queries I performed:
123 - returns required results.
DocumentNumber:123 - no results.
ows_DocumentNumber:123 - no results.
Any ideas what I'm missing?

According to this
http://msdn.microsoft.com/en-us/library/office/ee558911.aspx I need to setup managed properties first so I did. I created required managed property called
DocumentNumber I checked Searchable and Queryable boxes on and mapped it to crawled property. After that
I performed full crawl again as it is required (http://technet.microsoft.com/en-us/library/jj219667.aspx) but still unable to retrieve result when performing search
against specific property.

Similar Messages

  • People Search and a Custom Property

    I am trying to surface a custom property in the people search query results. For example,
    http://<servername:port>/_api/search/query?querytext='*'&sourceid='B09A7990-05EA-4AF9-81EF-EDFAB16C4E31'
    I get XML results but when I look at the properties returned for each of the people result, there are no custom properties from user profile properties. How can I modify the custom properties so that they start showing in the XML results for people search?
    Rank, DocId, AboutMe, AccountName, BaseOfficeLocation, Department etc.
    Please let me know.
    Thanks!
    Update: I am using SearchExecutor class and its ExecuteQuery API.

    Hi,
    Thank you for your sharing! It will be beneficial to others in this forum who meet the same issue in the future.
    Best Regards,
    Wendy
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Can't filter community query by custom property

    I'm trying to search for a community through the objectManager based on a custom property value (part of a LoginPEI that redirects the user on login to a personalized community).  The Query() call is failing with the following exception:
        ParseQueryFilter error on clause #0
        (0x80070057) Invalid property ID specified (0xc8)
    where 0xc8 is the ID of the property I'm filtering by.
    The same code works correctly if I filter by PT_PROPIDS.PT_PROPID_NAME instead, making me think it's something about either that property in particular, or just filtering managed objects by extended props in general.   I've confirmed that the property has been added to the community object through the Global Object Property tool.
    Code shown below (and, yes, I'm aware that the results if there are more than one matching object are undefined).  Any advice appreciated.
    Thanks,
    Pete
        private int lookupObjectBySingleProperty(IPTSession session, int classId, int propertyId, Object value) {
          IPTObjectManager objectManager = session.GetObjectManagers(classId);
          Object[][] filter = {
                                new Object[] { propertyId },
                                new Object[] { PT_FILTEROPS.PT_FILTEROP_EQ },
                                new Object[] { value }
          IPTQueryResult results = objectManager.Query(
            PT_PROPIDS.PT_PROPID_OBJECTID, //Property properties
            -1, // search all folders -- might want to restrict this later
            PT_PROPIDS.PT_PROPID_OBJECTID, //sort
            0, // start at first result
            -1, // return all results
            filter); // filter
          if (results.RowCount() == 0) {
            return -1;
          return results.ItemAsInt(0, PT_PROPIDS PT_PROPID_OBJECTID);

    can you try filter this way:
    var sURI = 'http://<host>:<port>/sap/opu/odata/sap/ZTESTODATA_SRV/';
      oModel = new sap.ui.model.odata.ODataModel(sURI, false),
      sap.ui.getCore().setModel(oModel);
      var sRead = "/pdfset(customer='" + oTF.getValue() + "')"  ;
    oModel.read( sRead, null, null, true, function(oData, oResponse){
      var pdfURL = oData.url;

  • User unable to create 2nd query against new universe

    Hello the Community,
    We have a user who can create a single query from a choice of universes but when they try and add an additional query it doesn't allow them to a different universe - there are none appearing in the list.
    Anybody know where I can fix this ?
    Thanks
    Cedric

    It's a bit strange...
    The user can select more than one universe during the creation of document ( according matrix security ) but cannot select another one universe as the first selected...
    I ( I am Administrator ) grants the right of user on Top Security Level to fix it. View on Demand and View profile were not adequate.
    thanks for your answer
    Cedric

  • Impersonation of FullTextSqlQuery search query

    Hello,
    I am using FullTextSqlQuery class (http://msdn.microsoft.com/en-us/library/microsoft.office.server.search.query.fulltextsqlquery_members.aspx) to perform search for SharePoint 2010 sites.
    I would like to execute search query under some specific user permissions. I suppose I should use FullTextSqlQuery.PersonalizationData to impersonate search query. This property requires User's GUID as parameter. The question is how may I get user Guid for
    some user. SPUser.ID returns integer value. Is there any way to get user guid as System.Guid type? or impersonate search query in some other way. It should work both for windows and claims users so windows impersonation is not acceptable.
    Thanks beforehand,
    -Petro

    public static Int32 ImpersonatedQuery(string userName,string domain,string password)
    WindowsIdentity tempWindowsIdentity;
    IntPtr token = IntPtr.Zero;
    IntPtr tokenDuplicate = IntPtr.Zero;
    WindowsImpersonationContext impersonationContext = null;
    Int32 count = 0;
    DataTable retResults = new DataTable();
    if (RevertToSelf())
    try
    if (LogonUserA(userName, domain, password, LOGON32_LOGON_INTERACTIVE,
    LOGON32_PROVIDER_DEFAULT, ref token) != 0)
    if (DuplicateToken(token, 2, ref tokenDuplicate) != 0)
    tempWindowsIdentity = new WindowsIdentity(tokenDuplicate);
    impersonationContext = tempWindowsIdentity.Impersonate();
    if (impersonationContext != null)
    using(SPSite site = new SPSite("http://basesmcdev2/sites/tester1"))
    FullTextSqlQuery fts = new FullTextSqlQuery(site);
    fts.QueryText = "SELECT Title,FileExtension,ContentType,Path FROM SCOPE() WHERE Title LIKE '%c%mp%r%'";
    fts.ResultTypes = ResultType.RelevantResults;
    fts.RowLimit = 20;
    ResultTableCollection rtc = fts.Execute();
    if (rtc.Count > 0)
    using (ResultTable relevantResults = rtc[ResultType.RelevantResults])
    retResults.Load(relevantResults, LoadOption.OverwriteChanges);
    count = retResults.Rows.Count;
    return count;
    return count;
    finally
    if (impersonationContext != null)
    impersonationContext.Undo();
    if (token != IntPtr.Zero)
    CloseHandle(token);
    if (tokenDuplicate != IntPtr.Zero)
    CloseHandle(tokenDuplicate);
    return count;
    The personalizationdata will not work, nor is it used by the FullTextSQLQuery. It is only used for KeywordQuery class. The only way to impersonate to do a query is to logon as that user and execute the query. The SPSite is not used by the FullTextSQLQuery
    to impersonate. You can try the following code which uses the windows api advapi32.dll to logon and execute the query. Unfortunately you will need to know the users password.
    Blog | SharePoint Field Notes Dev Tool |
    ClassMaster

  • Frm-40505:ORACLE error: unable to perform query in oracle forms 10g

    Hi,
    I get error frm-40505:ORACLE error: unable to perform query on oracle form in 10g environment, but the same form works properly in 6i.
    Please let me know what do i need to do to correct this problem.
    Regards,
    Priya

    Hi everyone,
    I have block created on view V_LE_USID_1L (which gives the error frm-40505) . We don't need any updation on this block, so the property 'updateallowed' is set to 'NO'.
    To fix this error I modified 'Keymode' property, set it to 'updatable' from 'automatic'. This change solved the problem with frm-40505 but it leads one more problem.
    The datablock v_le_usid_1l allows user to enter the text (i.e. updated the field), when the data is saved, no message is shown. When the data is refreshed on the screen, the change done previously on the block will not be seen (this is because the block updateallowed is set to NO), how do we stop the fields of the block being editable?
    We don't want to go ahead with this solution as, we might find several similar screens nad its diff to modify each one of them individually. When they work properly in 6i, what it doesn't in 10g? does it require any registry setting?
    Regards,
    Priya

  • SP2013 Search - Query documents only in a library with a specific property bag value

    Hi,
    I am hoping someone might be able to help me as I am struggling to figure out how to get the following scenario to work using query variables. 
    I have configured a property bag value against document libraries and made it indexable and turned it into a managed property. I have checked to ensure i can search specifically against this managed property and it works correctly and returns document libraries
    which have a  property bag key with a value that I specify in a search query e.g. classification:internal.
    I have also configured a managed property for a piece of metadata i collect against every document e.g. colour. I can successfully search against this manged property and return documents whereby colour is equal to red e.g. colour:red
    What I would like to do is take this one step further and say search across only libraries where the property bag value equals internal and return documents within those libraries which have a metadata value of something e.g. colour = red.
    Does anyone have any suggestions on how i can achieve this.
    Thanks in advance
    Mark

    That or in some way get the container metadata to be present in the item itself as well.
    Thanks,
    Mikael Svenson - Search Enthusiast
    SharePoint MVP/MCPD/P-TSP - If you find an answer useful, please up-vote it.
    http://techmikael.blogspot.com/
    Author of
    SharePoint Search Queries Explained and
    Working with FAST Search Server 2010 for SharePoint

  • FRM-40505  Oracle Error: Unable to perform query(URGENT)

    Hi I developed a form with a control_block and table_block(based on table)
    in same Canvas.
    Based on values on control_block and pressing Find button detail block will be queried.
    Control_block ->
    textitem name "payment_type" char type
    text item name "class_code " char type
    push button "find"
    base table: --> payment_terms(termid,payment_type,class_code,other colums)
    table_block is based on above table
    Now I have written when-button-pressed trigger on find button..
    declare
    l_search varchar2(100);     
    BEGIN
    l_search := 'payment_type='|| :control_block .payment_type||' AND class_code='||:control_block .class_code ;
    SET_BLOCK_PROPERTY('table_block',DEFAULT_WHERE,l_search);
    go_block('table_block');
    EXECUTE_QUERY;
    EXCEPTION
         when others then
         null;
    END;
    I am getting
    FRM-40505 Oracle Error: Unable to perform query
    please help..

    You don't need to build the default_where at run time. Just hard-code the WHERE Clause property as:
        column_x = :PARAMETER.X
    But, if for some compelling reason, you MUST do it at run time this should work:
        Set_block_property('MYBLOCK',Default_where,
            'COLUMN_X=:PARAMETER.X');
    Note that there are NO quotes except for first and last. If you get some sort of error when you query, you should actually see :Parameter.X replaced with :1 when you do Help, Display Error.

  • Add custom property restrictions in advanced search web part

    hi,
     I am having the default advanced search box web part in my ent.search center site collec. but as per my requirement i need to a  few items in the property restrictions dropdown in my advanced search web part.
    is this possible in sp 2013 e.t serach center  site collection?
    any help is  highly appreciated!

    Hi,
    Check this
    http://technet.microsoft.com/en-us/library/ff621097.aspx
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/c25d418d-d4a2-47a3-9abe-c27656764843/how-to-add-custom-property-in-advanced-search-page?forum=sharepointgeneralprevious

  • How do I map custom property from portal api ptsearchresponse?

    I want to map the search results to my datatable.
    I can execute the search fine. But how do I map the property value? My property id is 101.
    In other words which ptSearchResponse method do I use?
                    IPTSession ptSession;
                    IPTSearchRequest ptSearchRequest;
                    IPTSearchResponse ptSearchResponse;
                    IPTSearchQuery ptSearchQuery;
                    string serverConfigDir = ConfigPathResolver.GetOpenConfigPath();
                    IOKContext configContext = OKConfigFactory.createInstance(serverConfigDir, "portal");
                    PortalObjectsFactory.Init(configContext);
                    ptSession = PortalObjectsFactory.CreateSession();
                    ptSession.Connect(1, "", null);
                    // Create a SearchRequest object
                    ptSearchRequest = ptSession.GetSearchRequest();
                    // Set search settings (constraints)
                    // Set maximum results desired (100)
                    ptSearchRequest.SetSettings(
                    PT_SEARCH_SETTING.PT_SEARCHSETTING_MAXRESULTS, 100);
                    // Set the folder in which to search (array to support multiple folders)
                    ptSearchRequest.SetSettings(
                        PT_SEARCH_SETTING.PT_SEARCHSETTING_DDFOLDERS,
                        new int[] { Convert.ToInt32(ConfigurationManager.AppSettings["DocumentFolderId"]) });
                    // Include subfolders of the folder
                    ptSearchRequest.SetSettings(
                        PT_SEARCH_SETTING.PT_SEARCHSETTING_INCLUDE_SUBFOLDERS, true);
                    // Restrict search to just portal documents
                    // (not ALI Collaboration or ALI Publisher)
                    ptSearchRequest.SetSettings(
                        PT_SEARCH_SETTING.PT_SEARCHSETTING_APPS, PT_SEARCH_APPS.PT_SEARCH_APPS_PORTAL);
                    // get documents only
                    ptSearchRequest.SetSettings(
                        PT_SEARCH_SETTING.PT_SEARCHSETTING_OBJTYPES, new int[] { PT_CLASSIDS.PT_CATALOGCARD_ID });
                    // Request the intrinsic PT_PROPERTY_PROVIDERCLSID and custom property 101
                    ptSearchRequest.SetSettings(
                        PT_SEARCH_SETTING.PT_SEARCHSETTING_RET_PROPS,
                        new int[] { PT_INTRINSICS.PT_PROPERTY_PROVIDERCLSID, 101 });
                    //Use IPTFilter to create search filter with clause with two statements
                    IPTFilter ptFilter;
                    IPTPropertyFilterClauses ptFilterClause;
                    IPTPropertyFilterStatement ptFilterStmt1;
                    IPTPropertyFilterStatement ptFilterStmt2;
                    // Create the filter itself
                    ptFilter = PortalObjectsFactory.CreateSearchFilter();
                    // Create the filter clause
                    ptFilterClause = (IPTPropertyFilterClauses)ptFilter.GetNewFilterItem(PT_FILTER_ITEM_TYPES.PT_FILTER_ITEM_CLAUSES);
                    ptFilterClause.SetOperator(PT_BOOLOPS.PT_BOOLOP_OR);
                    // Attach it to the filter itself
                    ptFilter.SetPropertyFilter(ptFilterClause);
                    // Put two statements into the clause
                    ptFilterStmt1 = (IPTPropertyFilterStatement)
                        ptFilter.GetNewFilterItem(PT_FILTER_ITEM_TYPES.PT_FILTER_ITEM_STATEMENT);
                    ptFilterStmt1.SetOperand(101);
                    ptFilterStmt1.SetOperator(PT_FILTEROPS.PT_FILTEROP_CONTAINS);
                    ptFilterStmt1.SetValue(tbSearch.Text.Trim());
                    ptFilterClause.AddItem(ptFilterStmt1, ptFilterClause.GetCount());
                    ptFilterStmt2 = (IPTPropertyFilterStatement)
                        ptFilter.GetNewFilterItem(PT_FILTER_ITEM_TYPES.PT_FILTER_ITEM_STATEMENT);
                    ptFilterStmt2.SetOperand(1);
                    ptFilterStmt2.SetOperator(PT_FILTEROPS.PT_FILTEROP_CONTAINS);
                    ptFilterStmt2.SetValue(tbSearch.Text.Trim());
                    ptFilterClause.AddItem(ptFilterStmt2, ptFilterClause.GetCount());
                    // Make the filter into an actual search query
                    ptSearchQuery = ptSearchRequest.CreateAdvancedQuery(ptFilter);
                    // Run the search and return results
                    ptSearchResponse = ptSearchRequest.Search(ptSearchQuery);               
                    // How many things matched the search?
                    int totalMatches = ptSearchResponse.GetTotalMatches();
                    // How many items were returned? (Not necessarily all)
                    int returnedMatches = ptSearchResponse.GetResultsReturned();
                    // create DataTable and map results to
                    // datatable fields
                    DataTable dtSearchResults = new DataTable("Documents");
                    dtSearchResults.Columns.Add("Name");
                    dtSearchResults.Columns.Add("Excerpt");
                    dtSearchResults.Columns.Add("DocSubject");
                    dtSearchResults.Columns.Add("DocTopic");
                    dtSearchResults.Columns.Add("DocType");
                    dtSearchResults.Columns.Add("DocKeywords");
                    dtSearchResults.Columns.Add("Url");
                    dtSearchResults.Columns.Add("ImageURL");
                    DataRow dr;                                                                                                          
                    // Print the name of each result
                    for (int i = 0; i < returnedMatches; i++)
                        dr = dtSearchResults.NewRow();
                        String strName = ptSearchResponse.GetFieldsAsString(i, PT_INTRINSICS.PT_PROPERTY_OBJECTNAME);                  
                        String strText = ptSearchResponse.GetFieldsAsString(i, PT_INTRINSICS.PT_PROPERTY_OBJECTSUMMARY);
                        String strURL = ptSearchResponse.GetFieldsAsString(i, PT_INTRINSICS.PT_PROPERTY_DOCUMENTURL);
                        String strImageURL = ptSearchResponse.GetFieldsAsString(i, PT_INTRINSICS.PT_PROPERTY_OBJECTIMAGEUUID);
                        dr["Name"] = strName;
                        dr["Excerpt"] = strText;
                        dr["Url"] = strURL;
                        dr["ImageURL"] = "pt://images/plumtree/portal/public/img/sml" + strImageURL + ".gif";
                        dtSearchResults.Rows.Add(dr);
    Edited by [email protected] at 04/11/2008 7:26 PM
    Edited by [email protected] at 04/11/2008 7:27 PM

    Problem solved. I should use JsonObject instead of JSONObject :D 

  • Getting error Unable to perform transaction on the record.

    Hi,
    My requirement is to implement the custom attachment, and to store the data into custom lob table.
    my custom table structure is similer to that of standard fnd_lobs table and have inserted the data through EO based VO.
    Structure of custom table
    CREATE TABLE XXAPL.XXAPL_LOBS
    ATTACHMENT_ID NUMBER NOT NULL,
    FILE_NAME VARCHAR2(256 BYTE),
    FILE_CONTENT_TYPE VARCHAR2(256 BYTE) NOT NULL,
    FILE_DATA BLOB,
    UPLOAD_DATE DATE,
    EXPIRATION_DATE DATE,
    PROGRAM_NAME VARCHAR2(32 BYTE),
    PROGRAM_TAG VARCHAR2(32 BYTE),
    LANGUAGE VARCHAR2(4 BYTE) DEFAULT ( userenv ( 'LANG') ),
    ORACLE_CHARSET VARCHAR2(30 BYTE) DEFAULT ( substr ( userenv ( 'LANGUAGE') , instr ( userenv ( 'LANGUAGE') , '.') +1 ) ),
    FILE_FORMAT VARCHAR2(10 BYTE) NOT NULL
    i have created a simple messegefileupload and submit button on my custom page and written below code on CO:
    Process Request Code:
    if(!pageContext.isBackNavigationFired(false))
    TransactionUnitHelper.startTransactionUnit(pageContext, "AttachmentCreateTxn");
    if(!pageContext.isFormSubmission()){
    System.out.println("In ProcessRequest of AplAttachmentCO");
    am.invokeMethod("initAplAttachment");
    else
    if(!TransactionUnitHelper.isTransactionUnitInProgress(pageContext, "AttachmentCreateTxn", true))
    OADialogPage dialogPage = new OADialogPage(NAVIGATION_ERROR);
    pageContext.redirectToDialogPage(dialogPage);
    ProcessFormRequest Code:
    if (pageContext.getParameter("Upload") != null)
    DataObject fileUploadData = (DataObject)pageContext.getNamedDataObject("FileItem");
    String strFileName = null;
    strFileName = pageContext.getParameter("FileItem");
    if(strFileName == null || "".equals(strFileName))
    throw new OAException("Please select a File for upload");
    fileName = strFileName;
    contentType = (String)fileUploadData.selectValue(null, "UPLOAD_FILE_MIME_TYPE");
    BlobDomain uploadedByteStream = (BlobDomain)fileUploadData.selectValue(null, fileName);
    String strItemDescr = pageContext.getParameter("ItemDesc");
    OAFormValueBean bean = (OAFormValueBean)webBean.findIndexedChildRecursive("AttachmentId");
    String strAttachId = (String)bean.getValue(pageContext);
    System.out.println("Attachment Id:" +strAttachId);
    int aInt = Integer.parseInt(strAttachId);
    Number numAttachId = new Number(aInt);
    Serializable[] methodParams = {fileName, contentType , uploadedByteStream , strItemDescr , numAttachId};
    Class[] methodParamTypes = {fileName.getClass(), contentType.getClass() , uploadedByteStream.getClass() , strItemDescr.getClass() , numAttachId.getClass()};
    am.invokeMethod("setUploadFileRowData", methodParams, methodParamTypes);
    am.invokeMethod("apply");
    System.out.println("Records committed in lobs table");
    if (pageContext.getParameter("AddAnother") != null)
    pageContext.forwardImmediatelyToCurrentPage(null,
    true, // retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES);
    if (pageContext.getParameter("cancel") != null)
    am.invokeMethod("rollbackShipment");
    TransactionUnitHelper.endTransactionUnit(pageContext, "AttachmentCreateTxn");
    Code in AM:
    public void apply(){
    getTransaction().commit();
    public void initAplAttachment() {
    OAViewObject lobsvo = (OAViewObject)getAplLobsAttachVO1();
    if (!lobsvo.isPreparedForExecution())
    lobsvo.executeQuery();
    Row row = lobsvo.createRow();
    lobsvo.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    public void setUploadFileRowData(String fName, String fContentType, BlobDomain fileData , String fItemDescr , Number fAttachId)
    AplLobsAttachVOImpl VOImpl = (AplLobsAttachVOImpl)getAplLobsAttachVO1();
    System.out.println("In setUploadFileRowData method");
    System.out.println("In setUploadFileRowData method fAttachId: "+fAttachId);
    System.out.println("In setUploadFileRowData method fName: "+fName);
    System.out.println("In setUploadFileRowData method fContentType: "+fContentType);
    RowSetIterator rowIter = VOImpl.createRowSetIterator("rowIter");
    while (rowIter.hasNext())
    AplLobsAttachVORowImpl viewRow = (AplLobsAttachVORowImpl)rowIter.next();
    viewRow.setFileContentType(fContentType);
    viewRow.setFileData(fileData);
    viewRow.setFileFormat("IGNORE");
    viewRow.setFileName(fName);
    rowIter.closeRowSetIterator();
    System.out.println("setting on fndlobs done");
    The attchemnt id is the sequence generated number, and its defaulting logic is written in EO
    public void create(AttributeList attributeList) {
    super.create(attributeList);
    OADBTransaction transaction = getOADBTransaction();
    Number attachmentId = transaction.getSequenceValue("xxapl_po_ship_attch_s");
    setAttachmentId(attachmentId);
    public void setAttachmentId(Number value) {
    System.out.println("In ShipmentsEOImpl value::"+value);
    if (getAttachmentId() != null)
    System.out.println("In AplLobsAttachEOImpl AttachmentId::"+(Number)getAttachmentId());
    throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT,
    getEntityDef().getFullName(), // EO name
    getPrimaryKey(), // EO PK
    "AttachmentId", // Attribute Name
    value, // Attribute value
    "AK", // Message product short name
    "FWK_TBX_T_EMP_ID_NO_UPDATE"); // Message name
    if (value != null)
    // Attachment ID must be unique. To verify this, you must check both the
    // entity cache and the database. In this case, it's appropriate
    // to use findByPrimaryKey() because you're unlikely to get a match, and
    // and are therefore unlikely to pull a bunch of large objects into memory.
    // Note that findByPrimaryKey() is guaranteed to check all AplLobsAttachment.
    // First it checks the entity cache, then it checks the database.
    OADBTransaction transaction = getOADBTransaction();
    Object[] attachmentKey = {value};
    EntityDefImpl attachDefinition = AplLobsAttachEOImpl.getDefinitionObject();
    AplLobsAttachEOImpl attachment =
    (AplLobsAttachEOImpl)attachDefinition.findByPrimaryKey(transaction, new Key(attachmentKey));
    if (attachment != null)
    throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT,
    getEntityDef().getFullName(), // EO name
    getPrimaryKey(), // EO PK
    "AttachmentId", // Attribute Name
    value, // Attribute value
    "AK", // Message product short name
    "FWK_TBX_T_EMP_ID_UNIQUE"); // Message name
    setAttributeInternal(ATTACHMENTID, value);
    Issue faced:
    When i run the page for the first time data gets inserted into custom table perfectly on clicking upload button,
    but when clicked on add another button on the same page (which basically redirects to the same upload page and increments the attachment id by 1)
    i am getting the below error:
    Error
    Unable to perform transaction on the record.
    Cause: The record contains stale data. The record has been modified by another user.
    Action: Cancel the transaction and re-query the record to get the new data.
    Have spent entire day to resolve this issue but no luck.
    Any help on this will be appreciated, let me know if i am going wrong anywhere.
    Thanks nd Regards
    Avinash

    Hi,
    After, inserting the values please re-execute the VO query.
    Also, try to redirect the page with no AM retension
    Thanks,
    Gaurav

  • Help needed: Search function for custom Repository Manager

    Hi there,
    i'm writing my own Repository Manager for EP 6.0 SP2 PL4.
    I've serious problems getting the search function running. I'm using the 'new', Netweaver-based API.
    I think, there are some general questions to answer:
    - My Repository Manager exposes lots of custom 
       properties to the system. I create the properties
       for example using following code:
       IProperty newProp = new StringSingleValueProperty(
         PropertyName.getPropertyName(
                  "{}" + myAttName),
         myAttVal,                         PropertyFlags.constructFlags(
                  true, false, true, false)
        Is there any convention for the propertie's name?
        I think it has to be written in lowercase only?
        Can I use ANY namespace I want instead of the
        empty default namespace? (For example:
    - After indexing my resources (of course, containing my
       custom properties), the TREX-Monitoring screen for my
       index shows all my custom properties in the 'Document
       Properties' area, but all uppercase chars are escaped
       somewhat. Is this OK?
    - Trying to use the index above to search for particular
       resources in my repository by my custom properties
       fails all the time ('no docs found...'); searching for
       any system property works fine. What's the reason?
    - How can I force the (Property-) search uses my
       custom namespace-manager's methods
       isQueryPropertyNameUnderstood() and
       getQueryBuilder()
       to perform a 'pure' property search by the repository
       manager? It seems that the TREX always handles the
       queries by itself, because my methods are never called.
    Thanx for you help,
    Daniel

    I created a new manager and copied the classes exactly from the "simple" example and I see similar behavior. Actually, when I do this, folders are recursively copied, but not files. Again, browsing and viewing of files work fine. Again, I am not seeing any unexpected exceptions.
    The only thing that changed were the names and namespaces. Nothing else at all was changed.
    This makes me think I am missing some configuration somewhere or there is something special about the example project that the wizards are not creating. The only difference I see in the project file is an additional nature (com.tssap.selena.cmf.PatternNature), but I am not sure that is relevant.
    Wow, I am really stumped.
    -Alex

  • How do I...Mimic Replacement Path with Query using Customer Variable Exits?

    Hello SDN:
    We are on BW 3.5 SP16.
    We are currently using a replacement path Query(RP) with variables
    to populate a variable in another Query(T).
    The problem we are having is with performance.
    The entry of variables in replacement path Query(RP) is optional (This is necessary there cannot be required values)
    When results from Replacement Path Query are small performance is fine. (e.g. 10 seconds)
    When results from Replacement path query are large performance suffers. (e.g. 1+ minutes)
    Users are free to leave the replacement path variables empty resulting in a large set of data to be replaced. This is the worst performance case.
    We would like to discover a way to conditionally execute the replacement path query. That is if users do not enter values for the replacement Query(RP) variables do not execute the replacement path query(RP).
    Does anyone know if this is possible within reason and in customer exit space?
    We have reviewed the situation from all angles and the requirement for the replacement path FUNCTIONALITY and the freedom for the user to leave variable values blank remains.
    I've been searching and reading SDN and SAP notes for about a week and do not find threads which address this situation.
    We are also exploring Customer variable exits to mimic replacement path functionality
    (different topic subject="How do I...Mimic Replacement Path with Query using Customer Variable Exits?")
    Any help will be appreciated
    Many thanks
    David Schuh

    My appologies-I posted this message with the wrong subject. I will repost it with appropriate subject.
    dave schuh

  • Search query TREX

    Hi,
    I try to configure the KM iview search query to return only result by the name of documents(or part of name) and not as full text.
    For example, if i make a search on "TEST" i can see in the result page:
    - document.doc <i>(name of file)</i>
    this a <b>test</b> document <i>(full text search)</i>
    - test.doc <i>(name of file)</i>
    this is a new doc to..... <i>(full text search)</i>
    - example.doc <i>(name of file)</i>
    a sample for a <b>test</b> has been ....<i>(full text search)</i>
    and i need to see only:
    - test.doc <i>(name of file)</i>
    this is a new doc to..... <i>(full text search)</i>
    How configure the search to have this result?
    For your information i'm in EP7 SP10, TREX 7.0.06
    Thanks in advance,
    Xavier.

    Hi ,
    The custom QueryExtender works for custom property of type String and not for Timestamp property.
    If add Attribute query for Timestamp property with operator as less or equal to current date value, it doesn't work as below.
    returnList.addAttributeQuery(lPublishDateProp,currentDate,IQueryEntry.PROPERTY_OPERATOR_LESS_OR_EQUAL);
    lPublishDateProp - Customer property name of type Timestamp
    currentDate - String value of java.util.Date current date
    Any clue?
    Thanks,
    Siva

  • E-mail Id's not Correct Against Customer No...

    Hi,
    In my report, i have a problem that when i selecting E-Mail against Customer no...it is displaying only those, which customer have the E-mail id...otherwise not showing...
    Plz. check my code...
    REPORT  zcust_master NO STANDARD PAGE HEADING LINE-SIZE 125  .
    TABLES : tvkbt, knvv, kna1, j_1imocust, tvtwt, t005u, adr6.
    TYPE-POOLS : slis.
    DATA : BEGIN OF itab OCCURS 0,
                vkbur LIKE knvv-vkbur,                   " Sales Office
                bezei LIKE tvkbt-bezei,                   " Branch
                vtweg LIKE knvv-vtweg,                   " Distribution Channel
                kunnr LIKE kna1-kunnr,                   " Customer Number
                name1 LIKE kna1-name1,                   " Name
                name2 LIKE kna1-name2,
                ktokd LIKE kna1-ktokd,                   " Customer Account Group
                erdat LIKE kna1-erdat,                   " Date on which the Record Was Created
                stras LIKE kna1-stras,                   " House number and street
                ort02 LIKE kna1-ort02,                   " District
                ort01 LIKE kna1-ort01,                   " City
                pstlz LIKE kna1-pstlz,                   " Postal Code
                knurl LIKE kna1-knurl,                   " URL
                regio LIKE kna1-regio,
                bezei1 LIKE t005u-bezei,
                vtext LIKE tvtwt-vtext,                  " NAME
                j_1iexcd  LIKE j_1imocust-j_1iexcd,      " ECC Number
                j_1icstno LIKE j_1imocust-j_1icstno,     " CST Number
                j_1ilstno LIKE j_1imocust-j_1ilstno,     " LST Number
                j_1ipanno LIKE j_1imocust-j_1ipanno,     " Permanent Account Number
                j_1iexrn  LIKE j_1imocust-j_1iexrn,      " Excise Registration Number
                j_1iexrg  LIKE j_1imocust-j_1iexrg,      " Excise Range
                j_1iexdi  LIKE j_1imocust-j_1iexdi,      " Excise Division
                j_1iexco  LIKE j_1imocust-j_1iexco,      " Excise Commissionerate
                smtp_addr LIKE adr6-smtp_addr,
           END OF itab.
    DATA    g_user_command TYPE slis_formname VALUE 'USER_COMMAND'.
    DATA : w_container TYPE scrfname VALUE 'CL_GRID',
           w_cprog TYPE lvc_s_layo,
           g_repid LIKE sy-repid,
           w_save TYPE c,
           w_exit TYPE c,
           cl_grid TYPE REF TO cl_gui_alv_grid,
           cl_custom_container TYPE REF TO cl_gui_custom_container,
           it_fld_catalog TYPE slis_t_fieldcat_alv,
           wa_fld_catalog TYPE slis_t_fieldcat_alv WITH HEADER LINE ,
           layout TYPE slis_layout_alv,
           col_pos  LIKE sy-cucol ,
           alvfc TYPE slis_t_fieldcat_alv.
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS   : vkbur FOR tvkbt-vkbur.
    SELECT-OPTIONS   : ktokd FOR kna1-ktokd.
    SELECT-OPTIONS   : vtweg FOR knvv-vtweg.
    SELECT-OPTIONS   : kunnr FOR kna1-kunnr.
    SELECTION-SCREEN : END OF BLOCK b1.
    PERFORM fill_catalog1 USING:
    'BEZEI'    'ITAB'    'BRANCH' ,
    'KUNNR'    'ITAB'    'CUSTOMER CODE' ,
    'NAME1'    'ITAB'    'CUSTOMER NAME',
    'NAME2'    'ITAB'    'NAME2',
    'VTWEG'    'ITAB'    'DISTT. CHANNEL',
    'STRAS'    'ITAB'    'HOUSE NO. & STREET',
    'ORT02'    'ITAB'    'DISTRICT',
    'ORT01'    'ITAB'    'CITY',
    'PSTLZ'    'ITAB'    'POSTAL CODE' ,
    'BEZEI1'   'ITAB'    'REGION',
    'J_1IEXCD' 'ITAB'    'ECC NUMBER',
    'J_1IEXRN' 'ITAB'    'E/R NO.',
    'J_1IEXRG' 'ITAB'    'Ex. RANGE',
    'J_1IEXDI' 'ITAB'    'Ex. DIVISION',
    'J_1IEXCO' 'ITAB'    'Ex. Commissionerate' ,
    'J_1ICSTNO' 'ITAB'   'CST NUMBER' ,
    'J_1ILSTNO' 'ITAB'   'LST NUMBER' ,
    'J_1IPANNO' 'ITAB'   'PAN NO.' ,
    'KTOKD'    'ITAB'    'ACC. GROUP',
    'ERDAT'    'ITAB'    'CREATED ON',
    'SMTP_ADDR' 'ITAB'    'E-MAIL ID',
    'VTEXT'    'ITAB'    'NAME' .
    SELECT akunnr aname1 aname2 aktokd aerdat astras aort02 aort01 apstlz aknurl a~regio
                    bvtweg bvkbur binco2   csmtp_addr
                    INTO CORRESPONDING FIELDS OF TABLE itab
                    FROM kna1 AS a
                    INNER JOIN knvv AS b ON akunnr = bkunnr
                    INNER JOIN adr6 AS c ON aadrnr = caddrnumber
                    WHERE a~kunnr IN kunnr
                    AND   a~ktokd IN ktokd
                    AND   b~vtweg IN vtweg
                    AND   b~vkbur IN vkbur.
    IF sy-subrc <> 0.
      MESSAGE 'DATA NOT FOUND.' TYPE 'I'(001).
    ENDIF.
    SORT itab BY kunnr.
    LOOP AT itab.
      SELECT SINGLE bezei FROM tvkbt INTO itab-bezei WHERE vkbur = itab-vkbur.
      MODIFY itab INDEX sy-tabix TRANSPORTING bezei.
      SELECT SINGLE bezei FROM t005u INTO itab-bezei1 WHERE bland = itab-regio AND spras EQ 'EN' AND land1 EQ 'IN'.
      MODIFY itab INDEX sy-tabix TRANSPORTING bezei1.
      SELECT SINGLE j_1iexcd j_1iexrn j_1iexrg j_1iexdi j_1iexco j_1icstno j_1ilstno j_1ipanno FROM j_1imocust
      INTO (itab-j_1iexcd, itab-j_1iexrn, itab-j_1iexrg, itab-j_1iexdi, itab-j_1iexco, itab-j_1icstno, itab-j_1ilstno, itab-j_1ipanno)
      WHERE kunnr = itab-kunnr.
      MODIFY itab INDEX sy-tabix TRANSPORTING j_1iexcd j_1iexrn j_1iexrg j_1iexdi j_1iexco j_1icstno j_1ilstno j_1ipanno.
      SHIFT itab-kunnr LEFT DELETING LEADING '0'.                  " For Removing 0's from KUNNR
      MODIFY itab.
    ENDLOOP.
    layout-zebra = 'X' .
    layout-colwidth_optimize(1) = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program      = 'ZCUST_MASTER'
        i_callback_user_command = g_user_command
        is_layout               = layout
        it_fieldcat             = it_fld_catalog
        i_default               = 'X'
        i_save                  = 'A'
      TABLES
        t_outtab                = itab
      EXCEPTIONS
        program_error           = 1
        OTHERS                  = 2.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    *&      Form  FILL_CATALOG1
          text
         -->P_FIELDNAME  text
         -->P_REF_TABLE  text
         -->P_SCRTEXT    text
    FORM fill_catalog1  USING   p_fieldname TYPE any
                                p_ref_table TYPE any
                                p_scrtext   TYPE any.
      CLEAR : wa_fld_catalog.
      wa_fld_catalog-fieldname  = p_fieldname.
      wa_fld_catalog-tabname    = p_ref_table.
      wa_fld_catalog-seltext_s  = p_scrtext.
      wa_fld_catalog-seltext_m  = p_scrtext.
      wa_fld_catalog-seltext_l  = p_scrtext.
      wa_fld_catalog-outputlen = 15.
      APPEND wa_fld_catalog TO it_fld_catalog.
    ENDFORM.                    " fill_catalog1
          FORM user_command
    -->  r_ucomm
    -->  rs_selfield
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
      DATA: l_ta(4) TYPE c VALUE 'XD03'.
      CASE r_ucomm.
        WHEN '&IC1'.                             "dobbleclick
          READ TABLE itab INTO itab INDEX rs_selfield-tabindex.
          CHECK sy-subrc = 0.
          IF rs_selfield-fieldname = 'KUNNR'.
            SET PARAMETER ID 'KUN' FIELD itab-kunnr.
            CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.  "# EC*
          ENDIF.
          CLEAR r_ucomm.
      ENDCASE.
    ENDFORM.                    "user_command
    Plz let me know....
    thanks

    change select query like dis...
    SELECT akunnr aname1 aname2 aktokd aerdat astras aort02 aort01 apstlz aknurl a~regio
    bvtweg bvkbur binco2 csmtp_addr
    INTO CORRESPONDING FIELDS OF TABLE itab
    FROM kna1 AS a
    INNER JOIN knvv AS b ON akunnr = bkunnr
    LEFT OUTER JOIN adr6 AS c ON aadrnr = caddrnumber
    WHERE a~kunnr IN kunnr
    AND a~ktokd IN ktokd
    AND b~vtweg IN vtweg
    AND b~vkbur IN vkbur.

Maybe you are looking for