Tuesday, October 25, 2016

Nintex Forms o365 - Redirect to another page on saving

As Nintex forms on o365 does not have the option to set the URL to the page you want to go to after saving your item, there is a work around for that, in the below code I am changing the source parameter in the url to the new page which is the edit form in my case.


var newSrc = hostWebUrl + '/Lists/MyList/DispForm.aspx?ID=' + listItemId;
var newUrl = document.URL.replace(/(source=).*?(&)/gi,'$1' + newSrc + '$2');
window.history.pushState({path:newUrl},'',newUrl);

I hope it help somebody.

Friday, October 14, 2016

Nintex Workflow o365 – Error assigning a task to SharePoint Group

I have received this error on assigning a task to a SharePoint group:

Activity in progress
Retrying last request. Next attempt scheduled after 10/14/2016 11:25 AM. Details of last request: HTTP Unauthorized to https://blablabla.sharepoint.com/sites/Test/_api/sp.utilities.utility.SendEmail Correlation Id: 1a1a1a1a- abcd-efgh-ijkl-3c3c3c3c3c3c Instance Id: 2b2b2b2b-abcd-efgh-ijkl-4d4d4d4d4d4d
Access denied. You do not have permission to perform this action or access this resource.


Then I discovered that in order to make it working I need to add my account to the group or to change its settings “Who can view the membership of the group?” to “Everyone”.

Another solution I believe is to grant full control permission to the workflow as shown here: https://community.nintex.com/community/build-your-own/nintex-for-office-365/blog/2015/05/14/o365-call-http-web-service-failed-unauthorized-access-denied

Sunday, June 05, 2016

Just passed Nintex Workflow Pro Exam!

I just checked https://learning.nintex.com site, created a free account and passed the pro exam.


And the Admin exam:



Sunday, October 18, 2015

Store the SharePoint filtered values

In case you have a view for your list and users use this view and filter its values and want to keep this filter saved without creating a personal view, you can create a JavaScript file with this content:


 








Then reference this JavaScript file from any page where you have your view. It is simply listen to the “onhashchange” and save the value after the “#” in the localStorage and retrieve it on next page load. The URL of the page after you change the filter looks like this: “/Lists/TestList/AllItems.aspx#InplviewHash6c224f7d-adc4-430c-8501-312cabe57c26=FilterField1%3DLinkTitle-FilterValue1%3DTest%2520Item” and the hash value is everything after the “#”

Saturday, October 17, 2015

Nintex Repeating Section – JSLink

This blog post is building on top other posts by me and my friend Ayman El-Hattab, where in my post (Published April 9, 2015) I talked about creating master details records with repeating section in Nintex forms and Nintex Workflow, and how you can parse the repeating section data and use the information in a workflow “foreach” loop so you can create items in a separate list.

Ayman’s post (Published: Aug 4, 2015) is about displaying the repeating section data in the list view in an easy way, which is mainly by creating a custom field type (Nintex Repeating Section Data). He created two versions 2010 & 2013. But the only problem with this way is that you will need to deploy this field type first as a farm solution, which is not an option in some scenarios like O365 and organizations who do not allow custom server side deployments. Other than that it is a great and easy to use solution.

Why and What is JSLink

So this is why I build this JSLink to make it easy to deploy especially for O365, and if you are coming from Nintex side and don’t know what is JSLink, see this definition:
Client-side rendering is a new concept in SharePoint 2013. It’s provides you with a mechanism that allows you to use your own output render for a set of controls that are hosted in a SharePoint page (list views, display, add and Edit forms). This mechanism enables you to use well-known technologies, such as HTML and JavaScript, to define the rendering logic of custom and predefined field types.” - Muawiyah Shannak - https://code.msdn.microsoft.com/office/Client-side-rendering-JS-2ed3538a (this link has a very good group of samples). You will also need to check the samples published on the Office 365 Patterns and Practices https://github.com/OfficeDev/PnP/tree/master/Samples/Branding.JSLink where they added some reusable templates.

List Column

Starting by creating a list column of type “Multiple lines of text” in the list where we have our Nintex form. Make it a “plain text” in the “type of text to allow”.


Repeating Section

On the form, drag and drop the repeating section and add the child controls as needed, in my example here I have three text boxes: First Name, Last Name, and Age as you can see below.



I also named the controls in the same order “First Name”, “Last Name”, and “Age”. And yes with the space between “First” and “Name” because this is how I want it to look like in the view.
Then connect the repeating section control to the multiple line field created in the first step.



The Repeating Section JSLink

Now it is the step where the JSLink will do its magic, I have three files deployed to the “Site Assets” library located in the root web in the site collection. (You can choose to upload these files anywhere but remember to change the URLs in the view web part and in the override JavaScript file)

The first file is the “NintexOverrides.js”, and as you can see below I am using the PnP namespaces, and this file mainly is telling SharePoint view that we have another rendering template for one or more fields in the view:


The next file is the “RepeatingSectionTemplate.js”, and I am using the PnP namespace as well. And the purpose of this file simply is to parse the repeating section XML and display HTML table instead:


The third file is “NintexOverrides.css” cascading style sheet to set how we want the table displayed in the view:

 

Deployment

Actually there is no deployment other than copying the three files to the site assets library then set the JS Link property by doing the following steps:

  •  Browse to the view page where you want to apply this rendering (the list where the form with the repeating section is)
  • Edit the web part:




  • Scroll down to “Miscellaneous” then add “~sitecollection/SiteAssets/RepeatingSectionTemplate.js|~sitecollection/SiteAssets/NintexOverrides.js” in the “JS Link” property
  • Click “Okay” then save the page “Stop Editing”

The Output

Now you have the repeating section as follows:


And adding more repeating sections is easy as adding more “Multiple lines of text” column and connect it to the repeating section control on the form, then the output will be something like this:


Then update the “NintexOverrides.js” file to list the new column as follows:


Now the output is like this:



Click here to download the three files mentioned above.

Monday, April 13, 2015

CREATING MASTER-DETAILS RECORDS WITH REPEATING SECTION IN NINTEX FORMS

Please check my second blog post with RDA about "CREATING MASTER-DETAILS RECORDS WITH REPEATING SECTION IN NINTEX FORMS"

Check and give me your feedback: http://www.rdacorp.com/en/Blog/2015/04/09/Creating%20Master-Details%20Records%20with%20Repeating%20Section%20in%20Nintex%20Forms

Thursday, March 12, 2015

ALTERNATE SOLUTION FOR THE ALTERNATE CSS URL IN SHAREPOINT 2013 ONLINE


Today RDA posted my first post on their blog. "ALTERNATE SOLUTION FOR THE ALTERNATE CSS URL IN SHAREPOINT 2013 ONLINE"

Please check and give me your feedback: http://www.rdacorp.com/en/Blog/2015/03/12/Alternate%20Solution%20for%20the%20Alternate%20CSS%20URL%20in%20SharePoint%202013%20Online