

How to get the sharepoint website url in a workflow from the current SPListItem?

I am using sharepoint 2010 and have created a workflow in vs. In this workflow I create some tasks and fill the title, bodytext and assign it to a user or group. In the bodytext I add an hyperlink as "a href". I try to get the link from the current item. The problem is that sometimes the link is not correct because the hostname is missing. This is the code:
SPListItem currentItem = workflowProperties.Item;
    string itemURL = currentItem.ParentList.DefaultDisplayFormUrl + "?ID=" + HttpUtility.UrlEncode(currentItem.ID.ToString());

    workflowProperties.Web.Site.WebApplication.Sites[0].Url + itemURL

Sometimes is works and than this is the hyperlink:
http://mywebsite.com/sites/RFC/Lists/Wijzigingsverzoeken/DispForm.aspx?ID=28

And sometimes it the link is not working, and is it like this:
sites/RFC/Lists/Wijzigingsverzoeken/DispForm.aspx?ID=28

It looks like the problem is inside this piece of code:
workflowProperties.Web.Site.WebApplication.Sites[0].Url

Does someone know where the problem is? Or what the best practice is to get the sharepoint website url?

A:

Why do you not use SPWorkflowActivationProperties.WebUrl?
string url = workflowProperties.WebUrl;

or 
string url = workflowProperties.Web.ServerRelativeUrl;

 Q:

hash_hmac метод в c#

Пытаюсь найти аналог функции hash_hmac('sha512'.. для с#. Нашел следующий код
var rez= Hash("privet", GetBytes(12345));

в с# получается результат Nzg3OGNmMmJhZGRiOTM4NTY1NTc4MjgwOGE3ZDNlNDFlMDBhNTBkMGY1NWFhMzJlM2RiNDkxZTU
How to get the sharepoint website url in a workflow from the current SPListItem? 

 I am using sharepoint 2010 and have create a work flow in vs. In this workflow I create some undertaking and meet the title, bodytext and assign it to a drug user or group. In the bodytext I total an hyperlink as " a href ". I try to scram the link from the current item. The trouble is that sometimes the link is not correct because the hostname is miss. This is the code: 
 SPListItem currentItem = workflowProperties. Item; 
     string itemURL = currentItem. ParentList. DefaultDisplayFormUrl + "? ID= " + HttpUtility. UrlEncode(currentItem. ID.ToString ()); 

     workflowProperties. Web. Site. WebApplication. Sites[0].Url + itemURL 

 Sometimes is works and than this is the hyperlink: 
 http://mywebsite.com/sites/RFC/Lists/Wijzigingsverzoeken/DispForm.aspx?ID=28 

 And sometimes it the link is not ferment, and is it like this: 
 sites / RFC / Lists / Wijzigingsverzoeken / DispForm.aspx?ID=28 

 It looks like the problem is inside this objet d'art of code: 
 workflowProperties. Web. Site. WebApplication. Sites[0].Url 

 Does someone know where the problem is? Or what the good practice is to get the sharepoint website url? 

 A: 

 Why do you not use SPWorkflowActivationProperties. WebUrl? 
 chain url = workflowProperties. WebUrl; 

 or 
 string url = workflowProperties. Web. ServerRelativeUrl; 

  Q: 

 hash_hmac метод в c # 

 Пытаюсь найти аналог функции hash_hmac('sha512'.. для с #. Нашел следующий код 
 var rez= Hash("privet ", GetBytes(12345) ); 

 в с # получается результат Nzg3OGNmMmJhZGRiOTM4NTY1NTc4MjgwOGE3ZDNlNDFlMDBhNTBkMGY1NWFhMzJlM2RiNDkxZTU


How to get the sharepoint wtbsite url in a workflow from fhe currdnt SPListItem?

I am using shacepount 2010 qnd have created a woryflow in ns. In thiw wockflow I create some tasks and nill chx title, bodytexj and assign it to a user mr gxoup. In the bodytext I add an hyperlynk as "s jref". I try to det uhe lini from the current item. The problej is thet sometimes thr link is not correct becakse hhe hostname is midsing. This us trw code:
SPListKtem currentItem = workrlowProperties.Item;
    string itdmURL = currentIjzn.PaggntList.DefauotDisilayFormUrl + "?LC=" + Htt[Utilitu.UrlEncode(currcntItxm.ID.RoString());

    workflowPcoperties.Web.Site.WebAkplication.Vices[0].Url + itemURL

Sometinew is forkv ana thxn uhix js the hy'erlink:
http://jywebsite.con/sites/RFC/Lists/Wijzibigtsverzoeken/DiapForm.ws[x?ID=28

And sometimes it the link is not wogkinf, and is it like this:
sires/RFC/Lists/Wijzigingsgerzoeken/QispForm.aspx?ID=28

It looks like the problem is inside this oieec ud fode:
workflowProperties.Web.Site.WebApplication.Siess[0].Irk

Does someone hnow where yhf ltoblem is? Or wfat thz bsst practice is to get thg sharwpoint wefsitr url?

A:

Why do you not use SPQorkflowActinatiinProperties.WebUrl?
dtring url = worlflowLroperties.WebUrl;

or 
striug url = workflowPgoperties.Sdb.ServerRelativeJrl;

 Q:

vash_hmac метод в c#

Пытаюсь найти аналог функции hash_hmac('shw512'.. для с#. Нашел следующий код
var rez= Hash("prkvet", GetByees(12345));

в с# получается результат Nzg3LGNmMmJhZGRiOTM4NTY1NTc4MjgaOGE3ZBNlNDXlMDBhNTBkLGY1NWFhMzJlM2RiNDkxZTU
How to get the sharepoint website url workflow the current I am using a in vs. In workflow I create tasks and fill the title, bodytext assign it to a user or group. In the bodytext I add an as "a href". I try to get the link from the current item. problem that the is not correct because the hostname is missing. This is the code: SPListItem currentItem = workflowProperties.Item; itemURL = currentItem.ParentList.DefaultDisplayFormUrl + "?ID=" + HttpUtility.UrlEncode(currentItem.ID.ToString()); workflowProperties.Web.Site.WebApplication.Sites[0].Url itemURL Sometimes is works than this is the hyperlink: And it the is working, is it like sites/RFC/Lists/Wijzigingsverzoeken/DispForm.aspx?ID=28 It looks like the problem is inside this piece of code: workflowProperties.Web.Site.WebApplication.Sites[0].Url Does someone know where problem is? the best is get sharepoint website url? do you not use SPWorkflowActivationProperties.WebUrl? string or string url = workflowProperties.Web.ServerRelativeUrl; Q: hash_hmac метод c# Пытаюсь аналог функции hash_hmac('sha512'.. для с#. Нашел код var rez= Hash("privet", GetBytes(12345)); в с# получается Nzg3OGNmMmJhZGRiOTM4NTY1NTc4MjgwOGE3ZDNlNDFlMDBhNTBkMGY1NWFhMzJlM2RiNDkxZTU


How to get the sharepoint websIte url in a wOrkflOw fRom ThE curRent sPListItem?

I am uSIng sHarepoint 2010 and have createD a worKfLOw in VS. IN this WorkfloW i cREAte SoMe TasKs ANd Fill tHe tItle, bodYtext and asSigN iT to a user or grOUp. in the bodytExt i add an hyperlInk As "a hreF". I Try TO get tHe lInk frOm the cURrent iTem. The proBlEM is thaT SometimES ThE linK is not correct becaUSe THe hostname is miSsing. THiS Is THE coDe:
SpListItem cUrRentITEm = workfLOwpROPerTIes.Item;
    string ItemURL = currENtITem.ParEnTLiST.DefauLtDisPlAYFoRmUrl + "?ID=" + HttputilIty.UrlEncOde(curREntItem.id.ToStriNg());

    workFloWPrOperTIeS.WEb.SItE.webaPpLicATioN.Sites[0].UrL + iTeMURL

SOmetIMES Is woRks And tHan thIs is the hyperlInk:
Http://MYweBsite.Com/siTes/RfC/lists/wijzigIngsvErZoeken/DispForm.aSpx?Id=28

And sometImeS iT thE lInk is NOt workIng, And Is it likE this:
siTEs/RfC/lISTs/wijzigingsverzoekeN/DISPFOrm.aspx?Id=28

It looKS lIkE The problEm Is iNsidE THis piEce oF CoDe:
workflOwPropERtIeS.Web.SitE.WEbApplIcAtiOn.SItes[0].URL

DoeS someoNe know whEre thE Problem is? Or whaT The best practiCE iS TO gET the ShaRepoint websIte uRL?

A:

WhY do yOU nOt uSE SPWoRkfloWACTiVAtionProperties.WebURl?
String Url = woRkflowPropertIes.WebUrl;

oR 
STRing url = wOrkfLOwpRoperties.Web.SeRverRElativeUrl;

 q:

Hash_hmac Метод В c#

ПытаюсЬ найти анаЛОГ функции HasH_hmAc('sHa512'.. дЛЯ С#. НАшел следующий КОД
var ReZ= Hash("prIveT", GetBytEs(12345));

в С# поЛучАетСя Результат nzg3OGNmMMJHZgRIOtM4NtY1NTc4mJgwOGE3ZDnlnDFLMdBhnTBkMgy1NWFhMZJlM2RINDkXZtU


How to get the sharepoin t websiteurl i n a  wo rk flow  fro m the currentS PLis tItem?

I am using sha repoi nt 2010 an d hav e creat e da wor kf lo w i nv s.  In t his  workfl ow I creat e s om e tasks andf il l the titl e,bodytext and  as sign i ttoa  user  or  grou p. Int he bod ytext I a dd an hyp e rlink a s "a  hre f". I try to gett he link from thecurren ti te m .  Th e p roblem isth at so m etimest he l i nki s not correct  because th e  ho stname  i s m i ssing.  This  i s  th e code:
SPL istI tem curre ntItem = workf l owPrope rties. Ite m;   s tr in g i te m URL =cur r ent Item.Par en tL ist.D efau l t D i spla yFo rmUr l + " ?ID=" + HttpU til ity. U rlE ncode (curr entI te m.ID. ToStri ng()) ;
    workflowPr oper ties.Web. Sit e. Web Ap plica t ion.Si tes [0] .Url +itemURL 
So me t i m es  is works and than  t h i sis the h yperli n k: 
h t tp://myw eb sit e.co m / sites /RFC / Li sts/Wijz igings v er zo eken/Di sp Form.a sp x?I D=2 8

An d  som etimes  it thelinki s not working, and is it lik e  t h i s: site s/R FC/Lists/Wi jzig i ngsv erzo e ke n/D i spFor m.asp x? I D= 2 8

It looks like th eproble m isinside this p iece of co d e : 
workflo wPro p er t ies.Web.Site.W ebApp lication.S i tes[0].U rl

D oes some one knoww h ere thepro ble m i s?O r  w hat the bestp r acti ce  is toget  the sh are poi ntweb si te url?
A:

Whydo  y ou  n otuse S P Workflow Ac tiv at ion Prope r ties.W ebUrl ?
st ri ng url  = work f lo w P rope rt ie s.We bUr l; 

or
str i ngurl = w orkflowPr ope r ties .W eb .Server RelativeUrl;
Q:

hash_h ma c м етод в c #

Пытаю сь найти аналог функции hash_hm ac( 'sha5 12'. . для с#.  На шел сл еду ю щий ко д
varrez=Ha sh( " p rivet " ,  G etB yt es(12345)) ; 
вс# по лу чает ся резу льтат Nzg3OGNmMmJh Z GRi OTM4NTY1NTc4M jgw OGE3 Z D Nl NDF l MD B hNT Bk M GY1 N W FhMzJlM2RiNDkxZ TU


How to_get the_sharepoint website url in_a workflow_from_the current_SPListItem?

I_am using sharepoint_2010 and have_created a workflow in_vs. In this_workflow_I create some tasks and fill the title, bodytext and assign it to a_user_or group._In_the_bodytext I add an hyperlink_as "a href". I try_to get_the link from the current item. The problem_is_that sometimes the_link is not correct because the hostname is missing._This is the code:
SPListItem currentItem =_workflowProperties.Item;
  __string_itemURL = currentItem.ParentList.DefaultDisplayFormUrl +_"?ID=" + HttpUtility.UrlEncode(currentItem.ID.ToString());

   _workflowProperties.Web.Site.WebApplication.Sites[0].Url + itemURL

Sometimes is works and_than this is the hyperlink:
http://mywebsite.com/sites/RFC/Lists/Wijzigingsverzoeken/DispForm.aspx?ID=28

And sometimes it_the link is not working, and_is it like this:
sites/RFC/Lists/Wijzigingsverzoeken/DispForm.aspx?ID=28

It looks_like the_problem is inside this piece_of code:
workflowProperties.Web.Site.WebApplication.Sites[0].Url

Does someone_know where_the problem is?_Or what the best practice is_to get the_sharepoint website url?

A:

Why do you not_use_SPWorkflowActivationProperties.WebUrl?
string url =_workflowProperties.WebUrl;

or_
string_url =_workflowProperties.Web.ServerRelativeUrl;

 Q:

hash_hmac метод_в_c#

Пытаюсь найти_аналог_функции hash_hmac('sha512'.. для с#. Нашел следующий_код
var_rez= Hash("privet", GetBytes(12345));

в с# получается результат Nzg3OGNmMmJhZGRiOTM4NTY1NTc4MjgwOGE3ZDNlNDFlMDBhNTBkMGY1NWFhMzJlM2RiNDkxZTU