Access form ressources from code in VS 2015 (VB.NET) - vb.net

Good morning,
Context:
I have a localized VB.NET form, called Menu.vb
The localization is activated, so I have multiple ressource files attached, Menu.resx, Menu.fr-FR.resx...
I have added a custom string to those ressources files, and I would like to display this string in a MsgBox, depending on the culture selected.
Problem:
I can't access the form ressource from within the form code.
Could you please help me with this?
Thanks a lot,
Maxime

Use System.ComponentModel.ComponentResourceManager to access the form resources:
// inside the form code - 'this' represents the Form instance
Dim resources As ComponentResourceManager = New ComponentResourceManager(this.GetType())
// get the string you want
resources.GetString("nameOfTheStringResource")
// optionally you can access the same with specific culture
resources.GetString("nameOfTheStringResource", new CultureInfo("en-US"))

Related

How to store the contains of a dijit editor containing image and text in a database?

I am trying to make an input field which accepts text and image with copy/paste feature. I am looking for a way to save the contains of this field and then retrieve and display the same in non-editable field.
Can this be done with dijit.editor?
I appreciate any tip on this. Thank you.
You will need more than just digit.Editor.
You will need at least something like:
digit/Editor for the writable UI
div for the readonly UI
dojo/request for sending Editor value to backend and for getting saved value from the DB
A server able to handle non static pages (like Apache + php)
A database (like mysql)
A backend API to save and read from the database

SharePoint: SPField.FieldRenderingControl does not render if the list is from another site

I have a custom New/Edit form that renders the edit controls using the FieldRendering control property of the fields. When the list and form are at the first level subsite (RootSite/SubSite1) of a SharePoint site collection. It works just fine.
When I try to use the same code to render the form in another first level subsite (RootSite/SubSite2) of the site collection, a sibling of the first site, the edit controls do not render. I have the code in (RootSite/Subsite2) and the list is still in (RootSite/SubSite1). I got a hint that RootFolder parameter might help but that did not work out. Any Ideas?
Thanks
I this case you can open the root site as follows:
using (SPSite oSPsite = new SPSite(SPContext.Current.Site.RootWeb.Url))
{
using (SPWeb oSPWeb = oSPsite.OpenWeb())
{

Webform within Access Form

I am trying to incorporate a html menu within access form. How would I get the feedback (on what the user selected within the web page) from the webpage into Access. I am using Access 2007, MS WebBrowser component.
any help would be appreciated
There is no official way to call the hosting form or initiate any activity on Access from within the WebBrowser.
However, there is one nifty trick which I use. After the document is loaded you can setAttribute of some element to the Access form. htmlDoc.all.formDiv.setAttribute "outerForm", Me
Then you can reference properties and methods of the form from within the WebBrowser.
document.all.formDiv.outerForm.Application.DoCmd.Close(2,"webForm")
EDIT:
Oddly, it seems that the reference remains null when as I add the <META http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'> tag. Seemingly, the properties are more strict now, and setAttribute is expecting a string.
The next option is to pass the Access Form ('Me') to a variable in the WebBrowser. However it doesn't look like the global variables or functions are directly exposed.
This, though, can easily be overcome by adding a function to the prototype of HTMLBodyElement which passes its argument to a global variable, and can return any class as well.
In the html page you'd have this:
var frm = null;
HTMLBodyElement.prototype.setForm = function(f){frm = f}
From Access simply pass the reference down: htmlDoc.document.body.setForm(Me).

Extend Page Property with custom controls in Sharepoint

Sharepoint is quite limited when it comes to multi-Lookups because it saves that information in strings. So I changed the Page-Property
"Elements (MultiLookup-> elementIds" on the propertyPage
to an inserted List "PageElements":
"
(SingleLookup)pageId , (singleLookup) elementId"
Because this is quite hard to maintain for my content admins I want that they can enter that information in the page properties like before instead of adding lines into "PageElements"
Therefore I want to add a control that handles that.
I do not need a solution for the task how to achieve that specific function, but a general hint how to add any custom control into a Page property.
I starting point link would be very nice. I just doen't seem to find the right words to feed google with my topic.
Solved this by using a custom field type with that logic. Basicly Described here: http://avinashkt.blogspot.de/2011/07/creating-custom-field-in-sharepoint.html

Adding a custom field type to SugarCRM?

I'm trying to add a custom field type to our SugarCRM 6.2 instance. I want to add an "email link" type field. I want it to function like the URL field, but prefix every address with "mailto://" prefix instead of "http://".
It will be good if that field type is available in studio while creating new fields or in minimum, some custom code to achieve it.
What I did up to now:
- I've copied include/SugarFields/Fields/URL to include/SugarFields/Fields/Email
- In modules/ModuleBuilder/language/en_us.lang.php I've added a title for the email field
But unable to get anything working. Any help?
First of all you do not want to make any coding changes outside of the custom directory. Doing so outside of this directory is not upgrade safe.
Create a custom fields directory in your custom folder
Create new template files (.tpl) for your custom field
then you can just add a regular textfield in studio
then edit your viewdefs in your custom directory
in your tpl file concatenate the mailto:// to your text and just add the persons email address and it will take care of the rest for you
why you need custom field type for such small functionality? Just add your custom JS file in editviewdef.php. Then use some jQuery selector to perform certain action. For detail view, you can use view.detail.php to add required text in run time.
This will help you to store less data in database and display more in frontend.