Access 2010 Web Database - Update textbox value from local variable? - sharepoint

How do I change a textbox value to the one I have in a local variable?
I have expression builder and macros - but not the VBA macros as there seems to be no way of having VBA macros on access web forms.

You can use a macro to set the value of a control on a web form to a local variable.
Here is a basic example (Access 2010 macros are written in XML). There are two code blocks - one that sets the local variable, and one that sets the value of the text box.
<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<UserInterfaceMacros xmlns="http://schemas.microsoft.com/office/accessservices/2009/11/application">
<UserInterfaceMacro For="cmdSetTxt2LocVar" Event="OnClick">
<Statements>
<Action Name="SetLocalVar">
<Argument Name="Name">LocVar</Argument>
<Argument Name="Expression">'foo'</Argument>
</Action>
</Statements>
</UserInterfaceMacro>
</UserInterfaceMacros>
And:
<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<UserInterfaceMacros xmlns="http://schemas.microsoft.com/office/accessservices/2009/11/application">
<UserInterfaceMacro For="cmdSetTxt2LocVar" Event="OnClick">
<Statements>
<Action Name="SetProperty">
<Argument Name="ControlName">test</Argument>
<Argument Name="Property">Value</Argument>
<Argument Name="Value">LocVar</Argument>
</Action>
</Statements>
</UserInterfaceMacro>
</UserInterfaceMacros>
For a basic overview of UI macros, watch this video: http://office.microsoft.com/en-us/access-help/video-create-a-user-interface-ui-macro-VA101814109.aspx
For more information about SetProperty, see http://msdn.microsoft.com/en-us/library/ff194340.aspx

Related

Programmatically change widget title in IBM Connections

I'am trying to programmatically change a widget title in Connections. I use the following REST end-point:
/communities/service/atom/community/widgets?communityUuid=xyz&widgetInstanceId=xyz
Using the following PUT:
<?xml version="1.0" encoding="UTF-8"?><entry xmlns="http://www.w3.org/2005/Atom" xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
<title type="text">Bestandjes</title>
<category scheme="http://www.ibm.com/xmlns/prod/sn/type" term="widget">
</category>
<snx:widgetDefId>Files</snx:widgetDefId>
<snx:widgetInstanceId>Wfa656aa9103e_41d2_a7fc_44e84d642aa4</snx:widgetInstanceId>
<snx:hidden>false</snx:hidden>
<snx:location>col2</snx:location>
</entry>
With the WidgetInstanceId and communityID as a parameter. After the PUT is being executed, no error did occur but the title stays the same. Any suggestions?
You should be able to get this working by adding the following:
<snx:customTitle>TestChangeBookmarks</snx:customTitle>
i.e.
<?xml version="1.0" encoding="UTF-8"?><entry xmlns="http://www.w3.org/2005/Atom" xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
<title type="text">Bookmarks</title>
<category scheme="http://www.ibm.com/xmlns/prod/sn/type" term="widget">
</category>
<snx:customTitle>TestChangeBookmarks</snx:customTitle>
<snx:widgetInstanceId>W127627423458_49a0_bba1_af9bbf24d395</snx:widgetInstanceId>
<snx:hidden>false</snx:hidden>
<snx:location>col2</snx:location>
</entry>
*Note the element should contain the current title of the widget before making changes.
*Note is ignored for PUT request, therefore it is not needed.
More information on the widget entry elements can be found here:
https://www-10.lotus.com/ldd/lcwiki.nsf/xpAPIViewer.xsp?lookupName=IBM+Connections+5.0+API+Documentation#action=openDocument&res_title=Working_with_community_widgets_ic50&content=apicontent
Updated Community Widget Title

Sharepoint 2k7 - Custom WebPart not loading

First off i am a big fat NOOB in regards to Sharepoint 2007 webpart development but i am working at it.
Now for the real problem, so i develop this webpart and follow the 'Loose' advise from various sites on how to setup the features.xml, .xml, manifest.xml, solution.ddf and solution.build files. Basically, i have a all-in-one solution where i build the webpart and then in post-build event compile all the source files into the WSP deployment package.
Problem i am having is that I can add the solution to the sharepoint site but when i go to Deploy it through CA-Operations-Solution management i get this great error:
Error as reported from Sharepoint
Failed to instantiate file "ChartPartWP.webpart" from module "ChartPartWP": Source path "ChartPartWP\ChartPartWP.webpart" not found.
When i looked at the file-system the folder ChartPart is present in TEMPLATE\FEATURES with the ChartPartWP.webpart and other support files.
What is not happening that i need to resolve.
Edit: 10/24/2011 # 11:36PM
Solution.ddf
.OPTION EXPLICIT
.Set CabinetNameTemplate=ChartPartWP.wsp
.Set DiskDirectoryTemplate=CDROM
.Set DiskDirectory1=Package
.Set CompressionType=MSZIP
.Set UniqueFiles="ON"
.Set Cabinet=On
.Set SourceDir="\\<fileserver>\common share\Software_Development\MPT\Sharepoint2007\ChartPart\"
Manifest.xml manifest.xml
; binary
bin\release\TCBOE.ChartPart.dll TCBOE.ChartPart.dll
; feature files
TEMPLATE\FEATURES\ChartPartWP\ChartPartWP.xml ChartPartWP\ChartPartWP.xml
TEMPLATE\FEATURES\ChartPartWP\feature.xml ChartPartWP\Feature.xml
; web part files
TEMPLATE\FEATURES\ChartPartWP\ChartPartWP.webpart ChartPartWP\ChartPartWP.webpart
TEMPLATE\FEATURES\ChartPartWP\LockedChartPartWP.webpart ChartPartWP\LockedChartPartWP.webpart
manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<Solution xmlns="http://schemas.microsoft.com/sharepoint/"
SolutionId="{0C32EA7F-78C2-4814-A4C9-88256E49E371}">
<FeatureManifests>
<FeatureManifest Location="ChartPartWP\feature.xml" />
</FeatureManifests>
<Assemblies>
<Assembly Location="TCBOE.ChartPart.dll"
DeploymentTarget="GlobalAssemblyCache" />
</Assemblies>
</Solution>
ChartPartWP.xml
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="ChartPartWP"
List="113" Url="_catalogs/wp"
Path="ChartPartWP"
RootWebOnly="True">
<File Url="ChartPartWP.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="ChartParts" />
</File>
<File Url="LockedChartPartWP.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="ChartParts" />
</File>
</Module>
</Elements>
feature.xml
<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/"
Id="47D62F5E-B0E0-4f93-BCD1-081CA794527C" Version="3.5.1.0"
Title="TCBOE ChartPart"
Description="Provides a Chart Web object to be used in Sharepoint 2007."
AutoActivateInCentralAdmin="TRUE"
Scope="Site">
<ElementManifests>
<ElementManifest Location="ChartPartWP.xml" />
<ElementFile Location="ChartPartWP.webpart" />
<ElementFile Location="LockedChartPartWP.webpart"/>
</ElementManifests>
</Feature>
Would there be any receivers/handlers i need make are implemented for the installation to take hold? I didnt read anything about it but read something about a FeatureReceiver for a purpose, but cant remember for the life-of-it, why you need the FeatureReceiver (SPFeatureReceiver)
SPFeatureDefinition.AutoActivateInCentralAdmin Property
Gets a value that specifies whether the Feature is activated on the central administrative Web site, site collection, or Web application upon installation.
Without testing your entire samples, using this property sounds off to me. Try removing that.
update: you should post your .webpart also (it is a xml).
Try these configs: Feature.xml
<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/" Id="47D62F5E-B0E0-4f93-BCD1-081CA794527C" Version="3.5.1.0" Title="TCBOE ChartPart" Description="Provides a Chart Web object to be used in Sharepoint 2007." Scope="Site">
<ElementManifests>
<ElementManifest Location="ChartPartWP\ChartPartWP.xml" />
<ElementFile Location="ChartPartWP\ChartPartWP.webpart" />
<ElementFile Location="ChartPartWP\LockedChartPartWP.webpart"/>
</ElementManifests>
</Feature>
webpart.xml
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="ChartPartWP" List="113" Url="_catalogs/wp">
<File Path="ChartPartWP.webpart" Url="ChartPartWP.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="ChartParts" />
</File>
<File Path="ChartPartWP.webpart" Url="LockedChartPartWP.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="ChartParts" />
</File>
</Module>
</Elements>
If nothing works, I would recommend installing and using the VSeWSS 1.3 from Microsoft, create a new webpart, hit F5, test it. If you can see it in the "Add Web Parts" dialog, move your files over. This is the closest you will get to the SharePoint 2010 experience (which is terribly improved).
Having to fiddle with these files, even more to a beginner, should not be your burden.

ContentType DocumentTemplate not found in a List

I have the following Feature:
<?xml version="1.0" encoding="utf-8"?>
<Feature Id="9A3C5D02-A2EB-4725-97F7-CDA6DE319F1B"
Title="My Custom Types"
Scope="Site"
DefaultResourceFile="core"
Hidden="TRUE"
xmlns="http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location="Elements.xml" />
<ElementFile Location="templates/MeetingMinutes.docx" />
</ElementManifests>
</Feature>
Which contains the following Elements.xml:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="Templates" Url="_cts/Meeting Minutes" Path="templates" RootWebOnly="TRUE">
<File Url="MeetingMinutes.docx" Type="Ghostable" />
</Module>
<ContentType
ID="0x01010066DD088A6B8B46BCA775CCD119FBB3E8"
Name="Meeting Minutes"
Group="Custom Content Types"
Version="0">
<FieldRefs />
<DocumentTemplate TargetName="MeetingMinutes.docx"/>
</ContentType>
</Elements>
I then use this ContentType within a custom List Template:
<ContentTypes>
<ContentTypeRef ID="0x0101">
<Folder TargetName="Forms/Document" />
</ContentTypeRef>
<ContentTypeRef ID="0x01010066DD088A6B8B46BCA775CCD119FBB3E8">
<Folder TargetName="Forms/Document" />
</ContentTypeRef>
<ContentTypeRef ID="0x0120" />
</ContentTypes>
I deploy the solution, activate the feature, and create an instance of the List Template. I go into the library and select Settings > Document Library Settings > Content Types: Meeting Minutes > Parent: Meeting Minutes > Advanced settings. I'm now in the Advance Settings of the Site Content Type. The URL of the existing document template is MeetingMinutes.docx and there is an (Edit Template) link which points to http://myserver/sites/testsite/_cts/Meeting%20Minutes/MeetingMinutes.docx. Everything's shiny.
But, I hit the back button two times so I'm back in the settings of the List Content Type. This time when I click Advance settings, the URL of the existing document template is still MeetingMinutes.docx, but there is no (Edit Template) link. Troubling.
Pressing on, I go back to AllItems.aspx and click New > Meeting Minutes. As Word is loading, I see a little Opening dialog which says, Opening: http://myserver/sites/testsite/Shared%20Documents/Forms/Document/MeetingMinutes.docx, to which Word responds: "Word was unable to read this document. It may be corrupt."
So the Document Template works correctly in the Site Content Type (where it does me no good), but is not working in the List Content Type (where I really need it). Now, I know I could put this in _layouts, but from what I've read, _cts is the way to do it. What am I doing wrong?
Rich, I'm not exactly sure what's going on because I created a feature using your feature and elements files as you specified and it works correctly for me.
There is one difference though.
When I create a new document in the library from the content type, the template url is
http://myserver/sites/testsite/Shared%20Documents/Forms/Meeting Minutes/MeetingMinutes.docx
Not
http://myserver/sites/testsite/Shared%20Documents/Forms/Document/MeetingMinutes.docx
Somehow your content type seems to be looking in the wrong folder for the template. I hope that gives you some clues.
I had the same exact problem with document template for List Content Type.
What I did is just what SharePoint do when you create your library from web site : duplicate the document template inside the “Forms” folder of the library in a subfolder that have the same name than the content type.
You just need to add a module element somewhere in your project :
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="MeetingMinutesListInstanceTemplate" Url="Shared Documents/Meeting Minutes" Path="templates" RootWebOnly="TRUE">
<File Url="MeetingMinutes.docx" Type="Ghostable" />
</Module>
</Elements>
It worked for me.

Own DataFormWebPart: Unable to display this Web Part

Unable to display this Web Part. To troubleshoot the problem, open this
Web page in a Microsoft SharePoint Foundation-compatible HTML editor
such as Microsoft SharePoint Designer. If the problem persists, contact
your Web server administrator.
The webpart is in PageLayout, inserted without webpartzone:
<MyWebParts:MyCustomWebPart runat="server" Description=""
ListDisplayName="" PartOrder="2" HelpLink="" AllowRemove="True"
IsVisible="True" AllowHide="True" UseSQLDataSourcePaging="True"
ExportControlledProperties="True" DataSourceID="" Title="" ViewFlag="0"
NoDefaultStyle="TRUE" AllowConnect="True" FrameState="Normal"
PageSize="10" PartImageLarge="" AsyncRefresh="True" ExportMode="All"
Dir="Default" DetailLink="" ShowWithSampleData="False" FrameType="None"
PartImageSmall="" IsIncluded="True" SuppressWebPartChrome="False"
AllowEdit="True" ManualRefresh="False" ChromeType="None"
AutoRefresh="False" AutoRefreshInterval="60" AllowMinimize="True"
ViewContentTypeId="" InitialAsyncDataFetch="False"
MissingAssembly="Cannot import this Web Part." HelpMode="Modeless"
ListUrl="" ID="g_c2180fb9_c667_42f3_aab3_c3340cb0ac5a"
ConnectionID="00000000-0000-0000-0000-000000000000"
AllowZoneChange="True" IsIncludedFilter=""
__MarkupType="vsattributemarkup"
__WebPartId="{C2233FB9-C667-42F3-AAB3-C334223C5A}"
__AllowXSLTEditing="true" WebPart="true" Height="" Width="">
<Xsl>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<xmp>
<xsl:copy-of select="*"/>
</xmp>
</xsl:template>
</xsl:stylesheet>
</Xsl>
<DataSources>
<SharePoint:SPDataSource runat="server" DataSourceMode="List"
SelectCommand="<View></View>" UpdateCommand=""
InsertCommand="" DeleteCommand="" UseInternalName="True"
ID="spdatasource3">
<SelectParameters>
<asp:Parameter DefaultValue="0"
Name="StartRowIndex"></asp:Parameter><asp:Parameter DefaultValue="0"
Name="nextpagedata">
</asp:Parameter><asp:Parameter DefaultValue="10"
Name="MaximumRows"></asp:Parameter>
</SelectParameters>
</SharePoint:SPDataSource>
</DataSources>
</MyWebParts:MyCustomWebPart>
I will give you 3 suggestions:
Implement error handling. At least by encapsulate you code in a try/catch block. Output the error to something like a Literal object in your web part.
Attach your Visual Studio debugger to the IIS process. Set a breakpoint in your constructor or load method and step through your code from there.
Look in the WSS log files to see if it says something of interest.
The problem was missing resourceId and secondly i disabled cache-ing on xmlDataSource variable because it showed always the same results but queries were different
Now problem is paging - in MyWebParts:MyCustomWebPart you see PageSize, I set it to 1 but I see 5 items on my list - whats wrong? Is my XMLDataSource wrong somehow?
Moreover - is it possible to convert what is written above (MyWebParts:MyCustomWebPart) to .webpart file so that it could be reusable on othere pageLayouts .. ?
I have noticed that you have the PageSize set to 10 in the initial MyWebParts:MyCustomWebPart and in the SharePoint:SPDataSource you have an entry
<asp:Parameter DefaultValue="10" Name="MaximumRows"/>
Try setting the SPDataSource value to 1.
Jonathan

SharePoint : Feature basics

I have this feature
<?xml version="1.0" encoding="utf-8"?>
<Feature Id="c54f20d8-1ad1-49b8-aff7-2c874dd2f45a"
Title="MyCompany Content Types"
Description="Content Types required for MyCompany Provided Applications and Functionality"
Version="12.0.0.0"
Hidden="FALSE"
Scope="Site"
DefaultResourceFile="core"
xmlns="http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location="siteColumns.xml"/>
</ElementManifests>
</Feature>
Here is the contents of siteColumns.xml
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Field
ID="{1F343F02-22D9-45b8-A2A8-CEB2619A28C4}"
Name="AllowSubstDelivery"
DisplayName="AllowSubstDelivery"
Type="Boolean"
Format="TRUE"
Group="MyCustomGroup"
/>
</Elements>
The feature installs and activates, without producing an error, but the siteColumn is nowhere to be found, any ideas why this site column is not visible?
I checked the logs, no errors reported either.
Hmmm... it looks like you have done everything correctly. Did you copy and paste the ID for the Field from anywhere? If so, the ID may already be in use causing your Field provision to be ignored.
I find the best way to create a Feature defining Site Columns and Content Types is to prototype everything using the Web interface and then copy and paste the generated CAML into your Visual Studio projects. I recorded a short video demonstrating the process that you may find valuable.
SharePoint Site Columns and Content Types via a Feature
What does Format="TRUE" mean?
Doesn't look like it's according to documentation.
Field Element Documentation doesn't tell you much about those properties, however there is much in common with FieldRef element and it has documentation about Format attribute.
Maybe you wanted to use DefaultValue attribute?

Resources