Person Picker

Jun 30, 2009 at 7:26 AM
Edited Jun 30, 2009 at 7:28 AM

Hello again,

I am trying to slam a person picker field but i´m not able. This is my configuration file:

<?xml version="1.0" encoding="utf-8" ?>
<Configuration>
  <ConnectionStrings Default="SLAM">
    <add Name="SLAM" ConnectionString="Database=SLAMTest;Data Source=svcaptor01;User Id=SlamTest;Password=SlamTest01"/>
  </ConnectionStrings>

  <DataMapping DataSchema="SLAM">
    <List Site="Inventario" Name="Inventario PC" ActivationOrder="1">
      <Fields>
        <Field Name="Codigo_PC" SqlType="varchar(4)" SPType="Text" Required="true"></Field>

        <ContentType Name="Usuario" TableName="Users" ActivationOrder="2">
          <Fields>
            <Field Name="Account" Column="UserName" SqlType="varchar(255)" SPType="Text" Required="false"></Field>
            <Field Name="Title" Column="Name" SqlType="varchar(255)" SPType="Text" Required="false"></Field>
          </Fields>
        </ContentType>       
       
      </Fields>
    </List>
  </DataMapping>
</Configuration> 

 

All fields match ok except this:

Unmatched Fields
Inventario - Inventario PC: Account
What is worng with my configuration file?.
Thank you.
Flavio Escalante

Developer
Jul 6, 2009 at 4:32 PM

Modify your config to look something like:

<?xml version="1.0" encoding="utf-8" ?>
<Configuration>
  <ConnectionStrings Default="SLAM">
    <add Name="SLAM" ConnectionString="Database=SLAMTest;Data Source=svcaptor01;User Id=SlamTest;Password=SlamTest01"/>
  </ConnectionStrings>

  <DataMapping DataSchema="SLAM">
    <List Site="Inventario" Name="Inventario PC" ActivationOrder="1">
      <Fields>
        <Field Name="Codigo_PC" SqlType="varchar(4)" SPType="Text" Required="true"></Field>
        <Field Name="Usuario" SPType="Person" AssociatedList="Users" AssociationName="InventarioUsuarios"></Field>      </Fields>
    </List>
    <ContentType Name="Usuario" TableName="Users" ActivationOrder="2">
        <Fields>
            <Field Name="Account" Column="UserName" SqlType="varchar(255)" SPType="Text" Required="false"></Field>
            <Field Name="Title" Column="Name" SqlType="varchar(255)" SPType="Text" Required="false"></Field>
        </Fields>
    </ContentType>        

</DataMapping>
</Configuration>

 

I am making a guess here that Usuario is the Spanish translation of the "Person" content type, and that it is also the name of your Person column in the Inventario list.  So you want to slam the list and the content type separately then you can treat the Person field as a lookup, as an association.  SLAM will create an association table with the same name as "AssociationName" and will contain a column for the Guid List Item IDs of Inventario list items and another column for Guid List Item IDs for list items in the User Information List.  You can alternatively just SLAM your Usuario column as text.  In either case, a Content Type cannot be configured to slammed inside of the Fields node of another type as you had done.

 

Thanks,

-Brian

Jul 7, 2009 at 6:47 AM

Hi Brian,

This solved my problem.

Thank you again.

 

Flavio.