Create a subsite from event receveir of the type ItemAdd

Hi;
I have a event receveir on a ItemAdd and I would like to create a new subsite when a new item is added into a custom list (LIST).
I have tried this example (http://sharepoint247.com/sharepoint2010/sharepoint-2010-event-handler-to-create-subsites/) but not working for me.
My code source is :
base.ItemAdded(properties);
SPWeb web = properties.OpenWeb(); 
if (properties.List.Title == "LIST")  
  {  SPListItem curItem = properties.ListItem;
SPWeb newSite = web.Webs.Add("test", "test", "test", (uint)1033, "#$0", false, false); 
                   newSite.Update();
                   newSite.Close();
The command web.Webs.Add not working : any action and any error ?
Regards

Hi;
In debug mode I have 2 exceptions (bac à sable its sandbox in french):
 - UserCodeExecutionProxy call failed. Microsoft.SharePoint.UserCode.SPUserCodeExecutionPipelineFailedException: La demande d’exécution du code en mode bac à sable a été refusée, car le service d’exécution de code en mode bac à sable sur l’ordinateur
hôte était trop occupé pour traiter la demande.    Server stack trace:      à Microsoft.SharePoint.UserCode.SPUserCodeExecutionHost.Execute(Type userCodeWrapperType, Guid siteCollectionId, SPUserToken userToken, String
affinity, SPUserCodeExecutionContext executionContext)     à System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)    
à System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, I... 71c3ff98-6b35-49e1-a046-664310405477
12/20/2014 01:12:26.88* w3wp.exe (0x1024)                        0x1EF4 SharePoint Foundation        
 Sandboxed Code Service         0000 High     ...nt32 methodPtr, Boolean fExecuteInContext)    Exception rethrown at [0]:      à System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)     à System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)     à Microsoft.SharePoint.Administration.ISPUserCodeExecutionHostProxy.Execute(Type userCodeWrapperType,
Guid siteCollectionId, SPUserToken userToken, String affinityBucketName, SPUserCodeExecutionContext executionContext)     à Microsoft.SharePoint.UserCode.SPUserCodeExecutionManager.Execute(Type userCodeWrapperType, SPSite site, SPUserCodeExecutionContext
executionContext) 71c3ff98-6b35-49e1-a046-664310405477
12/20/2014 01:12:26.88  w3wp.exe (0x1024)                        0x1EF4 SharePoint Foundation        
 Sandboxed Code Service         0000 High     ExecuteRequestInSandBox call failed. Microsoft.SharePoint.UserCode.SPUserCodeExecutionPipelineFailedException: La demande d’exécution du code
en mode bac à sable a été refusée, car le service d’exécution de code en mode bac à sable sur l’ordinateur hôte était trop occupé pour traiter la demande.    Server stack trace:      à Microsoft.SharePoint.UserCode.SPUserCodeExecutionHost.Execute(Type
userCodeWrapperType, Guid siteCollectionId, SPUserToken userToken, String affinity, SPUserCodeExecutionContext executionContext)     à System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object
server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)     à System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int... 71c3ff98-6b35-49e1-a046-664310405477
12/20/2014 01:12:26.88* w3wp.exe (0x1024)                        0x1EF4 SharePoint Foundation        
 Sandboxed Code Service         0000 High     ...32 methodPtr, Boolean fExecuteInContext)    Exception rethrown at [0]:      à System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)     à System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)     à Microsoft.SharePoint.Administration.ISPUserCodeExecutionHostProxy.Execute(Type userCodeWrapperType,
Guid siteCollectionId, SPUserToken userToken, String affinityBucketName, SPUserCodeExecutionContext executionContext)     à Microsoft.SharePoint.UserCode.SPUserCodeExecutionManager.Execute(Type userCodeWrapperType, SPSite site, SPUserCodeExecutionContext
executionContext)     à Microsoft.SharePoint.UserCode.SPUserCodeWebPartRemoteExecutionHelper.<>c__DisplayClassa.<ExecuteRequestInSandBox>b__9()     à Microsoft.SharePoin... 71c3ff98-6b35-49e1-a046-664310405477
12/20/2014 01:12:26.88* w3wp.exe (0x1024)                        0x1EF4 SharePoint Foundation        
 Sandboxed Code Service         0000 High     ...t.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)     à Microsoft.SharePoint.UserCode.SPUserCodeWebPartRemoteExecutionHelper.ExecuteRequestInSandBox(HttpContext
context, SPWeb web, SPWebPartManager manager, SPUserCodeWebPart userCodeWebPart) 71c3ff98-6b35-49e1-a046-664310405477
12/20/2014 01:12:27.37  SPUCHostService.exe (0x08F0)             0x251C SharePoint Foundation          Sandboxed Code Service       
 fe7o Medium    -  - La demande d’exécution du code en mode bac à sable a été refusée, car le service d’exécution de code en mode bac à sable sur l’ordinateur hôte était trop occupé pour traiter la demande. 
And the second exception :
Interception de Microsoft.SharePoint.SPException
  Message=la langue n'est pas prise en charge par le serveur.
  Source=Microsoft.SharePoint
  ErrorCode=-2130575266
  NativeErrorMessage=FAILED hr detected (hr = 0x8102005e)
  NativeStackTrace=""
  StackTrace:
    Server stack trace:
       à Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)
       à Microsoft.SharePoint.Library.SPRequest.CreateWeb(String bstrUrl, String bstrTitle, String bstrDescription, UInt32 nLCID, Boolean bCreateUniqueWeb, Boolean bConvertIfThere, Guid& pgWebId, Guid& pgRootFolderId, Boolean
bCreateSystemCatalogs)
       à Microsoft.SharePoint.SPWeb.CreateWeb(String strWebUrl, String strTitle, String strDescription, UInt32 nLCID, String strWebTemplate, Boolean bCreateUniqueSubweb, Boolean bConvertIfThere)
       à Microsoft.SharePoint.SPWebCollection.Add(String strWebUrl, String strTitle, String strDescription, UInt32 nLCID, String strWebTemplate, Boolean useUniquePermissions, Boolean bConvertIfThere)
       à Microsoft.SharePoint.SPWebCollection_SubsetProxy.Add__Inner(String strWebUrl, String strTitle, String strDescription, UInt32 nLCID, String strWebTemplate, Boolean useUniquePermissions, Boolean bConvertIfThere)
       à Microsoft.SharePoint.SPWebCollection_SubsetProxy.Add(String strWebUrl, String strTitle, String strDescription, UInt32 nLCID, String strWebTemplate, Boolean useUniquePermissions, Boolean bConvertIfThere)
       à System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
       à System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
    Exception rethrown at [0]:
       à System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       à System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       à Microsoft.SharePoint.SPWebCollection_SubsetProxy.Add(String strWebUrl, String strTitle, String strDescription, UInt32 nLCID, String strWebTemplate, Boolean useUniquePermissions, Boolean bConvertIfThere)
       à Microsoft.SharePoint.SPWebCollection.Add__Inner(String strWebUrl, String strTitle, String strDescription, UInt32 nLCID, String strWebTemplate, Boolean useUniquePermissions, Boolean bConvertIfThere)
       à Microsoft.SharePoint.SPWebCollection.Add(String strWebUrl, String strTitle, String strDescription, UInt32 nLCID, String strWebTemplate, Boolean useUniquePermissions, Boolean bConvertIfThere)
       à CreateSubSiteClients.EventReceiver1.EventReceiver1.ItemAdded(SPItemEventProperties properties)
  InnerException: System.Runtime.InteropServices.COMException
       Message=la langue n'est pas prise en charge par le serveur.<nativehr>0x8102005e</nativehr><nativestack></nativestack>
       Source=""
       ErrorCode=-2130575266
       StackTrace:
            à Microsoft.SharePoint.Library.SPRequestInternalClass.CreateWeb(String bstrUrl, String bstrTitle, String bstrDescription, UInt32 nLCID, Boolean bCreateUniqueWeb, Boolean bConvertIfThere, Guid&
pgWebId, Guid& pgRootFolderId, Boolean bCreateSystemCatalogs)
            à Microsoft.SharePoint.Library.SPRequest.CreateWeb(String bstrUrl, String bstrTitle, String bstrDescription, UInt32 nLCID, Boolean bCreateUniqueWeb, Boolean bConvertIfThere, Guid& pgWebId,
Guid& pgRootFolderId, Boolean bCreateSystemCatalogs)
       InnerException:
Regards

Similar Messages

  • How to create xml file from Oracle and sending the same xml file to an url

    How to create xml file from Oracle and sending the same xml file to an url

    SQL/XML (XMLElement, XMLForest, XMLAgg, etc) and UTL_HTTP.
    Whether that works for you with the version of Oracle you have, your requirements, and needs is another story. A little detail goes a long way.

  • Help with the event log in the type B hub

    I have  probs with broadband slowing down and also with link going down a number of times again (it recovers quickly)
    I just wanted to confirm that the message in trhe event log in the type B hub:-
    (134558.700000) RTNL: Received ERROR reply 'No such process' for message type 0x19
    was the link dropping.
    Can anybody confirm this and does anyone know if/where the messages are documented?
    Thanks in advance
    Banz

    does nobody have any comments on this
    Mods - please help
    banz
    ps this is my last bump - I will give up after this

  • Error on creating a subsite from custom template with full control

    I have a site collection and a subsites A and B on it, there is a group 'Managers' that has Read permissions on
    site A. This group has Full control permissions on site B, and I have a solution with custom site definition, lists and feature event receiver that breaks permissions for certain list and sets Read permissions for group 'Visitors'. This list
    is being created when site was created by my custom site definition. But when I try to create a site from this template I get 'Access denied'.  I checked logs, and they say that site was created, every method in my receiver is executed without errors
    but later I see messages about deleting this site. But if I am a
    site collection admin everything works. And another fact is that if I create site without activating feature with event receiver and after creating site I
    manually activate the feature everything works fine. Any ideas?

    Hi,
    For a better troubleshooting, I suggest to do as follows:
    1. Rescope your features so that web application related activity are performed by a web application scoped feature.
    2. Disable the security setting  via PowerShell or a console app.
    function Set-RemoteAdministratorAccessDenied-False()
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration") > $null
    # get content web service
    $contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
    # turn off remote administration security
    $contentService.RemoteAdministratorAccessDenied = $false
    $contentService.Update()
    Set-RemoteAdministratorAccessDenied-False
    Best regards
    Dennis Guo
    TechNet Community Support

  • I have a problem creating a pdf from within Firefox using the print to function.

    I have a problem creating a PDF from within Firefox. I get an error message stating that Adobe PDF creation cannot continue because Acrobat is not activated. Acrobat Pro then opens. If it try to create the PDF again, the same problem. I have FF ver 3.6.10 and Acrobat Pro 8 (from Acrobat CS3).

    This is an Apple user forum, no-one from Apple is here.

  • Creating multiple records from 1 record in the source file for Import DM

    Hi Experts,
    Today I am working on an interface/import where I want to get the following result:
    Source file contains a records like:
    Account, Entity, DriverX
    Sales,EntityA,ZZ
    The BPC appset contains the 2 dimensions Account and Entity next to CostCenter dimension. The DriverX field in the source file is just additional information in the source file. However based on this DriverX we need to determine what CostCenter to choose but we also need to have the same record assigned to a second record in BPC.
    Following my example, based on DriverX value I need to create 2 records:
    Account, Entity, CostCenter,
    Sales,EntityA,CC1
    Sales,EntityA,CC2
    I don't have a problem assigning the record to 1 CostCenter based on DriverX value but I have a problem creating my second record. Does any of you have had the same "challenge" and if so would you like to share the solution for this?
    Best regards,
    Johan
    PS: I am working on SAP BPC, version 7.0 Microsoft version.

    Hi Greg,
    Many thanks for your answer. And yes this would be a solution. However I just simplified my case as the decision to create an second record and where to post is depending on more than 1 field in the source.
    But I will keep it in mind, because I also can opt for a solution to store data differently in BPC fac-tabels which will help me to use script logic.
    If it is not possible to create multiple records from a single records in the standard functionality in the Transformation and/or Conversion file, I have to create a custom DTSX or change my way of storing data.
    Anyone else who is having an alternative idea like Greg came up with?
    Please let it know!
    Best regards,
    Johan

  • Create a Quotation  from a Opportunity using the Follow up functionality

    Hi!
    I'm new at the CRM and I'm trying to reproduce the standard scenario "Opportunity Management". Everithing is going well until i've reached the step to mantain the opportunity and create a quotation. I should do this through the Follow up button on the top of the screen but when i click at this button, i can not see any transaction for a quotation; I can only find appointment ( date, interaction record, business activity), email (outgoing email), interaction log (Business Activity with prod., channel report, ... ) and Task (approve, Req. to brand owner, ...).
    Can anyone give me a hint about what can I do to make quotation transactions appear in this new window (from the follow up button)?
    Thanks in advance!
    Ines Andres

    Hi Inês,
    Please check if you have successfully configured  the copy control between opportunity and quotation in the following paths:
    Transaction Types:
    SPRO->Customer Relationship Management->Transactions->Basic Settings->Copying Control for Business Transactions->Define Copying Control for Transaction Types
    Item Categories:
    SPRO->Customer Relationship Management->Transactions->Basic Settings->Copying Control for Business Transactions->Define Copying Control for Item Categories
    I hope it helps!
    Kind Regards,
    Gabriel Santana

  • Imovie 11: When moving clips from event to project, the top of the video clip is cut off.

    I'm working with a new project. When I add clips from an event to the project window, the top of the video clip is cut off.  Quite a bit of it is cut off.  It happens on every clip.  The aspect ratio is correct and I've set the video to fit in frame.  How can I fix this?  I would really appreciate any help.

    You may have stabilization turned on in the project. On one of the clips, click on the small gear icon at the start of the clip and select Clip Adjustments. In the Inspector that opens, uncheck the box "Smooth Clip Motion" against Stabilization. If this fixes it for you, do the same for the other clips.
    Also, it's a good idea to turn off certain preferences in iMovie>Preferences (an iMovie menu item). In the Browser tab uncheck the boxes for both "Automatically stabilize clips that have been analyzed" and "Apply rolling shutter correction for clips that have been analyzed". See this picture:
    The stabilization process causes a zoomed in effect on the video, as it has to "average" the pixels in order to smooth any shaky motion. You therefore lose a certain amount of the picture, depending on the extent of stabilization applied. Here's what iMovie Help states (in part) about this process:
    "iMovie stabilizes video by analyzing the camera motion in the video and then moving the picture the opposite way to steady it onscreen. In this process, iMovie zooms in on the picture slightly. The amount of unstable motion in the clip determines how much zooming is necessary.
    Zooming in crops out some of the picture, but you can fine-tune the level of stabilization to strike the right balance between keeping the video steady and retaining as much of the picture as possible."
    John

  • Function module to create query view from technical name of the query ?

    Hi Experts,
    I am trying to create webservice definition using function module.
    In this code, I am calling function module 'RSCRMBW_REPORT' which requires query view name ( we can see this in RSCRM_BAPI) as a value for parameter i_reportuid.
    For the time being I am hardcoding the value but I need to use a function module which will convert techincal name of query into query view.
    Can anyone have any idea about the above requirement? Or is there any other way to solve the problem?
    Thanks in advance
    Shamkant
    Edited by: SHAMKANT SONAWANE on Apr 7, 2009 5:38 AM

    Hi,
    You can use FMs CONVERSION_EXIT_GENID_INPUT  and CONVERSION_EXIT_GENID_OUTPUT to get query view.
    First call FM CONVERSION_EXIT_GENID_INPUT with parameter input as query technical name then it will return Output in the form of GENID .
    Pass this GENID as input parameter to FM CONVERSION_EXIT_GENID_OUTPUT to get query view as output.
    Eg :
    Test for function group      RRI5
    Function module              CONVERSION_EXIT_GENID_INPUT
    Uppercase/Lowercase
    Runtime:        6,652 Microseconds
      Import parameters               Value
      INPUT                           Y0IC_C03_Q0018_2
      Export parameters               Value
      OUTPUT                          4D1I916ID7TWS1CK27154WYZ8
    Test for function group      RRI5
    Function module              CONVERSION_EXIT_GENID_OUTPUT
    Uppercase/Lowercase
    Runtime:        2,818 Microseconds
      Import parameters               Value
      INPUT                           4D1I916ID7TWS1CK27154WYZ8
      Export parameters               Value
      OUTPUT                          0IC_C03/Y0IC_C03_Q0018_2
    0IC_C03/Y0IC_C03_Q0018_2 is expected query view.
    Hope it helps...
    regards,
    Raju

  • How do I create a collectio from developed images in the develop module of Lightroom 5?

    How do I create a collestion of developped and modified images in the develop module of Lightroom 5

    Right-click on Tone Curve and choose basic again or press Ctrl+1 in Develop.
    On Mac (Control-Click or Cmd+1)

  • Create an mp4 from mov without changing the dimensions

    I am working on a project in InDesign that needs to output to DPS.
    I take screen capture movies which are saved in the default mov format. These movies are 700 px x 400 px. That can't change.
    I need to convert the mov to an mp4 to add to ID for DPS.
    I open Adobe Media Encoder but I am confused as to how to set the output controls.
    I don't want to change the dimensions.
    What setting will convert the mov to mp4 without changing the dimensions?

    Does this help?

  • When attempting to "print" to Adobe or create a pdf from a web page, the "pring/pdf" result has a bunch of unrecognizable characters on the page rather than letters/numbers

    here is an example
    !@#$$$%#@!@$%^^%

    You could open it in the XPS application and check print preview to see if it comes out as TSN suggests (and likely will). You can go to the printer properties and adjust the page size accordingly.
    You can also use the cropping in Acrobat to size all the pages and then use the Protect>Remove Hidden option to remove the cropped area.

  • When attempting to "print" to Adobe or create a pdf from a web page, the "print/pdf" result has a bunch of characters/jibberish on the page rather than recognizable letters/numbers

    What is causing this?

    You could open it in the XPS application and check print preview to see if it comes out as TSN suggests (and likely will). You can go to the printer properties and adjust the page size accordingly.
    You can also use the cropping in Acrobat to size all the pages and then use the Protect>Remove Hidden option to remove the cropped area.

  • I have Mac os10 yosemite and with photoshop elements 13 I cannot get a menu from Print to change the type of paper.  Where is that menu  The one that comes up only alows for paper size not type

    After clicking print the menu that comes up does not allow for a change in paper type.  Where can I change the paper type. OS 10.10 Yosemite with Photoshop Elements 13.  I have a windows computer with the same program and the print menu has a paper settings option but not on the the mac.  What gives.  Is the Elements 13 not compatible with the OS 10 Yosemite?  Thanks for any help

    If you delete all the Adobe Reader stuff it will probably fix this. For almost everything, the Apple pdf handling works better.

  • Why the drag and drop of clips from events browser to project browser isn't working any more

    My iMovie was working fine, but suddenly I'm not able any more to drag and drop select parts of a clip from event browser to the project browser. I read other people got this issue. Is there a solution? Thanks a lot

    I had the same problem. Fixed it by repairing disk permissions with disk utility.

Maybe you are looking for

  • Opening an applet from an applet

    Is it possible to press a button on one applet and open another, i cant seem to get it to work!

  • How to make the document type in OAC2 as a parameter

    In Generic Object Services, when I choose Store Business document to manually attach word files from my desktop to a sales order, the filename which I choose is not displayed with the same name in the attachment list. It takes the document type name

  • Lion Installed: Internal speakers muted and cannot be adjusted thru the audio pane.

    I installed Lion yesterday and spent considerable time looking for an online solution to no avail. The online info suggests to re-install the OS from the disk supplied with the laptop, but would be re-installing Snow Leopard... mmm The quick fix is t

  • Cant open my iTunes account in Peru

    Had previously downloaded and used iTunes in english in the States.  Am now in Peru and it will not allow me to open saying I have to open in english. Any suggestions? Thanks

  • Allowing duplication of invoices

    Hi system allows me to create an invoice document for the second time with the same PO reference. 1 Double invoice check box is activated in vendor master 2 Check for dupliacation of invoices is activated in incoming invoice of LIV. Please find the s