1

I'm trying to figure out a way to generate a new Guid upon field creation without using event handling.

I.e something like this

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Field ID="{a35657bf-c5af-4e86-a0a9-4c378e26ec2b}" Group="Membership" Name="UserId" DisplayName="Användarid" Type="Guid" ReadOnly="TRUE">
    <DefaultValue>=[System.Guid]::NewGuid()</DefaultValue>
  </Field>
</Elements>

There is of course already the GUID column that I could copy the Guid from but I'm not sure if that is possible or how that would be done without using event handling.

Any advices?

Thanks

1 Answer 1

0

I don't think there is any way to declaratively set anything like this (as technically it would no longer be declarative).

Doing this in a feature receiver is a trivial task, however.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.