Wednesday, October 25, 2017

Custom designer workflow triggers twice

If you check the workflow history, you will probably see that every time an item is added or modified, the workflow runs twice. That’s why you’re receiving two email notifications. But why is the workflow running twice for each item?
The reason for this is timing. If your workflow is very short and the SharePoint server is very slow, the first instance of the workflow may finish well before the item is fully saved and committed to SharePoint. As the item is being processed, the workflow event receiver can fire again, and start another instance of the workflow.
The solution for this problem is to add a step at the end of your workflow which will pause the workflow for a few minutes – I usually set it to 5 minutes and that seems to solve the problem.


Tuesday, October 24, 2017

Add SharePoint default file attachment to New/Edit/Disp form?

For New form:-
a)Find out the idAttachmentsRow tr.

IDATTACHMENT ROW









b)Place below highlighted code above that TR.

Code For NewForm
 
 
 
For Edit Form:-

a)Find out the idAttachmentsRow tr.
IdAttachmentRow






b)Place below highlighted code above that TR. 
Code For Edit Form
 
 
 
 

For Display Form:-
Navigation to View Item
 
 






In Default Display Page Attachment is shown but when we create any customize display form for list we are not able to see the attachment even though attachment  is  present. 
Default and Customize Display Form
 
 
 
 
 
 

Tuesday, October 3, 2017

SharePoint YES/NO column align in a single row using JSOM Javascript in list form

SharePoint choice column in list form align in a single row :-

Before



After


Assign id to the <td> tag of ms-formbody of the control and add below code in JS file and call alignChoiceColumns() inside document.ready(), it additionally delete the next empty tr .



 function alignChoiceColumns(idOfTDTag) {
            var firstRadio = $("#" + fieldName + " table tbody tr td .ms-RadioText:eq(0)");
            $("#" + fieldName + " table tbody tr td .ms-RadioText:gt(0)").appendTo($(firstRadio));
            $("#" + fieldName + " table tbody tr:gt(0)").remove();
        }

Clearing Person/Group Values

To clear out or empty the values in person or group columns, how you do it depends on if the column is single-value or multi-value. For ...