Rahul Khanna

Rahul Khanna

  • NA
  • 236
  • 0

The formula contains a syntax error or is not supported CF

Jan 4 2014 8:17 AM
Hi,
I have formatted the below formula in sharepoint calculated field thru dibrary settings which is working fine. 
 ="<a href='http://server:1111/Sites/TestSite/_layouts/MyCustomApplicationPage/MyCustomApplicationPage.aspx?ItemId="&ItemID&"&ListId="&ListID&"'>"&Title&"</a>"
The above formulla I am trying to do thru code behind, for that i have just replaced the & with + then the formula looks like below:

SPFieldCalculated totalMiles = currentlist.Fields.GetFieldByInternalName("CustomCalcField") as SPFieldCalculated;
totalMiles.Formula ="=<a href='http://server:1111/Sites/TestSite/_layouts/MyCustomApplicationPage/MyCustomApplicationPage.aspx?ItemId="+ItemID+"&ListId="+ListID+"'>"+Title+"</a>"
Note: ItemID and ListID I have calculated thru programatically.
 
But its not working, throwing exception "the formula contains a syntax error or is not supported". Any help would be appreciated.
 

Answers (1)