Execute Method must not return a resultSet
Hi.
I am using DataModifyQuery to insert a record in MS SQL. On that Table there is one trigger defined whcih in turn insert data into some other table. in case there is any error the trigger return a error message.
When i execute the Sql with DataModifyQuery and there is a error return from the trigger then Toplink gives me a error message.
Execute Method must not return a resultSet
how can i over come this sistuation.
Thanks.
Nadir wrote:
I was lost. Right, there was no return statement. Below works now
public String getIPAddress(){
String hostip = "";
try {
hostip = InetAddress.getLocalHost().getHostAddress();
System.out.println("ip is "+hostip);
} catch (UnknownHostException e) {
hostip = e.getMessage();
return hostip;
-----It compiles. I wouldn't say it works. If I call a method getIPAddress(), I expect the String I get back to be an IP address. I don't want to have to parse it to determine that it's not an error message. That defeats the whole purpose of the exception mechanism. If that method can't get the IP address, it should throw an exception. In this case, there's no reason to catch the exception; just let it propagate up out of that method.
Beginners often seem to think that exceptions are something that just arose on their own out of the language, and the designers had to add try/catch in order to be able to stop them from preventing our code executing. That's not the case. They were deliberately added to the language as a better way of indicating an error than checking return values at every step.
Similar Messages
-
Error: Expression must not return a multiline value
Hi all,
I am doing a file to file scenario. My input file has more than one record. I have to validate for each of these records and send back the erroneous records in a file to the source folder.
I am using BPM for this. In my BPM, i have some multiline container elements. When i try to activate my BPM, i am getting an error saying: <b>Expression must not return a multiline value.</b>
Can anybody tell me why this error is coming? Also i want to know what type of mapping i have to do to split my source file.
Regards,
Divija."Can anybody tell me why this error is coming? Also i want to know what type of mapping i have to do to split my source file."
Go through the following blogs which give step-bystep approach for split mapping using BPM:-
1. /people/sudharshan.aravamudan/blog/2005/12/01/illustration-of-multi-mapping-and-message-split-using-bpm-in-sap-exchange-infrastructure
2. /people/narendra.jain/blog/2005/12/30/various-multi-mappings-and-optimizing-their-implementation-in-integration-processes-bpm-in-xi
Also, you might want to look at this, where a BPM is not required..i think you can avoid a BPM altogether if you have very little validation..
/people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible
Regards,
Sushumna -
BPM collection pattern - Expression must not return a multiline value
Hi,
I am trying to create an integration process to collect messages - when I run the check function I get the message 'Expression must not return a multiline value' - I have checked everything and cannot find what is causing this message. When I click on the message I get taken to the transformation step properties.
Any ideas?
Regards
IanHI,
Your Interface Mapping should be of N:1 type.
i.e occurence of your source message should be of 0..unbounded and target message should be 1.
Once you change Interface Mapping, you need to change occurences of corresponding Message Maaping.
Use this interface mapping in your Transformation Step in BPM, where you collect all the messages.
Hope this helps,
Regards,
Moorthy -
Expression must not return a multilne value
Hi
I am trying to create PurchaseOrder message via BPM.
The target MI has:
One Header record
Unbounded Items records
In BPM, Fork of 2 braches is created to recieve Header, another branch use looping to received Items and store into ItemsList
After the fork, a tarnsformation is use to create target MI, which the source contains:
Header (single record) and
ItemList (multiline with Item record)
Now the problem, when I do a check, I always hit the error: "Expression must not return a multilne value"
However if use :
Header (single record) and
Item (single Item record)
OR
HeaderList (multiline record) and
ItemList (multiline Item record)
It does not generate this error.
I seems the tarsnformation does not allow mixing of "Multiline" and "Singleline" for N:1 transformation???
Please advise
//jack
Message was edited by: JackLimHmmmmm ...
>>>
tarnsformation is use to create target MI, which the source contains:
Header (single record) and
ItemList (multiline with Item record)
Recheck the parameters of the transformation step -
Why is the giving me this error (method does not return a value) PLEASE !!
I have this code and it is giving me this error and I don't know how to fix it
can anyone out there tell me why
I have included the next line of code as I have had problems in the curly brackets in the past.
The error is
"Client.java": Error #: 466 : method does not return a value at line 941, column 3
Please help
THX TO ALL
private Date DOBFormat()
try
if
(MonthjComboBox.getSelectedItem().equals("") ||
DayjComboBox.getSelectedItem().equals("") ||
YearjComboBox.getSelectedItem().equals("")){
else
String dateString = StringFromDateFields();
SimpleDateFormat df = new SimpleDateFormat("dd/mm/yyyy");
Date d = df.parse(StringFromDateFields());
System.out.println("date="+d);
return d;
catch (ParseException pe)
String d= System.getProperty("line.separator");
JOptionPane.showMessageDialog( this,
"Date format needs to be DD/MM/YYYY,"+ d +
"You have enterd: "+ StringFromDateFields() + d +
"Please change the Date", "Date Format Error",
JOptionPane.WARNING_MESSAGE);
return null;
//File | Exit action performed
public void jMenuFileExit_actionPerformed(ActionEvent e) {
System.exit(0);
}Fixed it needed to have a return null;
this is the code
if
(MonthjComboBox.getSelectedItem().equals("") ||
DayjComboBox.getSelectedItem().equals("") ||
YearjComboBox.getSelectedItem().equals("")){
return null; -
Last() method was not supported by "resultset type of TYPE_FORWARD_ONLY "
Hi all,
I got this exception
java.sql.SQLException: JZ0BT: The last() method is not supported for ResultSets of type TYPE_FORWARD_ONLY.
but while creating statement object i am dong like this
stmt = con.prepareCall(sql.toString(),ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
then also it is giving the same exception.
my bean code is like this,
try {
//Dynamically get the row size for the o/p dataset
from result set
rs.last();
System.out.println(rs);
int numrows =rs.getRow();
can anyone help me out to get the total number of rows in Resultset
Thanks in advance
RaviThere's no easy way to do it that I know of. All you can do is iterate through and count. - MOD
-
Avoid JDBC sender error: Execute statement did not return a result set
Hi!
My JDBC sender adapter towards MS SQL server works fine, with an Execute statement calling a stored procedure that returns the source data needed. The stored procedure itself updates the status of database table records, so that only the unread records are returned each time the stored procedure is called.
However, the communication channel monitoring sets a red flag for the JDBC sender adapter, when there are no values to fetch from the database table (using the stored procedure). Message says: "Database-level error reported by JDBC driver while executing statement 'EXECUTE FetchMessage 1, 9000'. The JDBC driver returned the following error message: 'com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.'. For details, contact your database server vendor."
This is not an error situation, as I do not expect there to be any values to fetch from the database at all times.
I do not see how to change the stored procedure to avoid this error.
Is there a parameter to be set on the JDBC adapter that I can use, so the red flag is avoided?
Thanks for any input!
Regards,
Oeystein EmhjellenHi Oeystein Emhjellen.
The problem is Store Procedure that has to generate always a ResultSet (or cursor). If it doesn't have a output, you have to generate an Empty ResultSet.
Like a SELECT Statement:
If there are data, SELECT get an output result but if it get nothing the SELECT Statement get a empty ResultSet.
Ask to your database team.
I hope it helps you.
Bruno. -
MDMJavaAPI: Execute() method is not running.
Hi Gurus,
I am trying to delete the repository using MDMJavaAPI.
Here is the whole code for deleting repository.
=============================================import com.sap.mdm.commands.AuthenticateRepositorySessionCommand;
import com.sap.mdm.commands.CommandException;
import com.sap.mdm.commands.CreateRepositorySessionCommand;
import com.sap.mdm.commands.DestroySessionCommand;
import com.sap.mdm.net.ConnectionException;
import com.sap.mdm.net.ConnectionPool;
import com.sap.mdm.net.ConnectionPoolFactory;
import com.sap.mdm.repository.RepositoryStatus;
import com.sap.mdm.repository.commands.DeleteRepositoryCommand;
import com.sap.mdm.repository.commands.GetRepositoryStatusCommand;
import com.sap.mdm.server.DBMSType;
import com.sap.mdm.server.RepositoryIdentifier;
@author tarunsha
To change the template for this generated type comment go to
Window>Preferences>Java>Code Generation>Code and Comments
public class TestDeleteRepository {
public static final int STATE_NOT_CONNECTED = 0;
public static final int STATE_CONNECTED = 1;
public static int state = STATE_NOT_CONNECTED;
public static ConnectionPool simpleConnection;
public static RepositoryIdentifier repIdentifier;
public static String session;
public static String connection = "ntbomsap14";
public static String repository = "Test_JavaMDMapi_Tarun";
public static DBMSType dbmsType = DBMSType.MS_SQL;
public static void main(String[] args)throws CommandException, ConnectionException {
//Creating Connection.
simpleConnection = ConnectionPoolFactory.getInstance(connection);
//Establishing connection with Repository.
repIdentifier = new RepositoryIdentifier("Test_JavaMDMapi_Tarun", connection, dbmsType);
//Creation Repository Session.
CreateRepositorySessionCommand createRepositorySessionCmd = new CreateRepositorySessionCommand(simpleConnection);
createRepositorySessionCmd.setRepositoryIdentifier(repIdentifier);
createRepositorySessionCmd.execute();
System.out.println("Create Repository Session Cmd is Executed.......");
session = createRepositorySessionCmd.getRepositorySession();
System.out.println("STATE_CONNECTION_ESTABLISHED.....");
AuthenticateRepositorySessionCommand authenticateRepositorySessionCmd = new AuthenticateRepositorySessionCommand(simpleConnection);
authenticateRepositorySessionCmd.setSession(session);
authenticateRepositorySessionCmd.setUserName("Admin");
authenticateRepositorySessionCmd.setUserPassword("");
authenticateRepositorySessionCmd.execute();
session = authenticateRepositorySessionCmd.getSession();
GetRepositoryStatusCommand getRepStatusCmd = new GetRepositoryStatusCommand(simpleConnection);
getRepStatusCmd.setSession(session);
getRepStatusCmd.execute();
RepositoryStatus repStatus = getRepStatusCmd.getStatus();
if(repStatus.getStatus() == RepositoryStatus.RUNNING) {
System.out.println("Cannot delete a repository with status running! Canceling deletion process...");
destroy(session);
DeleteRepositoryCommand deleteRepCmd = new DeleteRepositoryCommand(simpleConnection); deleteRepCmd.setRepositoryIdentifier(repIdentifier);
deleteRepCmd.setSession(session);
// Excute the command...
System.out.println("Running");//Just for checking wheather control is reaching here or not.
deleteRepCmd.execute();
System.out.println("Execution of DeleteRepositoryCommand successful.");
destroy(session);
public static void destroy(String session) throws CommandException{
DestroySessionCommand destroySessionCmd = new DestroySessionCommand(simpleConnection);
destroySessionCmd.setSession(session);
destroySessionCmd.execute();
session = null;
System.out.println("STATE CONNECTION is DESTROYED......");
=============================================
When control reaches at execute method of DeleteRepositoryCommand class, it displays the following error msg.
com.sap.mdm.commands.CommandException: com.sap.mdm.internal.protocol.manual.ServerException: The current Protocol operation is not supported for the session specified.
* at com.sap.mdm.repository.commands.DeleteRepositoryCommand.execute(DeleteRepositoryCommand.java:69)*
* at Test_Package.TestDeleteRepository.main(TestDeleteRepository.java:85)*
Caused by: com.sap.mdm.internal.protocol.manual.ServerException: The current Protocol operation is not supported for the session specified.
* at com.sap.mdm.internal.protocol.manual.AbstractProtocolCommand.execute(AbstractProtocolCommand.java:112)*
* at com.sap.mdm.repository.commands.DeleteRepositoryCommand.execute(DeleteRepositoryCommand.java:64)*
* ... 1 more*
Exception in thread "main"
Could you suggest me, what i have to do in this situation.
I need your help.
Edited by: Tarun Sharma on Jan 2, 2008 5:46 PM
Edited by: Tarun Sharma on Jan 2, 2008 5:50 PM
Edited by: Tarun Sharma on Jan 3, 2008 11:32 AMHi Namrata,
If we are deleting an repository, it means we are making connection with repository that's why we have to createRepositorySession rather than serverSession.
According to this JavaDoc note:
"NOTE: This command used to take in a repository session. This command had be changed to take in a server session. The setRepositoryIdentifier is also required."
the method setRepositoryIdentifier is defined in CreateRepositorySessionCommand not in ServerSessionCommand. That's why we have to use RepositorySessionCmd.
According to your advice I changed CreateRepositorySessionCommand and AuthenticateRepositorySessionCommand with ServerSessionCommand and AuthenticateServerSessionCommand but getting Same Error "The current Protocol operation is not supported for the session specified."
Thanks
Tarun
Edited by: Tarun Sharma on Jan 3, 2008 10:44 AM -
Error / BUG in BPM SAP PI7.1 "Expression must not return a multiline value"
Hey experts,
I try to use a MULTILINE interface in an integration process, but when I try to select the multiline interface in the sending Step (asynch), then I can´t select a INDEX variable? ...
See here: Picture of ERROR
I tried my steps with a XI3.0 in exactly the same way and it works. Is this a bug in the PI? We have Service Package 04 (initial Shipment).
Does anyone has an idea?
Thanks a lot for fast help
Rgds,
SteffenHi,
I tested it on a PI 7.1 SP 8 and there it works.
What you could try is to export your Integration Process from XI 3.0 (you said it's working) and import it in your PI 7.1.
Regards
Patrick -
We are running SRM 7.0 SP 8 with Process Controlled Workflow.
I am trying to use object with reference to class /SAPSRM/CL_WF_PROCESS_LEVEL, method IS_LAST_LEVEL to determine if the current workflow process level is the last in an N-step approval. But the method does not return what I am expected, instead, it is always returning abap_true. I am puzzled for a while for this. Following is my code excerpt with this call:
data:ls_process_level type /sapsrm/s_wf_process_level,
lo_curr_proc_level type ref to /sapsrm/cl_wf_process_level.
call method /sapsrm/cl_wf_apv_facade=>get_current_process_level
exporting
iv_document_guid = iv_doc_guid
importing
es_process_level = ls_process_level.
try.
lo_curr_proc_level = /sapsrm/cl_wf_process_level=>getpersistent_by_oid( ls_process_level-level_guid ).
if lo_curr_proc_level->is_last_level( ) eq 'X'.
lv_final_step = 'X'.
endif.
catch cx_root.
raise exception type /sapsrm/cx_wf_not_found.
endtry.
Note: After the call to /sapsrm/cl_wf_process_level=>getpersistent_by_oid, lo_curr_proc_level is returned with the actual valid object. The issue is only with the next call to IS_LAST_LEVEL.
If you can shed some light as to what might be wrong with this code, OR, how else you would determine whether the current process level is the last step in an N-step approval, I'd really appreciate it.
Thanks.Hi,
Try the below code
DATA lo_first_level TYPE REF TO /sapsrm/cl_wf_process_level.
DATA lo_temp_level TYPE REF TO /sapsrm/cl_wf_process_level.
DATA lo_obsolete_level TYPE REF TO /sapsrm/cl_wf_process_level.
DATA lv_process_status TYPE /sapsrm/wf_process_status.
DATA lo_process_config TYPE REF TO /sapsrm/cl_wf_configuration.
DATA lv_process_scheme TYPE /sapsrm/wf_process_scheme.
DATA lv_document_guid TYPE /sapsrm/wf_document_guid.
DATA lv_document_type TYPE /sapsrm/wf_document_type.
DATA lo_object_service TYPE REF TO /sapsrm/cl_wf_object_service.
DATA lo_runtime_config TYPE REF TO /sapsrm/if_wf_runtime_hdl.
DATA ls_config_value TYPE /sapsrm/s_wf_runtime_result.
DATA lv_config_value TYPE /sapsrm/wf_conf_attr_val.
DATA lv_restart_process_scheme TYPE /sapsrm/wf_process_scheme.
DATA lv_first_level_id TYPE os_guid.
DATA lv_final_acceptance_registered TYPE /sapsrm/wf_conf_attr_val.
CONSTANTS:
lc_prc_level_class_name TYPE seoclskey VALUE '/SAPSRM/CL_WF_PROCESS_LEVEL',
lc_scheme_attribute TYPE /sapsrm/wf_conf_attr VALUE 'PRC_RSTSCE', " Process restart scheme
lc_level_attribute TYPE /sapsrm/wf_conf_attr VALUE 'PRC_RSTLVL'. " Process restart first level
rv_updated = abap_false.
lv_document_type = io_process->getdocument_type( ).
lv_document_guid = io_process->getdocument_guid( ).
CREATE OBJECT lo_object_service.
CREATE OBJECT lo_process_config
EXPORTING
iv_document_type = lv_document_type
iv_document_guid = lv_document_guid
io_process = io_process.
lv_process_scheme = lo_process_config->get_process_scheme( ).
IF lv_process_scheme EQ io_process->getprocess_scheme( ) AND iv_force_update EQ abap_false.
RETURN.
ENDIF.
lv_process_status = /sapsrm/cl_wf_process_manager=>get_process_status( lv_document_guid ).
"--- Get the OID of the first process level
TRY.
lo_runtime_config = /sapsrm/cl_wf_process_manager=>get_runtime_config(
io_process = io_process
IF lo_runtime_config IS NOT BOUND.
RAISE EXCEPTION TYPE /sapsrm/cx_wf_abort.
ENDIF.
CLEAR ls_config_value.
lo_runtime_config->get_attribute(
EXPORTING
iv_attribute = lc_level_attribute
IMPORTING
es_attribute_result = ls_config_value
lv_first_level_id = ls_config_value-attribute_value.
CATCH /sapsrm/cx_wf_error. "EC NO_HANDLER
CLEAR ls_config_value.
ENDTRY.
"-- Get the Flag of FINAL_ACCEPTANCE_REGISTERED
TRY .
CLEAR ls_config_value.
lo_runtime_config->get_attribute(
EXPORTING
iv_attribute = /sapsrm/if_wf_process_c=>gc_wf_runtime_attrib_010 "'ACP_FINAL'
IMPORTING
es_attribute_result = ls_config_value
lv_final_acceptance_registered = ls_config_value-attribute_value.
CATCH /sapsrm/cx_wf_error. "EC NO_HANDLER
CLEAR ls_config_value..
ENDTRY.
"--- Determine current object state of the process instance
IF ( lo_object_service->is_new_instance( io_process ) EQ abap_true OR
lo_object_service->is_changed_instance( io_process ) EQ abap_true ) AND
lv_process_status EQ /sapsrm/if_wf_process_c=>gc_process_status_initial.
"--- Delete obsolete process levels in case process instance is still in initial state
lo_temp_level = io_process->getfirst_level( ).
DO.
IF lo_temp_level IS NOT BOUND.
EXIT.
ENDIF.
tif this field lo_temp_level->is_last_level( ) is 'X'
Saravanan -
Res.getPathTranslated() does not return correct URL of the page requested
Hi,
The res.getPathTranslated() statement in the below code (in doFilter method) does not return the correct URL of the requested webpage.
Whenever a web page is accessed using a return statement (eg : return "nextPage"; ) inside a button's action method or a hyperlink's action method, the res.getPathTranslated() returns the URL of the current webpage instead of returning the URL of the webpage that is actually requested.
For example if there is a button on the page http://localhost:29080/MyJaas/faces/firstPage.jsp
And the button_action() is as follows
button_action()
return "nextPage";
The res.getPageTranslaged() returns "http://localhost:29080/MyJaas/faces/firstPage.jsp" instead of "http://localhost:29080/MyJaas/faces/nextPage.jsp"
However, if the webpage is requested by populating the URL property of the hyerlink in creator IDE, the res.getPathTranslated() returns the correct (requested) web page.
How to make res.getPathTranslagted() return the correct URL when the webpage is accessed from hyperlink's / button's action method?
I know that the explation is not very clear, so please bear with me. Let me know if you need more clarificatons. Thanks in advance for showing interest in this issue.
And by the way, the code below is the same as that used in Jaas Authentication tutorial :- http://developers.sun.com/prodtech/javatools/jscreator/reference/techart/2/jaas_authentication.html
package jaasauthentication;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.http.HttpSession;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class SecurityFilter implements Filter{
/** Creates a new instance of SecurityFilter */
private final static String FILTER_APPLIED = "_security_filter_applied";
public SecurityFilter() {
public void init(FilterConfig filterConfig) {
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws java.io.IOException, ServletException{
HttpServletRequest req = (HttpServletRequest)request;
HttpServletResponse res = (HttpServletResponse)response;
HttpSession session = req.getSession();
String requestedPage = req.getPathTranslated();
String user=null;
//We dont want to filter certain pages which include the Login.jsp/Register.jsp/Help.jsp
if(request.getAttribute(FILTER_APPLIED) == null) {
//check if the page requested is the login page or register page
if((!requestedPage.endsWith("Login.jsp")) && (!requestedPage.endsWith("Register.jsp")) && (!requestedPage.endsWith("Help.jsp"))){
//Requested page is not login.jsp or register.jsp therefore check for user logged in..
//set the FILTER_APPLIED attribute to true
request.setAttribute(FILTER_APPLIED, Boolean.TRUE);
//Check that the session bean is not null and get the session bean property username.
if(((jaasauthentication.SessionBean1)session.getAttribute("SessionBean1"))!=null) {
user = ((jaasauthentication.SessionBean1)session.getAttribute("SessionBean1")).getUsername();
if((user==null)||(user.equals(""))) {
res.sendRedirect("Login.jsp");
return;
//deliver request to next filter
chain.doFilter(request, response);
public void destroy(){
}Guys any solution for the above problem?
Right answer fetches 10 duke dollars.. -
Execute method is undefined for Request_ZBpProjectGetlist2.
I created a webservice for a BAPI and imported to Web Dynpro DC using Web Service Model.
But I am getting an error in wdContext.currentRequest_ZBpProjectGetlist2Element().modelObject().execute();
It says Method execute() is undefined for Request_ZBpProjectGetlist2.
Can anyone help me why the execute method is not available for webservice model...Hi Sridhar,
Please check execute method available for Request_ZBpProjectGetlist2 or not.
Organize your import and check Request_ZBpProjectGetlist2 is imported or not.
BR
Arun -
Returning a ResultSet from a method
I have wrote a method that opens a database connection, peroforms a sql query and then closes the connection. It then returns the ResultSet.
My problem is I get this error "ResultSet is closed" when i try to work on the data from the ResultSet.
any idea?A ResultSet object is automatically closed when the Statement object that generated it is closed, re-executed, or used to retrieve the next result from a sequence of multiple results.
Try to leave the database connection and the statement through which you got the resultset open, but this is not a good way.
You may want to use CachedRowSet instead of ResultSet.
A CachedRowSet class�a disconnected rowset that caches its data in memory; not suitable for very large data sets, but an ideal way to provide thin Java clients, such as a Personal Digital Assistant (PDA) or Network Computer (NC), with tabular data.
Refer to the following pages for more info on CachedRowSet
http://developer.java.sun.com/developer/technicalArticles/javaserverpages/cachedrowset/
http://developer.java.sun.com/developer/Books/JDBCTutorial/chapter5.html
http://developer.java.sun.com/developer/earlyAccess/crs/ -
I'm trying to query a document folder for all of its containing documents. Its a basic query like this:
IPortletContext PortletContext = PortletContextFactory.CreatePortletContext(Request,Response);IRemoteSession PTSession;PTSession = PortletContext.GetRemotePortalSession();IDocumentManager documentManager = PTSession.GetDocumentManager();
IDocumentQuery documentQuery = documentManager.CreateQuery(FolderID); documentQuery.SetSortProperty(ObjectProperty.Name);IObjectQuery queryResults = documentQuery.Execute();
When I'm logged into the portal as an administrator, everything works fine. However if I'm logged in as a "regular" user, I get this exception when calling the Execute() method:
Plumtree.Remote.PRC.PortalException: Exception of type Plumtree.Remote.PRC.PortalException was thrown. ---> System.Web.Services.Protocols.SoapException: Server was unable to process request. --> Access denied: Current user does not have edit permission
I'm sending the Login Token to the portlet. Now I've tried giving the user Edit rights on the document folder as well as Edit the Knowledge Directory rights in the Activity Manager, but neither gets rid of the exception. I'm not sure what other "Edit" permissions to check. I don't even see why the user would need "Edit" permission to anything in the first place since the Execute() method simply returns an IObjectQuery that doesn't have any ability to make changes to any objects. I know that I could use the SearchFactory interface, but I wanted the results to be real time. Any help would be much appreciated. Thanks!
JimmyThe problem here is that the query is created with default settings to show unapproved documents -- only users with edit access can see unapproved documents. Add the bold line to your code and it will work.
IDocumentManager docManager = prcSession.GetDocumentManager();IDocumentQuery docQuery = docManager.CreateQuery(iFolderID);docQuery.SetShowUnapproved(false);IObjectQuery queryResults = docQuery.Execute() -
SPList.GetItems Method not returning any items at first instance
Hello,
I am trying to get one specific item from a Info Path library based on the Name field from code behind of Info-Path form at Form Loading event. Now when I try to run the query for the first time, it does not return any item however if I wait for let's say
5 seconds(this is not fixed), take my debugger back to that line to execute the query again, it returns the item this item.
Code and everything else looks fine as the same thing when tried with console app always return items. I understand the console app run's as Administrator.
Considering it may be inconsistent issue due to permissions, I also changed my permission as Site Collection Administrator no change in behavior. The App Pool account is also having full permissions on list.
I have seen below blog but without any in-depth detail of explain this behavior.
http://thingsthatshouldbeeasy.blogspot.com/2009/09/getitems-list-query-returns-no-items.html#.VSLfKvnF_To
Any thoughts or suggestions to workaround this issue?
Since I know what item needs to be fetched, I just don't want to get all items and then loop through my items to get one specific item.
Thanks, Rakesh
Please Mark As Answer if my post solves your problem or Vote As Helpful if a post has been helpful for you. ***Posting is provided "AS IS" with no warranties, and confers no rights.Hi,
Will the issue persist if query other list for a specific item?
I suggest you show the complete code in use for a further research, it would make others easier to find out the root cause for you.
Thanks
Patrick Liang
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]
Maybe you are looking for
-
Weblogic managed server shutdown immediately after going to STARTING state
Our configuration has 3 managed servers M1, M2, M3. M2 and M3 are in a cluster to share JNDI name for JMS servers. Are M3 server often shutdown on starting up just after the server goes to the STARTING state. I have 2 log traces. The first shows when
-
Best practices for managing jar files
just wondering what anyone's thoughts are on managing jar files. I have read that instead of adding the jar files to your CLASSPATH environment variable, you can just extend the jdk. This is accomplished by inserting the jar files into the C:\jdk1.3.
-
What happened to Photo Stream?
After updating to ios8 the photo stream and camera roll albums are gone. I opened iCloud on my computer and it says the photo stream folder is empty (I backed up to iCloud and my computer before I updated). Many photos are visible from the colle
-
When I open Bridge Master Collection CS6, I get the message: There was a mistake in Bridge, therefor the cache cannot be read. Try to erase the central cache to solve the problem. The solutions given by Adobe don't help me. Does anyone have another s
-
Iphone not syncing with MobileMe
Today, I noticed that my iphone (3G latest firmware) is no longer syncing contacts, calendars, bookmarks etc with MobileMe. I have tried everything, including hard reset of iphone, deleting and re-adding my mail, contact account in the iPhone setting