Unable to Read Calendar List Items through CAML
Hi All,
* I have created two columns in calendar one Year and other Month.When new event is added in calendar through (Item Added) event receiver I am setting the values to this columns as Name of Month to(February) and Year as(2014) .So that I can fetch the
data easily based on month and year
* Through this Columns Secondly when I try to fetch the data to count number of items of particular month and year using caml query I am getting error as below .
"Error:One or more field types are not installed properly. Go to the list settings page to delete these fields."
*My below caml code is working fine if i applied to custom list,But not to calendar.Can any one help me for what reason I am unable to fetch data
Code
string year="2014";
string month="February";
SPSite mysite = SPContext.Current.Site;
SPWeb myweb = mysite.OpenWeb();
SPList mylist = myweb.Lists["Calendar"];
SPQuery myquery = new SPQuery();
myquery.Query = @"<Where>
<And>
<Eq>
<FieldRef Name='Year'/>
<Value Type='Text'>" + year + @"</Value>
</Eq>
<Eq>
<FieldRef Name='Month' />
<Value Type='Text'>" + month + @"</Value>
</Eq>
</And>
</Where>";
SPListItemCollection totaltiems = mylist.GetItems(myquery);
Label1.Text= "Total Number of Items is "+" "+totaltiems.Count.ToString();
Thanks, Quality Communication Provides Quality Work. http://siddiq-sharepoint2010.blogspot.in/ Siddiqali Mohammad .
Hi,
According to your post, my understanding is that you got an error when read calendar list items using CAML.
I created two single line of text columns in the Calendar( Year and Month), then add items in the Calendar to check with your code. The CAML query worked well as below.
string year = "2014";
string month = "February";
using (SPSite oSiteCollection = new SPSite("Your site URL"))
using (SPWeb myweb = oSiteCollection.OpenWeb())
SPList mylist = myweb.Lists["Calendar"];
SPQuery myquery = new SPQuery();
myquery.Query = @"<Where> <And> <Eq> <FieldRef Name='Year'/> <Value Type='text'>" + year
+ "</Value></Eq><Eq>+ "
+ " <FieldRef Name='Month' />+ "
+ " <Value Type='text'>" + month + "</Value>+ "
+ " </Eq> </And></Where>";
SPListItemCollection totaltiems = mylist.GetItems(myquery);
Console.WriteLine( "Total Number of Items is " + " " + totaltiems.Count.ToString());
Console.ReadLine();
Which type of the two columns in your Calendar? Were they text type?
Are you sure the field name(<FieldRef Name='Year'/>,
<FieldRef Name='Month' />) is same as internal name?
We should only use internal name while refrencing columns in CAML query. If you have space In you column , replace it with "_x0020_", such as
News_x0020_Category.
Thanks & Regards,
Jason
Jason Guo
TechNet Community Support
Similar Messages
-
I downloaded code for a reservation event receiver from here:
http://blog.sharepointsydney.com.au/post/Setting-up-multiple-calendars-for-meeting-room-bookings-prevent-double-booking.aspx
However, on the ItemUpdating it throws an "Object Reference Not Set to an Instance of an Object" error. By commenting out parts of the code and re-deploying I have narrowed the issue down to the line that gets the item's GUID:
string guid_internal = collItems.List.Fields["GUID"].InternalName;
When I modify it to something like "UniqueId" I get the "Value does not fall within expected range" error. Is there a better way to obtain the GUID of the calendar list item - or am I missing something? Full code below:
using System;
using Microsoft.SharePoint;
namespace Webcoda.WSS.Calendar.Events
class PreventDoubleBooking: SPItemEventReceiver
/// <summary>
/// This event is triggered when the user adds a new item
/// </summary>
/// <param name="properties"></param>
public override void ItemAdding(SPItemEventProperties properties)
//Our query string variable
string strQuery = null;
try
//Get the Sharepoint site instance
using (SPWeb oWebsite = new SPSite(properties.SiteId).OpenWeb(properties.RelativeWebUrl))
//Get the collection of properties for the Booking item
SPListItemCollection collItems = oWebsite.Lists[properties.ListTitle].Items;
//Get the Calendar List that we will be querying against
SPList calendar = oWebsite.Lists[properties.ListId];
//Get the internal name of the fields we are querying.
//These are required for the CAML query
string start_internal = collItems.List.Fields["Start Time"].InternalName;
string end_internal = collItems.List.Fields["End Time"].InternalName;
string MeetingRoom_Internal = collItems.List.Fields["Meeting Room"].InternalName;
//Get the query string parameters
string start_str = properties.AfterProperties[start_internal].ToString();
string end_str = properties.AfterProperties[end_internal].ToString();
string MeetingRoom_str = properties.AfterProperties[MeetingRoom_Internal].ToString();
//Construct a CAML query
SPQuery query = new SPQuery();
//Create the CAML query string that checks to see if the booking we are attemping
//to add will overlap any existing bookings
strQuery = string.Format(@"
<Where>
<And>
<Or>
<Or>
<And>
<Leq>
<FieldRef Name='EventDate' />
<Value Type='DateTime' IncludeTimeValue='TRUE'>{0}</Value>
</Leq>
<Gt>
<FieldRef Name='EndDate' />
<Value Type='DateTime' IncludeTimeValue='TRUE'>{0}</Value>
</Gt>
</And>
<And>
<Lt>
<FieldRef Name='EventDate' />
<Value Type='DateTime' IncludeTimeValue='TRUE'>{1}</Value>
</Lt>
<Geq>
<FieldRef Name='EndDate' />
<Value Type='DateTime' IncludeTimeValue='TRUE'>{1}</Value>
</Geq>
</And>
</Or>
<Or>
<And>
<Leq>
<FieldRef Name='EventDate' />
<Value Type='DateTime' IncludeTimeValue='TRUE'>{0}</Value>
</Leq>
<Geq>
<FieldRef Name='EndDate' />
<Value Type='DateTime' IncludeTimeValue='TRUE'>{1}</Value>
</Geq>
</And>
<And>
<Geq>
<FieldRef Name='EventDate' />
<Value Type='DateTime' IncludeTimeValue='TRUE'>{0}</Value>
</Geq>
<Leq>
<FieldRef Name='EndDate' />
<Value Type='DateTime' IncludeTimeValue='TRUE'>{1}</Value>
</Leq>
</And>
</Or>
</Or>
<Eq>
<FieldRef Name='Meeting_x0020_Room' />
<Value Type='Choice'>{2}</Value>
</Eq>
</And>
</Where>
<OrderBy>
<FieldRef Name='EventDate' />
</OrderBy>
", start_str, end_str, MeetingRoom_str);
//Set the query string for the SPQuery object
query.Query = strQuery;
//Execute the query against the Calendar List
SPListItemCollection existing_events = calendar.GetItems(query);
//Check to see if the query returned any overlapping bookings
if (existing_events.Count > 0)
//Cancels the ItemAdd action and redirects to error page
properties.Cancel = true;
//Edit the error message that will display on the error page
properties.ErrorMessage += "This booking cannot be made because of one or more bookings in conflict. <BR><BR>";
//Here you can loop through the results of the query
//foreach (SPListItem oListItem in existing_events)
properties.ErrorMessage += "Please go back and schedule a new time.";
catch (Exception ex)
//Cancels the ItemAdd action and redirects to error page
properties.Cancel = true;
//Edit the error message that will display on the error page
properties.ErrorMessage = "Error looking for booking conflicts: " + ex.Message;
/// <summary>
/// This event is triggered when the user edits an calendar item
/// </summary>
/// <param name="properties"></param>
public override void ItemUpdating(SPItemEventProperties properties) {
string strQuery = null;
try {
//Get the Sharepoint site instance
using (SPWeb oWebsite = new SPSite(properties.SiteId).OpenWeb(properties.RelativeWebUrl)) {
//Get the collection of properties for the Booking item
SPListItemCollection collItems = oWebsite.Lists[properties.ListTitle].Items;
//Get the Calendar List that we will be querying against
SPList calendar = oWebsite.Lists[properties.ListId];
//Get the internal name of the fields we are querying.
//These are required for the CAML query
string start_internal = collItems.List.Fields["Start Time"].InternalName;
string end_internal = collItems.List.Fields["End Time"].InternalName;
string MeetingRoom_Internal = collItems.List.Fields["Meeting Room"].InternalName;
string guid_internal = collItems.List.Fields["GUID"].InternalName;
//Get the query string parameters
string start_str = properties.AfterProperties[start_internal].ToString();
string end_str = properties.AfterProperties[end_internal].ToString();
string MeetingRoom_str = properties.AfterProperties[MeetingRoom_Internal].ToString();
string guid_str = properties.AfterProperties[guid_internal].ToString();
//Construct a CAML query
SPQuery query = new SPQuery();
//Create the CAML query string that checks to see if the booking we are attemping
//to change will overlap any existing bookings, OTHER THAN ITSELF
strQuery = string.Format(@"
<Where>
<And>
<And>
<Or>
<Or>
<And>
<Leq>
<FieldRef Name='EventDate' />
<Value Type='DateTime' IncludeTimeValue='TRUE'>{0}</Value>
</Leq>
<Gt>
<FieldRef Name='EndDate' />
<Value Type='DateTime' IncludeTimeValue='TRUE'>{0}</Value>
</Gt>
</And>
<And>
<Lt>
<FieldRef Name='EventDate' />
<Value Type='DateTime' IncludeTimeValue='TRUE'>{1}</Value>
</Lt>
<Geq>
<FieldRef Name='EndDate' />
<Value Type='DateTime' IncludeTimeValue='TRUE'>{1}</Value>
</Geq>
</And>
</Or>
<Or>
<And>
<Leq>
<FieldRef Name='EventDate' />
<Value Type='DateTime' IncludeTimeValue='TRUE'>{0}</Value>
</Leq>
<Geq>
<FieldRef Name='EndDate' />
<Value Type='DateTime' IncludeTimeValue='TRUE'>{1}</Value>
</Geq>
</And>
<And>
<Geq>
<FieldRef Name='EventDate' />
<Value Type='DateTime' IncludeTimeValue='TRUE'>{0}</Value>
</Geq>
<Leq>
<FieldRef Name='EndDate' />
<Value Type='DateTime' IncludeTimeValue='TRUE'>{1}</Value>
</Leq>
</And>
</Or>
</Or>
<Eq>
<FieldRef Name='Meeting_x0020_Room' />
<Value Type='Choice'>{2}</Value>
</Eq>
</And>
<Neq>
<FieldRef Name='GUID' />
<Value Type='GUID'>{3}</Value>
</Neq>
</And>
</Where>
<OrderBy>
<FieldRef Name='EventDate' />
</OrderBy>
", start_str, end_str, MeetingRoom_str, guid_str);
//Set the query string for the SPQuery object
query.Query = strQuery;
//Execute the query against the Calendar List
SPListItemCollection existing_events = calendar.GetItems(query);
//Check to see if the query returned any overlapping bookings
if (existing_events.Count > 0)
//Cancels the ItemAdd action and redirects to error page
properties.Cancel = true;
//Edit the error message that will display on the error page
properties.ErrorMessage += "This booking cannot be made because of one or more bookings in conflict. <BR><BR>";
//Here you can loop through the results of the query
//foreach (SPListItem oListItem in existing_events)
properties.ErrorMessage += "Please go back and schedule a new time.";
catch (Exception ex)
//Cancels the ItemAdd action and redirects to error page
properties.Cancel = true;
//Edit the error message that will display on the error page
properties.ErrorMessage = "Error looking for booking conflicts: " + ex.Message;Hi there,
Please verify the internal name of column which you have hardcoded in the code i.e
string start_internal = collItems.List.Fields["Start Time"].InternalName;
string end_internal = collItems.List.Fields["End Time"].InternalName;
I have used the Room reservation template from MSDN which has provided by MS under the code name of "Fantastic 40" along with below James Finn article.
http://www.codeproject.com/Articles/30983/SharePoint-Reservations
It worked for me for reservation. -
Unable to retrieve Personnel List items
Hi,
User needs to process payroll. In Time management for Time Entry it shows the following error instead of showing up EBB- approver.
Error message:
+*Unable to retrieve Personnel List items. Please try again later, or if the problem persists,
Unable to call BAPI: com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCExecuteException:
Error connecting using JCO client: Null in method CoCAT2 TimeSheet. ValidatePersonnelNumber.
.*+
Please Help on this !!Sounds like an ESS question. I suggest you ask in the ESS forum.
-
Filter SharePoint list items using CAML query as same as Like operator in SQL Server.
Hi ,
I have filtered SharePoint list items based on Name using CAML query <Contains> . Now I have a new requirement is to filter list items using Like operator in SQL. But Like operator is not in CAML.
How do I filter list items using CAML as same as Like operator in SQL.
Please let me know.
Thanks in Advance.Did you try using <Contains>?
http://social.technet.microsoft.com/Forums/sharepoint/en-US/15766fd5-50d5-4884-82a1-29a1d5e38610/caml-query-like-operator?forum=sharepointdevelopmentlegacy
--Cheers -
To display values in List Item through Dbms_SQL
Hi,
I want to write the dynamic sql in forms6.0 to built my query at runtime and display the result in List Item. I am getting an error ora-12703. If any person can help me in this problem it will be very happy for me.
declare
l_cursor integer;
l_last_name varchar2(20);
l_createstring1 varchar2(2000) ;
l_first_name varchar2(20) ;
l_id number(9);
result integer;
l_count number(2) := 0;
x varchar2(200);
y number(9);
begin
l_cursor := dbms_sql.open_cursor;
l_createstring1 := 'select id, first_name, last_name from candi_pinfo ' ;
dbms_sql.parse(l_cursor,l_createstring1, 2);
dbms_sql.define_column(l_cursor,1,l_id);
dbms_sql.define_column(l_cursor,2,l_last_name,20);
dbms_sql.define_column(l_cursor,3,l_first_name,20);
result := dbms_sql.execute(l_cursor);
loop
if dbms_sql.fetch_rows(l_cursor) = 0 then
exit;
end if;
dbms_sql.column_value(l_cursor,1,l_id);
dbms_sql.column_value(l_cursor,2,l_last_name);
dbms_sql.column_value(l_cursor,3,l_first_name);
l_count := l_count+1;
add_list_element('candi_id',l_count,l_id| |l_last_name| |l_first_name,l_id);
end loop;
dbms_sql.close_cursor(l_cursor);
:result.candi_id := get_list_element_value('candi_id',1);
exception
when others then
dbms_sql.close_cursor(l_cursor);
raise;
end;
nullHi reddy,
I didn't find any error in your code and I tested in my system by changing query.. and it is working fine.. check declaration of variables datatype ,length etc..
I tested following code ..
declare
l_cursor integer;
l_last_name varchar2(40);
l_createstring1 varchar2(2000) ;
l_first_name varchar2(200) ;
l_id number(9);
result integer;
l_count number(5) := 0;
x varchar2(200);
y number(9);
begin
--clear_list('lb');
l_cursor := dbms_sql.open_cursor;
l_createstring1 := 'select col1,col2 from mytable ' ;
dbms_sql.parse(l_cursor,l_createstring1, 2);
dbms_sql.define_column(l_cursor,1,l_id);
dbms_sql.define_column(l_cursor,2,l_last_name,40);
result := dbms_sql.execute(l_cursor);
loop
if dbms_sql.fetch_rows(l_cursor) > 0 then
dbms_sql.column_value(l_cursor,1,l_id);
dbms_sql.column_value(l_cursor,2,l_last_name);
--dbms_sql.column_value(l_cursor,3,l_first_name);
l_count := l_count+1;
add_list_element('candi_id',l_count,to_char(l_id)| |l_last_name,l_id);
else
exit;
end if;
end loop;
dbms_sql.close_cursor(l_cursor);
:result.candi_id := get_list_element_value('candi_id',1);
exception
when others then
dbms_sql.close_cursor(l_cursor);
end; -
Read MicroFeed List Items from Office 365/SP online site
Hi all:
We have got a publishing site with Site Feed feature enabled. We are using Site Feed web part and everything gets stored in MicroFeed list.
There is a requirement to read all the items in MicroFeed list using .Net CSOM and also identify the associated attachments. When I try to read items from the list, I can get only get the top level item with a funny guid. The guid relates to the guid of
the web part where users are posting their stuffs. That top level item stores all other posts as its children, which I really need to access. How can I do that ?
Thanks and regards,
D_MOK so I found out that you can read MicroFeed items using SocialFeed class. Here is the link :
http://msdn.microsoft.com/en-us/library/office/jj163237.aspx -
hi All,
I have a requirement for updating the contact list from CSV file and updating/ adding and deleting the changes in the SharePoint list using PowerShell script. List is also synced with outlook.
The problem arises, when we delete an item from the list using PS, the item (which was earlier synced with outlook) is not getting deleted from outlook.
Strange behavior : when we perform the same deletion operation manually from the SharePoint UI, every thing works fine as required.
Please refer the below PS
#Adding the records from SharePoint not in CSV file
if($flag -ne 1)
Get-Member -InputObject $csvRow -MemberType NoteProperty | ForEach-Object {
$property = $_.Name
$newItem.set_Item($property, $csvRow.$property)
$newItem.Update()
#Deleting the records from SharePoint not in CSV file
CreatePSLog "Deleting the records from SharePoint not in CSV file"
foreach($itm in $List.items)
$del = 0
$items | ForEach-Object {
if($itm["SAP Ansprechpartnernr"] -eq $_."SAP Ansprechpartnernr")
$del++;
if(!$del)
$List.GetItemById($itm.Id).Delete()
$List.Update();
$Web.Update();
many thanks in advance, Please suggest as I am completly stuck on this :(
Regards, Arun kumarHi Kumar,
Please remove the codeline $List.Update();, then run your code again, it works for me.
You may need to firstly delete the synced contacts list within Outlook to remove those undeleted accounts, then re-connect the SharePoint contacts list to outlook, then run your modified Powershell code.
Thanks
Daniel Yang
TechNet Community Support -
Read sharepoint list items and display it inside a div in aspx page
So I have this sample aspx page with this design:
<div class="column1">Events</div>
<div class="column2">Details</div>
<div class="column3">Contact</div>
Now, I want to dynamically change the words (Events, Details, COntacts) depending on the content of my "Columns" sp list.
how can I do this?
----------------------- Sharepoint NewbiePlace the label controls in the div tags like
<div class="column1">Eventslabel</div>
<div class="column2">Detailslabel</div>
<div class="column3">Contactlabel</div>
public void ReadList() {
// Use using to make sure resources are released properly
using(SPSite oSite = new SPSite(pathToSite)) {
using(SPWeb oWeb = oSite.AllWebs[nameOfWeb]) {
// Alternately you can use oSite.RootWeb if you want to access the main site
SPList oList = oWeb.Lists[listName]; // The display name, ie. "Calendar"
foreach(SPListItem oItem in oList.Items) {
// Access each item in the list...
//Bind the values to label
// etc.... -
SharePoint read/write list item to another DB/file
Hi All,
I am working on MOSS 2007. I have the following requirement.
There are around 50 document librararies on a site collection. I need to store all the items from these libraries in a locally (it could be DB/CSV or excel or access) and read/write them periodically for some calculations/comparisions.
Note: 1) the VM that I am working doesnt have MS Office installed to try for Access or Excel.
2) Is there a way to use access without needing to install MS Office.
Please let me know the best approach for the above task.
Any help is greatly appreciated.
Regards.Hi All,
Can any one help me with this..?
Thanks. -
We have a user who has a few hundred calendar items created in outlook. If you open the calendar item, the description includes tables with borders, shading, etc. It seems that the description field in Sharepoint calendars only support basic rich text,
so if I copy the items from the user's calendar to the sharepoint calendar, the formatting is lost. Is there any way to create a custom calendar with enhanced rich text for the description field?This is a workaround that is working for us. I created a new column "Event Description", selected "Plain Text" and then created a basic workflow that updated Description from Event Description. #160 is no longer showing.
Please be aware that the trick to this is that you must write everything in a string. In other words, don't use the Enter key.
In my case it was worth it as we couldn't rebuild and the user needed a valid and quick fix.
Cynthia Duke
Cynthia Duke -
How to read XSLT list item of a list view web part in SharePoint designer 2010 using jquery
Hi ,
I have a requirement to get data from one list(e.g., A) and display in some other list's(e.g.,B) custom display form(e.g., CustomDispForm.aspx).
Here I am going to do this with the help of Jquery SP Services using GetListItems(). For getting the data I need to pass two parameters from list(B), but the data is like <xsl:value-of select="@testField_"/> .
I have stuck how to pass such variables in Jquery function.
Please let me know how to achieve .
Thanks in Advance.Follow below code to pass variables to jQuery function in xslt. It will better to use parameters.
<xsl:variable name="varTestFields">
<xsl:value-of select="@TestField_"/>
</xsl:variable>
<!-- jQuery Function - Check the passing of parameters -->
jQueryFunction('{varTestFields}'
OR
<!-- jQuery Function - Check the passing of parameters -->
jQueryFunction('{@TestFields_}'
Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer :) -
Unable to read recordsets in oracle through VB6/ADO 2.0
Problem: Not able to access/read partiular field of any table(in Oracle) through vb6/ADO.
Note the "insert into" SQL statement is working and through SQL worksheet in Oracle 8.0 , version 1.5.0 (which I am using) I am able to read all the records but whenever I try to read it through the VB6 by the command - "recordset!field name" , the following error is generated.
Error:
Run time error:- 2147417848(80010108)
method 'xxxx' of object 'yyyy' failed
Environment:
Windows NT 4.0 Oracle 8, version 1.5.0
Visual Basic 6.0
ADO 2.0 object library
oracle ODBC driver version: 8.00.0400
I enclose below the lines of code.
Dim AccDb As New ADODB.Connection
Dim AccountGroup As New ADODB.Recordset
Dim AccountSetup As New ADODB.Recordset
Dim Mgrp As String
Global Const CntString = "DSN=DATAB;UID=INTERNAL;PWD=ORACLE;"
Mgrp = ""
AccDb.ConnectionString = CntString
AccDb.Open
AccountGroup.Open "Account_Group", AccDb, adOpenStatic, , adCmdTable
AccountSetup.Open "Account_Setup", AccDb, adOpenStatic, , adCmdTable
AccDb.BeginTrans
If Fld_AccGroup <> "" Then
StrCriteria = "Accid =" & Fld_AccGroup & ""
AccountGroup.Find StrCriteria
If Not AccountGroup.EOF Then
Grp = FillText(AccountGroup!Acc_Group) ' filltext is a user defined function
End If
Mgrp = Trim(Grp)
LGrp = Right$(Str$(1000 + Val(AccountSetup!Last_Grp)), 3)
Else
LGrp = Right$(Str$(1000 + Val(AccountSetup!Last_Grp)), 2)
End If
Grp = Trim(Grp) + LGrp
'Sql = "Execute sp_InsertAccountGroup '" & Grp & "','" & Fld_AccName & "','" & Fld_PlBl & "'"
Sql = "Execute sp_InsertAccountGroup "
AccDb.Execute (Sql)
AccDb.CommitTrans
AccountSetup.Close: Set AccountSetup = Nothing
AccountGroup.Close: Set AccountGroup = Nothing
AccDb.Close: Set AccDb = Nothing
Exit Sub
SaveErr:
AccDb.RollbackTrans
For Each Errloop In Errors
With Errloop
StrError = _
"Error #" & .Number & vbCr
StrError = StrError & _
" " & .Description & vbCr
StrError = StrError & _
" (Source: " & .Source & ")" & vbCr
End With
MsgBox StrError, vbCritical, MsgTtl
Next
AccDb.RollbackTrans
Resume Next
null<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Sandip Tusnial ([email protected]):
Problem: Not able to access/read partiular field of any table(in Oracle) through vb6/ADO.
Note the "insert into" SQL statement is working and through SQL worksheet in Oracle 8.0 , version 1.5.0 (which I am using) I am able to read all the records but whenever I try to read it through the VB6 by the command - "recordset!field name" , the following error is generated.
Error:
Run time error:- 2147417848(80010108)
method 'xxxx' of object 'yyyy' failed
Environment:
Windows NT 4.0 Oracle 8, version 1.5.0
Visual Basic 6.0
ADO 2.0 object library
oracle ODBC driver version: 8.00.0400
I enclose below the lines of code.
Dim AccDb As New ADODB.Connection
Dim AccountGroup As New ADODB.Recordset
Dim AccountSetup As New ADODB.Recordset
Dim Mgrp As String
Global Const CntString = "DSN=DATAB;UID=INTERNAL;PWD=ORACLE;"
Mgrp = ""
AccDb.ConnectionString = CntString
AccDb.Open
AccountGroup.Open "Account_Group", AccDb, adOpenStatic, , adCmdTable
AccountSetup.Open "Account_Setup", AccDb, adOpenStatic, , adCmdTable
AccDb.BeginTrans
If Fld_AccGroup <> "" Then
StrCriteria = "Accid =" & Fld_AccGroup & ""
AccountGroup.Find StrCriteria
If Not AccountGroup.EOF Then
Grp = FillText(AccountGroup!Acc_Group) ' filltext is a user defined function
End If
Mgrp = Trim(Grp)
LGrp = Right$(Str$(1000 + Val(AccountSetup!Last_Grp)), 3)
Else
LGrp = Right$(Str$(1000 + Val(AccountSetup!Last_Grp)), 2)
End If
Grp = Trim(Grp) + LGrp
'Sql = "Execute sp_InsertAccountGroup '" & Grp & "','" & Fld_AccName & "','" & Fld_PlBl & "'"
Sql = "Execute sp_InsertAccountGroup "
AccDb.Execute (Sql)
AccDb.CommitTrans
AccountSetup.Close: Set AccountSetup = Nothing
AccountGroup.Close: Set AccountGroup = Nothing
AccDb.Close: Set AccDb = Nothing
Exit Sub
SaveErr:
AccDb.RollbackTrans
For Each Errloop In Errors
With Errloop
StrError = _
"Error #" & .Number & vbCr
StrError = StrError & _
" " & .Description & vbCr
StrError = StrError & _
" (Source: " & .Source & ")" & vbCr
End With
MsgBox StrError, vbCritical, MsgTtl
Next
AccDb.RollbackTrans
Resume Next
<HR></BLOCKQUOTE>
null -
How to update a list item through Sharepoint Designer Workflow?
Hi,
I have a created a list, in which "Completion date" column is there.
Now I want to update column "Completion Date" through SPD, specifies value(date) after 10 days of created date of a record in list.
Please help.
Thanks in advanceHi,
You can use the "Build Dynamic String" action to convert the date field to a string,
And use string comparison to determine if the date is blank
For more information, please refer to
http://paulgalvin.spaces.live.com/blog/cns!1CC1EDB3DAA9B8AA!498.entry
Hope this helps
Thanks!
Stanfford -
How to send a list item value to URL to open data related to item value
Hi,
Iam using Apex4.0 and iam facing some problem. Iam unable to send selected list item value to the url specified in the HTMl region.
Here i want to open the data related to list item value in other page.
List item - :Familyp
i want to pass this selected value to the url and when ever user selected the list item and clicks on the url, then it should display the item value related data in new page.
I tried with &FamilyP in url but it's not working. Any one help me plz.
Regards
Vamsi.TataIs it a normal Select list or Multi Select list?
If you have select list that allows you to select multiple options then you cannot pass it through URL. Multi-select /Shuttle keep colon separated list in the item, and this confuses Apex because the Apex URL uses colons for a different purpose. No escaping or URL encoding will help.
If it is normal select list that allows selection of only one option then you can pass through the url. Unless of course the data has a colon in it.
For multi-select, and when the value contains colon, the only way is to save the value in session state, same page item or any other place like Application Item, and then reference it at the other end. Never pass through the URL.
Regards, -
Incorrect URL on Calendar List Event in Overlay View
Hello,
We're using Standalone SharePoint 2010 installation.
The agency I work for has a Clerical Staff calendar list. This is the principal calendar staff use so it has several other calendars overlaid in the list view.
One such calendar was Volunteer Schedule. Once this was no longer used I renamed the volulnteer calendar to payroll calendar and changed the URL in sharepoint designer 2010. This was successful, I can hit the payroll calendar and the URL is correct.
However, I'm having issues with the payroll calendar items. When you click on any Payroll Calendar Event in the Clerical Calendar overlay view, the URL for the payroll calendar item resolves to a completely different calendar list and throws
an "Item Does Not Exist" error.
I can still add, edit, and delete those items on the payroll calendar specifically, and new adds do show up in the overlay... it's only when you click the Title of that item in the Clerical calendar overlay does the error happen, it's almost as if the Calendar
list items have lost their connection to their parent calendar list.
Further investigation has brought no answers, I'd rather not delete and recreate the payroll calendar as it's densely populated.
Any thoughts or links will be much appreciated.
Thanks,
Brian H.Hi,
According to your post, my understanding is that you wanted to solve the issue about the Payroll Calendar Events when you clicked on any Payroll Calendar Event in the Clerical Calendar overlay view in SharePoint 2010.
I try to reproduce the issue, however, the result is the same as yours.
If you need to rename the Volulnteer Calendar to Payroll Calendar and change the URL in SharePoint designer 2010, I suggest that you can delete the previous Volulnteer Calendars Overlay and create a new one Payroll Calendars Overlay in the Clerical Calendar
list.
I recommend that you can follow the steps as below to implement it.
1. Open the Clerical Calendar list, go to the “Calendar Tools”, and click the “Calendars Overlay” under “Calendar”.
2. Click the previous Volulnteer Calendars Overlay, and click the “Delete” button to delete it.
3. Click “New Calendar”, type the Calendar Name, select the Color and click the “Resolve” button to get the latest information of the Calendar list in the Web URL.
4. Select the new Payroll Calendar list and click “OK” button.
Now, you can go back to the Clerical Calendar list and test the new Payroll Calendars Overlay in your environment.
In addition, you can rename the Volulnteer Calendar through the UI, then the URL will be changed automatically. And then you can click the Calendars Overlay directly.
To rename the Volulnteer Calendar through the UI, you can follow the steps as below:
1. Go to “List Settings” of the Volunteer Calendar, and click the “Title, description and navigation” under “General Settings”.
2. Change the name to “Payroll” and click “Save” button.
Then, you can see the new Payroll Calendar list on the Quick Launch.
For more information, you can refer to:
How
to Change the Url For a SharePoint 2010 List or Library
Changing
the URL of an existing document library or list
Best Regards,
Linda Li
Linda Li
TechNet Community Support
Maybe you are looking for
-
Wireless configuration for HP OfficeJet 6500A plus All-In-One printer on Ubuntu 10.04
I have bought a HP OfficeJet 6500A plus All-In-One printer CN557A, which I want to use with ubuntu 10.04 64-bit as a wireless network printer. Before i bought i checked compatibility on www.hplipopensource.org and www.openprinting.org, and all was in
-
Can't get QuickTime out of my dock
Hi all, I'm using 10.6.6. All of a sudden, QuickTime is in my dock, and all the usual methods won't get rid of it. Any ideas? Thanks.
-
Open dataset (UNICODE) for english en polish characters
Hi, I have a problem on my multi language project on where I need to manage English language and polish language. I have a table (that we can call TABLE) I manage the translation on it. When I am connected in English I can see some squares instead so
-
HELP iPod touch 3rd Yellow screen of the death!
i have iPod touch 3rd.... i never use it about 2 month.. and i charge it, the screen is yellow when i plug it to itunes.. the screen turn to apple logo... and i wait for a minutes... and it turn off.... when i press the sleep/wake button .. is turn y
-
Adjust color setting HP CP1025 on a macintosh running Yosemite
Hi, Is it possible to adjust the color setting in the settings of my printer runnng in Yosemite (Latest OSX). The colors of my prints are overall to dark.. I want to adjust the gamma. Best regards, Thijs Boeree