Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all 7589 articles
Browse latest View live

CAML - Parameter: IncludeTimeValue="TRUE"

$
0
0

Hi there,

When we use the CAML to search the DateTime Field by using WHERE Condition with a Parameter "IncludeTimeValue='TRUE'". My question is when we use the parameter "IncludeTimeValue='TRUE'",whether or not the seconds will be counted :) right??

for example: my DateTime value is "2020-02-27T16:02:21Z"

<FieldRef Name='Login_x0020_Time' /><Value IncludeTimeValue='TRUE' StorageTZ='TRUE' Type='DateTime'>


Hi there, if you found my comment very helpful then please | Propose as answer | . Thanks and Regards.


Hide any Table header in jquery data table from export to excel

$
0
0

Hide any Table header in jquery data table export to excel 

 

complete:function(data){

      $('#TableID').DataTable( {

        "scrollCollapse": true,
    "paging":   false,
        dom: 'Bfrtip',
        buttons: [
            'copy',
            'csv',
            'excel',
            'pdf',
            {
                extend: 'print',
                text: 'Print all',
                exportOptions: {
                    modifier: {
                        selected: null
                    }
                }
            }
        ],
        select: true
    } );
}

want to hide 1st column in exported excel :

<th class="noExport"> <input type="checkbox" class="AllSelectedTableID"/>Select all</th>


Shiv Sharma

Converting text field to caps

$
0
0
Using Javascript how can I convert text to capitalized letter so that no matter what format user enters, it is always saved in all caps? My field is Single line text. 

How to add the preview dialog box to my custom page

$
0
0

Hi experts,

I have a page in SP 2016 with a custom web part. In the web part I create a table using JavaScript to show files in a doc lib, it looks like below, the "Section Title" column is for the file link. 


My question is how can I add the SP built-in preview dialog box (like the dialog box in below screenshot) for each file to my custom table in Section Title column? 

Thanks,

Michael


Problem Add User to Group after to delete the user - SharePoint 2013

$
0
0

Hi,

I have a ETL that add users to SharePoint(2013) group.

When I add the user "A", it's works fine. When I delete the user "A" and after run again the ETL code, the user "A" isn't inserted, but no problems ocorrurs in method (webservices) AddUserToGroup.

After, when insert other user "B" it's works. So, I isert the user "A" again and it's works perfectly.

This is a SharePoint Bug? has anyone this problem?

Thanks!!

Everton


Web_Reference_Folder_Name.UserGroup usrgrpService = new Web_Reference_Folder_Name.UserGroup();
usrgrpService.Credentials= System.Net.CredentialCache.DefaultCredentials;

usrgrpService.AddUserToGroup("Group_Name","Everton Batista","TEST\everton","everton@test.com","Notes");

How can pass the id of the newly created listitem when the new item is saved and pass it as a query string to another page.

$
0
0

I have a requirement that when a SharePoint user creates a new list item using the list NewForm.aspx, after successful saving the page needs to be redirected to another page passing the ID of the newly created listitem to that page.

This is already happening on a site I inherited. I just don't know how it is done.

Thanks for helping.


faye fouladi

WHat are some tips and tricks to test out new navigation or features without disrupting the production environment?

$
0
0

Are there are any tricks, or work-arounds to test new navigation or features without impacting the current environment?

If creating a development environment, does that copy the production site, if so , how do you keep if from copying everything and causing a huge foot print and file size?

Thank you in advance.

Year wise Sum for upto 10 users using script editor

$
0
0

Hello,

I have list named as "Credits" which includes column as : User Name, Credits earned, Earned on.

Suppose it contains data as below:

=====================================

User NameCreditsEarned On
Jay1501-Feb-20
Jesper1001-Jan-20
Jay2005-Feb-20
Mads10015-Jan-20
Jay1501-Feb-19
Jesper100

1-Jan-19


Monika             250      14-Feb-20

Adi                   300      16-Feb-20

Alexa              100         1-Jan-20

=====================================

So, I want to display details in web part as follow:

Jay = 350

Adi = 300

Monika = 250

Alexa = 100

Jesper = 100

=====================================

I am able to display users depending upon "Credits" column in Descending order with code mentioned at : 

https://social.msdn.microsoft.com/Forums/office/en-US/eb468257-60c8-4c52-adab-854a7e6845cd/year-wise-total-sum-for-per-user-using-script-editor?forum=sharepointdevelopment

Need help on below:

How to get this result only for top 5 people and also if 2-3 people having same credits/points then can their name be sorted on "Ascending" order?

Thanking you in advance.

Have a nice day.

Regards,

Jayashri


I need to update a hyperlink field using JavaScript

$
0
0

I have a requirement that I need to update a Hyperlink field in a list but the JavaScript code is not working. Any idea what is wrong with the code below?

All my alerts are working but my listitem does not get updated.

function UpdateAuditListitm(NextActionRecommendationTitle, NextActionRecId) {   
    // alert('Update Audit is called.');  
  var clientcontext = SP.ClientContext.get_current();          
  var web = clientcontext.get_web();          
  var lists = web.get_lists();     
  var myList = lists.getByTitle("Audit");  
   mylistItem = myList.getItemById(AuditId);       
   var urlDescription = "Recommendation " + NextActionRecommendationTitle
 alert('Description is: ');  alert(urlDescription); 
 var myNextActionUrl =  _spPageContextInfo.webAbsoluteUrl + "/sites/AAPMySite/SitePages/recommendation.aspx?recommendation=" + NextActionRecId; 
 alert(myNextActionUrl);
  var urlValue = new SP.FieldUrlValue();
  urlValue.set_url(myNextActionUrl);
  urlValue.set_description(urlDescription);
  mylistItem.set_item("NextActionDue_Link", urlValue);     
  mylistItem.update(); 
  clientContext.load(mylistItem);  
  clientContext.executeQueryAsync(  
     Function.createDelegate(this, this.onNextActionLinkSucceeded),   
     Function.createDelegate(this, this.onNextActionLinkFailed)  
   );  

}

function onNextActionLinkSucceeded() {

    alert('Next Action link updated!');
}

function onNextActionLinkFailed(sender, args) {

    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}

Thanks


faye fouladi


Need to move external list data to two sharepoint lists on a timer

$
0
0

Hello. I have a significant problem in sharepoint 2016 on premises , and I'm not sure of how to implement a solution. Most research I've done recommends I implement a sharepoint timer job, but I've been forbidden from doing so.

The data structure:
Master List, a Sharepoint External List. Contains all fields. Contains line item data, and a lot of redundant contract data
Line items, a Sharepoint Internal List. Contains the fields unique to a line item, along with the unique identifier for a contract
Contract, a Sharepoint Internal List. Contains all fields common to a contract. Plus two columns that sum the total value and amount paid 

The problem:
Our client is providing a sharepoint external list, which is updated with new and updated information at midnight. I then have to take that data and do the following by the start of the next business day:

  1. Copy some of the fields of each new list item to another new list, called Line item. 
  2. Copy the common fields to of each new item to the contract list. While avoiding contract line items. There is a unique contract ID provided
  3. Create a sum of the values of the line items for the contract field
  4. Update the line items with their new values. There is no single unique identifier for a line item, although a combination of three fields, including the contract number will provide a unique result.
  5. Update the contract when the line items are updated. Including any new total values.
  6. Trigger all of these effects at a specific time every day (I was thinking 1 AM, if it somehow matters.

As everything I've looked up says that I can't directly run a workflow on an external list. Thus, I simply can't create a pair of workflows to run on update or on creation on a my external list. So I'm rather lost Doing the above at runtime is not practical due to the large performance cost.

Prior research:
I've done some research on using a workflow to copy an external list item to an internal list. Unfortunately, they all suggested to use a sharepoint runtime job. I'm also reasonably sure that I can some logic I've found to solve issue 5, so that's less important.

Note: The solution must use sharepoint workflows. The use of Sharepoint Timer Jobs or other actual server side code is explicitly not allowed, I've asked.
You may assume that the data that is being pulled from the external list and put into an internal list is not allowed

Please let me know if you need any more information.

Displaying the indicator in SPFX react webpart

$
0
0

I want to display the below image indicator based on the score level in SPFX react webpart.How can we achieve this>

Deleting the last delete action

$
0
0

Hi Team,

I have created view from the list available in sharepoint. It is displaying the list item in grid style on referring the below URL in Chrome.

http://spdev4:1205/apps/bc/Lists/Employee%20Case/My%20Employee%20Cases.aspx.

Each item from the grid is opened in separate browser tab. For example 3 items in 3 different tabs.

All the three tabs are displaying details form developed in Sharepoint Custom application. In this form there is delete button which will delete the item from the list.

So, I clicked delete button available in each tabs one after another fast. So only last clicked delete button has deleted the item and after deleting showing the error message as shown below.

No item exists. It may have been deleted or renamed by another user.] Microsoft.SharePoint.SPContext.get_Item() +1980

Other two tabs not deleted the items from the list though I clicked delete button there also.

Kindly tell me what could be reason so that I can fix this issue.

Thanks & Regards,

Gopi Thakur


SharePoint make checkbox field option horizontal

$
0
0

I want to make SharePoint checkbox option horizontal in New/Edit Form.

Is this possible with CSS or something else ?

I need some help with two dimensional arrays - sharePoint

$
0
0

I have several lists in my  SharePoint site. there is a parent list called Audit. This audit has several child lists: Recommendation, inquiry and report.

In each child list there is a due date column.

I am building a report and I need to get the earliest due date for each audit for my report. the earliest due date can be in any of the child lists for a given audit. I decided to write JavaScript code to retrieve listitems from all child lists. I declared a two dimensional array and I push the values of audit (lookup field) in the child lists as well as the value of due date to the two dimensional array. At the end the array may have elements with common audits but different due dates. I need to process this array so that for the elements of the array with a common value for Audit, I need to get the earliest Due date. How can I write a function to accomplish this.


faye fouladi

SharePoint 2013 - Make Quick Launch Wider with CSS

$
0
0

Hello Community!

I am working with SharePoint 2013 and I'm trying to extend the width of the Quick Launch using CSS.  So far I have this script:

<style type="text/css">
/*increase quick launch width */
#sideNavBox
{
  width:300px !important;
}
/*Middle Content */
#contentbox{
margin-left: 340px !important;
}</style>

This script works great when run from a CEWP or Script Editor on the page.  However, what I need to do is run the script from either a Master Page or through the Alternate CSS URL setting, in the Site Settings Master Page configuration page.  Unfortunately I just can't get this part to work.

Has anyone else faced this issue?  If so, please provide guidance and code examples for resolving the issue.

Thanks!

Tom


Tom Molskow - Senior SharePoint Architect - Microsoft Community Contributor 2011 and 2012 Award - Linked-In - SharePoint Gypsy


SharePoint - Item Permission - C#

$
0
0

Dears,

I'm building custom workflow on top of SharePoint using C# language, I used the function "ResetRoleInheritance" to reset the unique permission at a level item, the permission was reset, however, the item still has unique permission which is mean any group or user granted permission on the root site will not have access to this item.


Please advise.

Mohammad


Mohammad Bahsoun Solution Developer

Read newsfeed using client side code?

$
0
0
I want to read the News Feed that appears in MySite and show them in a content editor web part on ANOTHER web application that is hosted in the same FARM.. I need to read the news feeds that are related to a specific managed path only. Also I should be able to list ALL types of the News Feeds including its date, created by, etc.. Please advise how I can achieve this by using client side code only. Thank you

how to add video on webpart zone

$
0
0

Hi,

I have videos , which I uploaded in site asset library,

Requiements:

I have page which web part zones are available 

Problem :

I need to add video clip on it, as I click to add web part ---> goto insert ---> Video & Audio -- >

 not find link to goto site asset .

below is image reference


Thanks


SharePoint PreSaveAction Validation

$
0
0

I have a date field and only allow user submit the item when the date field is current date.

How can we write validation logic in PreSaveAction ?

i want to display show more oprtion in my spfx react webpart

$
0
0

In my spfx react webpart i have total 3 tabs and each tab contain different section like first tab contains 7 sections second tab contains 8 sections and third tab contains 10 section. At the time of loading i want to show only one section on each tab and give an show more option as shown in below screen when the user clicks on show more option it has to show another section

Sample code as below:

<divclassName={styles.headerCaptionStyleT1}> Section 1

<div>abc</div>

<div>erf</div>

<div>qqq</div>

</div>

<divclassName={styles.headerCaptionStyleT1}> Section 2

<div>awerbc</div>

<div>ewerf</div>

<div>qqqwe</div>

</div>

<divclassName={styles.headerCaptionStyleT1}>Section 3

<div>df</div>

<div>ewedfrf</div>

<div>dfefd</div>

</div>

<divclassName={styles.headerCaptionStyleT1}>Section 4

<div>awdfvfderbc</div>

<div>ewfdfderf</div>

<div>fd</div>

</div>

As per above code first i need to show only contents in Section 1 if the user click 'Show more' option then the user can seee

section 1 and section 2 if the user clicks again 'Show more' options then user can see section 1 and section 2 and section 3 how we can achieve this

Viewing all 7589 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>