sexta-feira, 6 de maio de 2016

Sharepoint 2013 Dropdown list populated from another sharepoint list

This is my solution to dynamically fill a filter dropdown list based on another sharepoint list field

1- Define a folder to place javascript files. I used the following path:
"~sitecollection/_catalogs/masterpage/Display Templates/"

2- Upload the following files to the location you defined on step 1. Use the import files button on your sharepoint designer.



File 1: the jquery library.
File 2: the jquery SP Service library. 
File 3: The custom code for the dropdown list

3 - Use the designer to edit the default list form for New Item (in this case nx.aspx)

4 - Add the following references to forms design. 

<SharePoint:ScriptLink ID="jquery" runat="server" LoadAfterUI="True" Name="~sitecollection/_catalogs/masterpage/Display Templates/jquery-1.12.3.js"/>

<SharePoint:ScriptLink ID="spservices" runat="server" LoadAfterUI="True" Name="~sitecollection/_catalogs/masterpage/Display Templates/jquery.SPServices-2014.02.js"/>
 

<SharePoint:ScriptLink ID="trsp" runat="server" LoadAfterUI="True" Name="~sitecollection/_catalogs/masterpage/Display Templates/CostumDropdown.js"/>

Note that you should update the path if you uploaded the scripts into a different path.


 A good place for you to drop this lines of code is before the form table. Search for <Sharepoint:FormField and FieldName=the first field of your form. Paste the lines before the first <tr> as shown above.

5 - Identify the html element id of the field you wish to apply your dropdown list



6 - Using the Sharepoint designer Edit the custom javascript (file 3 uploaded on step 2).

$(document).ready(function(){
    add_dropdown("lista1", "ctl00_ctl26_g_928acec0_5b91_4790_a300_9119e1116afe_ff21_ctl00_ctl00_TextField","http://w2012sharep/sites/ETN/Contactos/","Contactos",  "Company" );
});


You only need to update the entry parameters for add_dropdown function:
1 - Name of the list (must be different for each dropdown)
2 - Element id you have reached in step 5.
3 - URL where the source of your dropdown list is.
4 - Name of the sharepoint list
5 - Name of the field on the source list


To add a new dropdown just copy the call for the function
$(document).ready(function(){
    add_dropdown("lista1", "ctl00_ctl26_g_928acec0_5b91_4790_a300_9119e1116afe_ff21_ctl00_ctl00_TextField","http://w2012sharep/sites/ETN/Contactos/","Contactos",  "Company" );


    add_dropdown("lista2", "ctl00_ctl26_g_928acec0_5b91_4790_a300_9119e1116afe_ff21_ctl00_ctl00_TextField","http://w2012sharep/sites/ETN/Contactos/","Contactos",  "Phone" );

});



And your set to go.



















quinta-feira, 28 de abril de 2016

Sharepoint - Set current user to a form field as a default value

This is my solution to set the current user as a default value of a Sharepoint 2013 form field.

1- Define a folder to place javascript files. I used the following path:
"~sitecollection/_catalogs/masterpage/Display Templates/"

2- Upload the following files to the location you defined on step 1. Use the import files button on your sharepoint designer.



File 1: the jquery library.
File 2: the jquery SP Service library.
File 3: the custom javascript for the field you want to update.


Edit the file 3 in sharepoint designer after import (or in another editor before import) and replace 'Req' by the name of your field name in the list:
var fieldName = 'Req';

3 - Use the designer to edit the default list form for New Item (in this case nx.aspx)

4 - Add the following references to forms design. 

<SharePoint:ScriptLink ID="jquery" runat="server" LoadAfterUI="True" Name="~sitecollection/_catalogs/masterpage/Display Templates/jquery-1.12.3.js"/>

<SharePoint:ScriptLink ID="spservices" runat="server" LoadAfterUI="True" Name="~sitecollection/_catalogs/masterpage/Display Templates/jquery.SPServices-2014.02.js"/>
 

<SharePoint:ScriptLink ID="trsp" runat="server" LoadAfterUI="True" Name="~sitecollection/_catalogs/masterpage/Display Templates/trsp.js"/>

Note that you shloud update the path if you uploaded the scripts into a different path.


 A good place for you to drop this lines of code is before the form table. Search for <Sharepoint:FormField and FieldName=the first field of your form. Paste the lines before the first <tr> as shown above.


5 - Disable minimum download strategy

If you try to run your form you will experience that the code works just sometimes and not every time. You should disable minimum download strategy feature. To do this go to site settings, manage site features and disable it.


And we are done!
Here is my sample on field "Req"


quarta-feira, 13 de abril de 2016

Magento 2.0 csv file Translation Portuguese / Tradução para Português do Magento 2.0

For the translation of Magento to Portuguese please download the file below and place it in:

Para a tradução para Português do Magento 2.0 faça download do ficheiro abaixo e coloque em:

/opt/bitnami/apps/magento/htdocs/app/design/frontend/Magento/luma/i18n



quinta-feira, 21 de agosto de 2014

Lubuntu view Trash on Desktop

Trash Can is by default hidden on Lubuntu.

To activate the trash on the desktop click on your Start Menu and on Preferences Select "Desktop Preferences". Then click on Tab "Desktop Items" and activate the option Show "Trash Can" folder on the desktop.





segunda-feira, 18 de agosto de 2014

Lubuntu - Easy set up a system

After installing Lubuntu you will need some standard apps to start working.
You can easily setup some standard applications by using simple command line language.
Click on the start menu and roll over system tools and choose UXTerm.

The syntax to install software is then following
sudo apt-get install <application>

A simple example how to install skype is this simple command line
sudo apt-get install skype 
(You can select the above line and copy. To paste into the the UXTerm press the mouse-wheel to paste)
Assuming that your password is not blank, you will be prompted at least once for your sudo/administrator password.

Here is a quick list of some useful applications to start working with Lubuntu
sudo apt-get install apache-openoffice - will install openoffice applications suite
sudo apt-get install skype - will install popular skype for instant messaging and video calls
sudo apt-get install chrome-browser - will install Google Chrome Browser
sudo apt-get install gimp - will install freeware gimp for image handling.

Please help me complete this list. Make a suggestion for the missing apps in the comments.
Thanks.




terça-feira, 3 de dezembro de 2013

Windows Profile (User Settings) Failure

Problem Environment: General Windows

Sometimes if the a crash happens on your windows your profile get's damaged.
You desktop files and all settings are missing and you appear to be in a totally new profile.

Most cases I experienced can be solved simply.

Here is my solution:

  1. Open My Computer
  2. On your system installation (usually C:) right click and select properties.
  3. Click on Tools Tab
  4. Click on error checking button
  5. Select option Automatically fix file system errors
  6. You will be prompted to run this maintenance at next reboot. Click ok
  7. Reboot
The reboot will fix file and disk errors. After this your profile should be again usable.

 

quinta-feira, 17 de outubro de 2013

Disable cache for file/table in Infor Lawson M3

Problem Environment: Infor Lawson M3 Java 

In Infor Lawson M3 Java uses cache. This is great to improve performance but may cause some issues. There are several reasons for you to want to disable cache on a file/table. For instance a service that updates data from an outside environment. Of course Infor Lawson does not subscribe some methods. This is understandable because external interference can cause great damage. But if you know what to do and need to disable cache here is how to do it:


  1. Open a file in you environment folder \env\[environment]\properties\mvx\res\Transaction.properties with notepad.
  2. You should find a line with this "transaction.cache.readonly.count=5". Increase this number by adding the number of tables you want to disable cache.
  3. Next on the file you should find "transaction.cache.readonly.4=-DDOCUX". Add one entry for each file you want to disable. Don't forget to increase the number as in ".4" for each file.
  4. Save the changes.
  5. Shutdown environment.
  6. Start environment.