vendredi 26 décembre 2014

Creating a lookup field that contains calculation?



![So I created a lookup table, how would go about truncating via a lookup?


For example,


Choices 56, 56SW, 56FR are using the same calculation


Choices DDS IDSL, ISDN TR, ISDN are using the same calculation


choices HDSL, HDSL2, HDSL4 are using the same calculation


What would be the best way to go about that....


Is there a way to have the user choose a one of those and then perform the calculation?


So if user chooses HDSL2 it will do the HDSL calculation, same thing if user chooses HDSL4 instead it will do the HDSL calculation since HDSL, HDSL2, AND HDSL4 are the same calculations...


Choices DDS IDSL, ISDN TR, ISDN are using the same calculation


choices HDSL, HDSL2, HDSL4 are using the same calculation So if user chooses HDSL2 it will do the HDSL calculation, same thing if user chooses HDSL4 instead it will do the HDSL calculation since HDSL, HDSL2, AND HDSL4 are the same calculations...


Any help would be appreciated ]1






How can I add a workflow 2010 to an app project in Visual Studio 2013?



I have to develop an app to a Sharepoint 2013 Foundation site. Sharepoint Foundation only accepts workflow that uses the engine 3.5.


How can I add this kind of workflow in an app project?






After changing AAM SharePoint 2013 Prompting for Credentials



I have SharePoint 2013 foundation. Till now I am connecting with sharepoint website with server name. Now I added new AAM url to connect different url. But when I am trying to access with new AAM url. it keep asking me credentials


enter image description here


What I did from my side





  1. Added site bindinging in IIS for new url.

  2. Also changed DisableLoopbackCheck link

  3. Updated host file also


Still it is asking for credentials. What next to change?






How To Get All User Profile Properties And Get Difference between User Hire Date And Current Date?



i have class UserProperties.cs in that i write some code=> public UserProperties(SPUser currentUser) { using (var site = new SPSite(SPContext.Current.Web.Url)) { try { LoadUserProperties(site, currentUser); } catch (Exception exp) { LoggingService.LogError("Failed to get " + currentUser.Name + "'s information", exp); } } }


private void LoadUserProperties(SPSite site, SPUser user) { CurrentUser = user; var userLoginName = CurrentUser.LoginName;



SPServiceContext serviceContext = SPServiceContext.GetContext(site);
var profileManager = new UserProfileManager(serviceContext);

var userProfile = profileManager.GetUserProfile(userLoginName);

Profile = userProfile;
//object value
var currentuserHireDate = userProfile[PropertyConstants.HireDate].Value != null
? userProfile[PropertyConstants.HireDate].Value.ToString()
: "";

CurrentJobFunction = userProfile[PropertyConstants.Department].Value != null
? userProfile[PropertyConstants.Department].Value.ToString()
: "";

CurrentJobFunctionUrl = GetJobFunctionUrl(CurrentJobFunction);

CurrentLocation = userProfile[PropertyConstants.Office].Value != null
? userProfile[PropertyConstants.Office].Value.ToString()
: "";

CurrentLocationUrl = GetLocationUrl(CurrentLocation);

PrefferedName = userProfile[PropertyConstants.PreferredName].Value != null
? userProfile[PropertyConstants.PreferredName].Value.ToString()
: "";

ProfilePicture = userProfile[PropertyConstants.PictureUrl].Value != null &&
!userProfile[PropertyConstants.PictureUrl].Value.ToString().Equals(string.Empty)
? userProfile[PropertyConstants.PictureUrl].Value.ToString()
: "/_layouts/15/images/PersonPlaceholder.200x150x32.png";

MyProfileUrl = userProfile.PersonalSite != null ? userProfile.PersonalSite.Url : "#";

if (userProfile[PropertyConstants.PreferredName].Value != null)
{
FirstName = userProfile[PropertyConstants.FirstName].Value != null &&
!userProfile[PropertyConstants.FirstName].Value.ToString().Equals(string.Empty)
? userProfile[PropertyConstants.FirstName].Value.ToString()
: userProfile[PropertyConstants.PreferredName].Value.ToString();

LastName = userProfile[PropertyConstants.LastName].Value != null &&
!userProfile[PropertyConstants.LastName].Value.ToString().Equals(string.Empty)
? userProfile[PropertyConstants.LastName].Value.ToString()
: string.Empty;
}
}


//I have NewHire webparts in NewHire.cs i write some code to test can i access all user properties ->


private HtmlGenericControl GetHtmlForNewHires() { var userproperties = new UserProperties();



var url = userproperties.MyProfileUrl;
if (string.IsNullOrEmpty(url))
url = "#";
var s = userproperties.FirstName;
var article = new HtmlGenericControl("article");

article.InnerHtml = s;


}


//But i am not getting user properties i have 5 user profiles. and also also i want to get user having hire date is within last 30 days






SPServices.SPCascadeDropdowns not working



Who knows as to connect it to the HTML form??? not to NewForm.aspx and to HTML form?



type="text/javascript">
$(document).ready(function() {
$("#State").SPServices.SPCascadeDropdowns({
relationshipList: "SOGP",
relationshipListParentColumn: "Title",
relationshipListChildColumn: "LC",
parentColumn: "Title",
childColumn: "LC"
});
});





The length of the URL for this request exceeds the configured maxUrlLength value. REST API



I was wondering if someone could help, or am I missing something. In the articles found here http://ift.tt/13IyE86


They refer to using the /getfilebyserverrelativeurl. When I build my request and try and make a HttpWebRequest I get



The length of the URL for this request exceeds the configured maxUrlLength value



in the webresponse.


I'm making these requests from a console application against Office 365/SharePoint Online.


The url length is is 305 in this test case.


This is the code I am using



HttpWebRequest request = HttpWebRequest.Create(resourceUrl) as HttpWebRequest;
request.Credentials = _credentials;
request.CookieContainer = _cookieContainter;
request.Headers.Add("X-RequestDigest", _formDigest);
request.Method = "POST";
request.Timeout = 3600000;
request.Accept = "application/json; odata=verbose";
request.ContentLength = incomingStream.Length;
request.AllowWriteStreamBuffering = false;
request.KeepAlive = false;

using (var reqStream = request.GetRequestStream()) {
incomingStream.CopyTo(reqStream);
}

WebResponse response = request.GetResponse();
using (System.IO.StreamReader sr = new System.IO.StreamReader(response.GetResponseStream())) {
result = sr.ReadToEnd();
}


When its caught by the WebException and I read the exception response all I get is this "The length of the URL for this request exceeds the configured maxUrlLength value."


This is the resourceUrl:



http://ift.tt/13J0vVa('/personal/user_account_tenant_onmicrosoft_com/Documents/Test/7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso.001')/startupload(uploadId=guid'38acfb37-ccd5-4ac1-961d-090ce1ed9d6f')







User Profile Server Issue on Restore Process



I got backup my SharePoint site then I restored the back-up another server.


But i got error as follow :



User Profile Service Error 12/26/2014 9:59 AM Object User Profile Service failed in event OnRestore. For more information, see the spbackup.log or sprestore.log file located in the backup directory.
SPException: The specified component exists. You must specify a name that does not exist.


I got same error for Excel Service Application. I deleted Excel Service Application and I didn't get the error. I want to delete the User Profile Service Application, but I got error as follow:


enter image description here


How can I solve this issue? I'm not deleting User Profile Service. I'm changing service name but I got same error.