How to refresh/apply column value default setting on current files or folders

Hi All
I have set-up default column data per folder in my library (via
Library Settings > Column default settings) and it works great for new documents or folders that are added to the library.
But what do I do if I have an existing Library with folders and files and need to apply default column data to each? Is there a way of "refreshing" the default columns so that the data is populated through a specific folder and/or its sub-folders?
(I really hope this is an easy fix or just a setting that I over-looked somewhere!)
Thank you!

I had to do this as well recently, and remembered your post.
Here is the function I wrote , this worked for text, choice, and metadata columns
It is pretty slow and could be optimized and broken up into more functions, but I had to do several things:
1. I mass-updated the content types in a library
2. On Library settings : set default values and also different defaults per folder
3. For each file I then needed to:
3.a. either copy the value from a column in the old content type to the new, or
3.b. set the column to the default
so this function does step 3, like I said it works for certain types of columns and can be sped up (I used it to update 700 files in a couple minutes), and it makes some assumptions about the environment but this at least is a starting point.
As Alex said you may want to change SystemUpdate($true) to just Update(), depending on your requirements.
<#
.SYNOPSIS
Resets columns in a document library to defaults for blank columns. Use this
after changing the content types or adding columns to a doc lib with existing files
.DESCRIPTION
Resets columns in a doc lib to their defaults. Will only set them if the columns are blank (unless overridden)
Will also copy some values from one column to another while you are there.
Can restrict the update to a subset of columns, or have it look for all columns with defaults.
Will use the list defaults as well as folder defaults.
All names of columns passed in should use InternalName.
This has ONLY been tested on Text, Choice, Metadata, and mult-Choice and Mult-Metadata columns
Pass in a list and it will recursively travel down the list to update all items with the defaults for the items in that folder.
If you call it on a folder, it will travel up the tree of folders to find the proper defaults
Author:
Chris Buchholz
[email protected]
@plutosdad
.PARAMETER list
The document library to update. Using this parameter it will update all files in the doc lib
.PARAMETER folder
The folder containing files to update. Function will update all files in this folder and subfolders.
.PARAMETER ParentFolderDefaults
Hashtable of internal field names as KEY, and value VALUE, summing up all the parent folders or list defaults.
If not supplied, then the function will travel up the tree of folders to the parent doclib to determine
the correct defaults to apply.
If the field is managed metadata, then the value is a string
Currently only tested for string and metadata values, not lookup or date
.PARAMETER termstore
The termstore to use if you are going to update managed metadata columns, this assumes we are only using the one termstore for all columns to update
If you are using the site collection specific termstore for some columns you want to update, and
the central termstore for others, then you should call this method twice, once with each termstore,
and specify the respective columns in fieldsToUpdate
.PARAMETER fieldsToCopy
Hashtable of internal field names, where KEY is the "to" field, and VALUE is the "from" field
Use this to copy values from one field to another for the item.
These override the defaults, and also cause the "from" (Value) fields to NOT be overwritten with defaults even if
they are in the fieldsToUpdate array.
Example: @{"MyNewColumn" = "My_x0020_Old_x0020_Column"}
.PARAMETER fieldsToUpdate
If supplied then the method will update only the fields in this array to their default values, if null then it will update
all fields that have defaults.
If you pass in an empty array, then this method will only copy fields in the fieldtocopy and not
apply any defaults
Example: @() - to only copy and not set any fields to default
Example2: @('UpdateField1','UpdateField2') will
.EXAMPLE
Set-SPListItemValuesToDefaults -list $list -fieldsToCopy @{"MyNewColumn" = "My_x0020_Old_x0020_Column"} -fieldsToUpdate @() -overwrite -termStore $termStore
This will not set any defaults, but instead only set MyNewColumn to non null values of My_x0020_Old_x0020_Column
It will overwrite any values of MyNewColumn
.EXAMPLE
Set-SPListItemValuesToDefaults -list $list -overwrite
This will set all columns to their default values even if they are filled in already
.EXAMPLE
Set-SPListItemValuesToDefaults -folder $list.RootFolder.SubFolder[3].SubFolder[5]
This will set all columns to their defaults in the given subfolder of a library
.EXAMPLE
Set-SPListItemValuesToDefaults -list $list -fieldsToUpdate @('ColumnOneInternalName','ColumnTwoInternalName')
This will set columns ColumnOneInternalName and ColumnTwoInternalName to their defaults for all items where they are currently null
.EXAMPLE
Set-SPListItemValuesToDefaults -list $list -fieldsToCopy @{"MyNewColumn" = "My_x0020_Old_x0020_Column"} -fieldsToUpdate @("MyNewColumn") -termStore $termStore
This will set all MyNewColumn values to their default, and then also copy the values of My_x0020_Old_x0020_Column to MyNewColumn where the old column is not null,
but both of these will only happen for items where MyNewColumn is null
.EXAMPLE
Set-SPListItemValuesToDefaults -list $list -fieldsToCopy @{"MyNewColumn" = "My_x0020_Old_x0020_Column"} -termStore $termStore
This will set ALL columns with defaults to the default value (if the item's value is null),
except for My_x0020_Old_x0020_Column which will not be modified even if it has a default value, and will also set MyNewColumn to the
value of My_x0020_Old_x0020_Column if the old value is not null
#>
function Set-SPListItemValuesToDefaults {
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true,ValueFromPipeline=$true,ParameterSetName="List")][Microsoft.SharePoint.SPList]$list,
[Parameter(Mandatory=$true,ValueFromPipeline=$true,ParameterSetName="Folder")][Microsoft.SharePoint.SPFolder]$folder,
[Parameter(Mandatory=$false,ParameterSetName="Folder")][HashTable]$ParentFolderDefaults,
[Parameter(Mandatory=$false)][HashTable]$fieldsToCopy,
[Parameter(Mandatory=$false)][Array]$fieldsToUpdate,
[Parameter(Mandatory=$false)][Microsoft.SharePoint.Taxonomy.TermStore]$termStore,
[Switch]$overwrite,
[Switch]$overwriteFromFields
begin {
#one or both can be null, but if both empty, then nothing to do
if ($null -ne $fieldsToUpdate -and $fieldsToUpdate.Count -eq 0 -and
( $null -eq $fieldsToCopy -or $fieldsToCopy.Count -eq 0)) {
Write-Warning "No fields to update OR copy"
return
if ($PSCmdlet.ParameterSetName -eq "Folder") {
$list = $folder.DocumentLibrary
if ($null -eq $termStore ) {
$taxonomySession = Get-SPTaxonomySession -site $list.ParentWeb.Site
$termStores = $taxonomySession.TermStores
$termStore = $termStores[0]
#if we did not pass in the parent folder defaults then we must go backward up tree
if ($PSCmdlet.ParameterSetName -eq "Folder" -and $null -eq $ParentFolderDefaults ) {
$ParentFolderDefaults = @{}
if ($null -eq $fieldsToUpdate -or $fieldsToUpdate.Count -gt 0) {
write-Debug "ParentFolderDefaults is null"
$tempfolder=$folder.ParentFolder
while ($tempfolder.ParentListId -ne [Guid]::Empty) {
Write-Debug "at folder $($tempfolder.Url)"
$pairs = $columnDefaults.GetDefaultMetadata($tempfolder)
foreach ($pair in $pairs) {
if (!$ParentFolderDefaults.ContainsKey($pair.First)) {
Write-Debug "Folder $($tempfolder.Name) default: $($pair.First) = $($pair.Second)"
$ParentFolderDefaults.Add($pair.First,$pair.Second)
$tempfolder = $tempfolder.ParentFolder
#listdefaults
Write-Debug "at list"
foreach ($field in $folder.DocumentLibrary.Fields) {
if ($field.InternalName -eq "_ModerationStatus") { continue }
#$field = $list.Fields[$name]
if (![String]::IsNullOrEmpty($field.DefaultValue)) {
#Write-Verbose "List default found key $($field.InternalName)"
if (!$ParentFolderDefaults.ContainsKey($field.InternalName)) {
Write-Debug "List Default $($field.InternalName) = $($field.DefaultValue)"
$ParentFolderDefaults.Add($field.InternalName,$field.DefaultValue)
process {
Write-Debug "Calling with $($PSCmdlet.ParameterSetName)"
Write-Debug "Parent folder hash has $($ParentFolderDefaults.Count) items"
if ($PSCmdlet.ParameterSetName -eq "List" ) {
$folder = $list.RootFolder
$ParentFolderDefaults=@{}
if ($null -eq $fieldsToUpdate -or $fieldsToUpdate.Count -gt 0) {
foreach ($field in $list.Fields) {
if ($field.InternalName -eq "_ModerationStatus") { continue }
if (![String]::IsNullOrEmpty($field.DefaultValue)) {
Write-Debug "List Default $($field.InternalName) = $($field.DefaultValue)"
$ParentFolderDefaults.Add($field.InternalName,$field.DefaultValue)
Write-Verbose "At folder $($folder.Url)"
$FolderDefaults=@{}
$FolderDefaults += $ParentFolderDefaults
if ($null -eq $fieldsToUpdate -or $fieldsToUpdate.Count -gt 0) {
$pairs = $columnDefaults.GetDefaultMetadata($folder)
foreach ($pair in $pairs) {
if ($FolderDefaults.ContainsKey($pair.First)) {
$FolderDefaults.Remove($pair.First)
Write-Debug "Folder $($folder.Name) default: $($pair.First) = $($pair.Second)"
$FolderDefaults.Add($pair.First,$pair.Second)
#set values
foreach ($file in $folder.Files) {
if ($file.CheckOutType -ne [Microsoft.SharePoint.SPFile+SPCheckOutType]::None) {
Write-Warning "File $($file.Url).CheckOutType = $($file.CheckOutType)) ... skipping"
continue
$item = $file.Item
$ItemDefaults=@{}
$ItemDefaults+= $FolderDefaults
#if we only want certain fields then remove the others
#Move this to every time we add values to the defaults
if ($null -ne $fieldsToUpdate ) {
$ItemDefaults2=@{}
foreach ($fieldInternalName in $fieldsToUpdate) {
try {
$ItemDefaults2.Add($fieldInternalName,$ItemDefaults[$fieldInternalName])
} catch { } #who cares if not in list
$ItemDefaults = $ItemDefaults2
#do not overwrite already filled in values unless specified
if (!$overwrite) {
$keys = $itemDefaults.Keys
for ($i=$keys.Count - 1; $i -ge 0; $i-- ) {
$key=$keys[$i]
try {
$val =$item[$item.Fields.GetFieldByInternalName($key)]
if ($val -ne $null) {
$ItemDefaults.Remove($key)
} catch {} #if fieldname does not exist then ignore, we should check for this earlier
#do not overwrite FROM fields in copy list unless specified
if (!$overwriteFromFields) {
if ($null -ne $fieldToCopy -and $fieldsToCopy.Count -gt 0) {
foreach ($value in $fieldsToCopy.Values) {
try {
$ItemDefaults.Remove($value)
} catch {} #who cares if not in list
#do not overwrite TO fields in copy list if we're going to copy instead
if (!$overwriteFromFields) {
if ($null -ne $fieldToCopy -and $fieldsToCopy.Count -gt 0) {
foreach ($key in $fieldsToCopy.Keys) {
$fromfield = $item.Fields.GetFieldByInternalName($fieldsToCopy[$key])
try {
if ($null -ne $item[$fromfield]) {
$ItemDefaults.Remove($key)
} catch {} #who cares if not in list
Write-Verbose $item.Url
$namestr = [String]::Empty
if ($ItemDefaults.Count -eq 0) {
write-Verbose "No defaults, copy only"
} else {
$str = $ItemDefaults | Out-String
$namestr += $str
Write-Verbose $str
if ($null -ne $fieldsToCopy -and $fieldsToCopy.Count -gt 0) {
$str = $fieldsToCopy | Out-String
$namestr +=$str
if ($PSCmdlet.ShouldProcess($item.Url,"Set Values: $namestr"))
#defaults
if ($null -ne $ItemDefaults -and $ItemDefaults.Count -gt 0) {
foreach ($key in $ItemDefaults.Keys) {
$tofield = $item.Fields.GetFieldByInternalName($key)
if ($tofield.TypeAsString -like "TaxonomyFieldType*") {
$taxfield =[Microsoft.SharePoint.Taxonomy.TaxonomyField]$tofield
$taxfieldValue = New-Object Microsoft.SharePoint.Taxonomy.TaxonomyFieldValue($tofield)
$lookupval=$ItemDefaults[$key]
$termval=$lookupval.Substring( $lookupval.IndexOf('#')+1)
$taxfieldValue.PopulateFromLabelGuidPair($termval)
if ($tofield.TypeAsString -eq "TaxonomyFieldType") {
$taxfield.SetFieldValue($item,$taxfieldValue)
} else {
#multi
$taxfieldValues = New-Object Microsoft.SharePoint.Taxonomy.TaxonomyFieldValueCollection $tofield
$taxfieldValues.Add($taxfieldValue)
$taxfield.SetFieldValue($item,$taxfieldValues)
} else {
$item[$field]=$ItemDefaults[$key]
#copyfields
if ($null -ne $fieldsToCopy -and $fieldsToCopy.Count -gt 0) {
#$fieldsToCopy | Out-String | Write-Verbose
foreach ($key in $fieldsToCopy.Keys) {
$tofield = $item.Fields.GetFieldByInternalName($key)
$fromfield = $item.Fields.GetFieldByInternalName($fieldsToCopy[$key])
if ($null -eq $item[$fromfield] -or ( !$overwrite -and $null -ne $item[$tofield] )) {
continue
if ($tofield.TypeAsString -eq "TaxonomyFieldType" -and
$fromfield.TypeAsString -notlike "TaxonomyFieldType*" ) {
#non taxonomy to taxonomy
$taxfield =[Microsoft.SharePoint.Taxonomy.TaxonomyField]$tofield
$termSet = $termStore.GetTermSet($taxfield.TermSetId)
[String]$fromval = $item[$fromfield]
$vals = $fromval -split ';#' | where {![String]::IsNullOrEmpty($_)}
if ($null -ne $vals -and $vals.Count -ge 0 ) {
$val = $vals[0]
if ($vals.Count -gt 1) {
write-Warning "$($item.Url) Found more than one value in $($fromfield.InternalName)"
continue
$terms =$termSet.GetTerms($val,$true)
if ($null -ne $terms -and $terms.Count -gt 0) {
$term = $terms[0]
$taxfield.SetFieldValue($item,$term)
Write-Verbose "$($tofield.InternalName) = $($term.Name)"
} else {
Write-Warning "Could not determine term for $($fromfield.InternalName) for $($item.Url)"
continue
} elseif ($tofield.TypeAsString -eq "TaxonomyFieldTypeMulti" -and
$fromfield.TypeAsString -notlike "TaxonomyFieldType*" ) {
Write-Debug "we are here: $($item.Name): $($fromfield.TypeAsString) to $($tofield.TypeAsString )"
#non taxonomy to taxonomy
$taxfield =[Microsoft.SharePoint.Taxonomy.TaxonomyField]$tofield
$termSet = $termStore.GetTermSet($taxfield.TermSetId)
$taxfieldValues = New-Object Microsoft.SharePoint.Taxonomy.TaxonomyFieldValueCollection $tofield
[String]$fromval = $item[$fromfield]
$vals = $fromval -split ';#' | where {![String]::IsNullOrEmpty($_)}
foreach ($val in $vals){
$terms =$termSet.GetTerms($val,$true)
if ($null -ne $terms -and $terms.Count -gt 0) {
$term=$terms[0]
$taxfieldValue = New-Object Microsoft.SharePoint.Taxonomy.TaxonomyFieldValue($tofield)
$taxfieldValue.TermGuid = $term.Id.ToString()
$taxfieldValue.Label = $term.Name
$taxfieldValues.Add($taxfieldValue)
} else {
Write-Warning "Could not determine term for $($fromfield.InternalName) for $($item.Url)"
continue
#,[Microsoft.SharePoint.Taxonomy.StringMatchOption]::ExactMatch,
$taxfield.SetFieldValue($item,$taxfieldValues)
$valsAsString = $taxfieldValues | Out-String
Write-Debug "$($tofield.InternalName) = $valsAsString"
} elseif ($tofield.TypeAsString -eq "TaxonomyFieldTypeMulti" -and
$fromfield.TypeAsString -eq "TaxonomyFieldType" ) {
#single taxonomy to multi
$taxfieldValues = New-Object Microsoft.SharePoint.Taxonomy.TaxonomyFieldValueCollection $tofield
$taxfield =[Microsoft.SharePoint.Taxonomy.TaxonomyField]$tofield
$taxfieldValues.Add($item[$fromfield])
$taxfield.SetFieldValue($item,$taxFieldValues)
Write-Verbose "$($tofield.InternalName) = $valsAsString"
} elseif ($tofield.TypeAsString -eq "TaxonomyFieldType" -and
$fromfield.TypeAsString -eq "TaxonomyFieldTypeMulti" ) {
#multi taxonomy to single taxonomy
Write-Warning "multi to non multi - what to do here"
continue
} elseif ($tofield.TypeAsString -eq "Lookup" -and
$fromfield.TypeAsString -ne "Lookup" ) {
#non lookup to lookup
Write-Warning "non lookup to lookup - still todo"
continue
} else {
#straight copy
$item[$tofield] = $item[$fromfield]
$item.SystemUpdate($false)
$folders = $folder.SubFolders | where name -ne "Forms"
$folders | Set-SPListItemValuesToDefaults -ParentFolderDefaults $FolderDefaults -fieldsToCopy $fieldsToCopy -fieldsToUpdate $fieldsToUpdate -overwrite:$overwrite -overwriteFromFields:$overwriteFromFields -termStore $termStore

Similar Messages

  • How to get the kerning value and set it to back use script?

    hi,guys
    I come back again.
    I encountered a kerning problem.
    how to get the kerning value and set it to back use script?
    Thanks very much!

    For both cases, the filename can be found on the FILE.ReceivedFileName Context Property.  You can access this Property in a Pipeline Component or Orchestration and take any action you want, such as apply to a database.
    The value is accessed by: MyReceivedMessage(FILE.ReceivedFileName)
    In the case of a duplicate EDI Interchange, you would use the Failed Message Routing feature to capture the error message with either an Orchestration or Send Port.

  • How to refer a column value of a single row in conditional column display?

    Hello,
    does anybody have an idea, how i can refer a column value of a single row in conditional display of a column?
    So my idea is, that a report has a column, which value is only displayed, when another column value of this row has a specific value.
    I want to solve this problem with condition type: PL/SQL Function Body returning a boolean.
    But I do not know how to refer the column value of each single row!
    Thank you,
    Tim

    Here's a solution that, to me, seems easier to implement but, that's, of course, in the eye of the implementer.
    Rather than using APEX to generate a link column for you, actually create the link as part of your SQL.
    select '<a href="f?p=102:3:491847682940364::::P3_CONTACT_ID:' || CONTACT_ID || "><img src="/i/themes/theme_1/ed-item.gif" alt="Edit"></a>' CONTACT_LINK, ...
    etc.
    Test this out. You'll see that it works just like making a column a link using the column attributes.
    Next, we'll change the SQL to use a DECODE statement to either display the link or nothing depending on what your criteria is. For example, let's assume you only want a link for active contacts.
    select Decode( CONTACT_STATUS, 'A', '<a href="f?p=102:3:491847682940364::::P3_CONTACT_ID:' || CONTACT_ID || "><img src="/i/themes/theme_1/ed-item.gif" alt="Edit"></a>', NULL ) CONTACT_LINK, ...
    etc.
    This will not display the link in any rows in which the CONTACT_STATUS is not active, i.e. "A"
    -Joe

  • How to save a new value for Set command variable

    I am using SET [variable = [String]] to update Set variable. It works fine. But when I restart MSDOS Prompt, I get old value for variable.
    How to save a new value for SET command variable?
    I am using Windows XP.

    And this has to do with java how?

  • How can I bring back the default setting in photshop elements 4.0

    HP Pavilion desktop M7240UK
    Monitor HP vs19 LCD
    Windows XP
    Explorer 8
    Service Pack 3
    Photoshop Elements 4.0
    Hi
    How can I bring back the default setting in Photoshop elements 4.0
    Thank You
    York44

    In the editor? Quit the editor , then restart it while holding down Ctrl+Alt+Shift. Keep holding the keys till you see a window asking if you want to delete the settings file. You do.

  • How to get the column values

    hi
    i am new to programming... i would like to know how to get the column values... i have a resultset object
    i need code .... asap
    thnx

    @OP: It is always good to type complete sentences and describe your problem at length. It helps in letting people know what you really need instead of making wild guesses or silly jokes. You post mentions that you get the ResultSet. Then you should look up the API docs for java.sql.ResultSet and take a look at the getxxx() method signatures. Use the ones which suit the specific case.
    Besides, it is good to refrain from using asap and urgent. Even if something is urgent to you, it need not be urgent to others. Wording a question properly would attract better replies.
    Finally, would you mind getting down to specifics of your problem? From what I perceived, the JDBC tutorial and the API docs should provide all the information you need.

  • How do I make Pages the default program for .doc files?

    How do I make Pages the default program for .doc files without having the need to change the default program for each individual.doc file?

    Navigate to a .doc file.
    Ctrl click the file
    Choose Open with and then go down the list, past pages, to other
    Navigate to pages
    Before you click Open make sure you click the 'Always open with' check box.
    You should be okay.
    You can do a similar think by selecting the file, Choosing File-Get Info
    Then open the Open With Disclosure triangle.
    select pages and then click CHANGE ALL
    Hope this hleps.
    M.

  • How can I Sync a folder (which contains all types files, sub folders and weighs some gigs) through wifi or USB ( and not using cloud services) between my New Ipad and Win 7 PC? Any apps available? Kindly help

    How can I Sync a folder (which contains all types files, sub folders and weighs some gigs) through wifi or USB ( and not using cloud services) between my New Ipad and Win 7 PC? Any apps available?
    kindly suggest a solution.
    Thank you inadvance!

    You can only import photos/videos via USB and the camera connection kit.
    ITunes: Syncing media content to your iOS devices
    http://support.apple.com/kb/ht1351
     Cheers, Tom

  • How to get the column values from a BC4J View Table in UIXML?

    I am using a default UiXML Application for Order Entry system with Orders & Order Lines & Customers. I have a uix file OrdersView1_View.uix which displays (no updateable columns) all the Orders. How do I get the column value of a selected row in a BC4J Table (example:OrdersId) when a Submit button is pressed using UIXML or Java Classes?
    I appreciate any help on this.

    Hi,
    You need to use keyStamp, an example:
    <bc4j table name="orders">
    <bc4j:keyStamp>
    <bc4j:rowKey name="key" />
    </bc4j:keyStamp>
    Furthermore, you can automatically send the selected row key using the go event handler, so in the handlers section you could send the key to an orderInfo page:
    <event name="show">
    <!-- forward to the update page, passing
    the selected key as a page property -->
    <ctrl:go name="orderInfo" redirect="true">
    <ctrl:property name="key">
    <ctrl:selection name="orders" key="key" />
    </ctrl:property>
    </ctrl:go>
    </event>

  • How to get Metadata column values using powershell(CSOM)

    Hi,
    I am trying to get list column values using Powershell (CSOM), but I am getting for Metata data columns.
    I am getting internal value as System.Collections.Generic.Dictionary`2[System.String,System.Object] 
    Can anybody let me know how to get the values for metadata columns?
    Any help would be greatly appreciate.
    Thank you.
    AA.

    Hi
    Go through the links. It'll help.
    SharePoint 2013 Code Tips – Setting a Managed Metadata Field with the Client Object Model(CSOM and JSOM)
    Indul Hassan
    Microsoft Community Contributor
    http://www.indulhassan.com
    You Snooze.. You Lose !!

  • How to tell if column value has changed for use in workflow actions

    Hello,
    I am using Sharepoint 2010 and for one of my Lists, I am using a general list workflow.  What I need to be able to do is determine if a column value has change (say an "Assigned To" field) because I only want to take some action if that particular
    value has changed.  I want to be able to have a workflow action that would be something like:
    If Current Item: Assigned To not equals [OLD VALUE]
    I have found some web searches that talk about creating a duplicate list or duplicate (but hidden) column but that doesn't seem to be the way to go.  I have document versioning set but don't if that can be used to help with this.  One possible
    thought (although I haven't tried it to see if it works) is to create local variables and have the values in the variables be the "old value".  Just not sure if there is a best practices for doing this.
    Thanks for any thoughts - Peter

    Helen,
    Not sure I fully understand your goal.  We don't use "tasks" at all but if you are looking to have your workflow check certain valus and be able to send email messages to people based on whatever, then you can certainly do that (as long as your Sharepoint
    has the email setup.  We do this for alot of workflow tasks.
    So, in the workflow you can have a blanket statement like what I previously listed:
    if Current Item:hiddenStatus  not equals Current Item:Status
        .... do something
    or you can do something like:
    if Current Item:hiddenStatus equals "In-Progress"
        .... do something
    Else if Current Item:hiddenStatus  equals "Completed"
        .... do something
    or combine the two and do nested "if" statements.  Then you add an email statement wherever you need it like:
    if Current Item:hiddenStatus  equals "Completed"
       then email "these users"
    To add the email part, just type in "email" on the line where you want to add a statment.  There is only one option to choose from.  That will display the line "then email these users".   The "these users" will be a link.  When you
    click it you will get a popup to add the email info.  We typically will send the email to a user (or users) that are already listed in one of the PeoplePicker fields.  On the email form, you can type in your own text, designate that a value is based
    on a column value (like our PeoplePicker), designate that a value is based on a workflow variable, add a link to the current item, etc.  To get to these options you will click the button to the right of the fields or use the "Add or Change Lookup" button
    in the bottom-left for the text area.  There is alot you can set in the mail.
    Does this help answer your question?
    - Peter

  • How to get one column value from a DOCUMENT TYPE attribute

    Hi,
    I have created a DOCUMENT TYPE attribute which queries from a table and all the column values( For Ex: Customer Name, Contact Name and Address) are displayed in the message body.
    I want one column value(For Ex: Customer Name) to be displayed in the SUBJECT of the message.
    How can this be done? Please let me know.
    Thanks in advance.

    Thanks Matt. I have used SETITEMATTRTEXT to get a single column value into an ITEM ATTRIBUTE.
    Please see the following procedure...
    ==========================================================
    PROCEDURE MisNotifyDataDesk(
         itemtype IN VARCHAR2
         , itemkey IN VARCHAR2
         , actid IN NUMBER
         , funcmode IN VARCHAR2
         , resultout OUT VARCHAR2
         ) IS
    p_Cart_Id               VARCHAR2(30);
    p_ORG_NAME                     VARCHAR2(360);
    BEGIN
         IF funcmode != WF_ENGINE.ENG_RUN THEN
              wf_log_pkg.string(5,'Notify_Cust_Data_Desk','Not in RUN mode');
         RETURN;
         END IF;
    p_Cart_Id := WF_ENGINE.GetItemAttrText ( itemtype => itemtype
    , itemkey => itemkey
    , aname => 'CART_ID' );
    p_code_position := 10;
         SELECT
              ORG_NAME
         INTO
              p_ORG_NAME                     
         FROM
              MISIBE_END_CUST_DETAILS
         WHERE
              QUOTE_HEADER_ID = p_Cart_Id;
    -- For TEXT BODY
    WF_ENGINE.SETITEMATTRTEXT(itemtype => itemtype , itemkey => itemkey , aname => 'ORG_NAME',avalue => p_ORG_NAME);
    resultout := WF_ENGINE.ENG_COMPLETED||':'||CUST_DATA_CHECK(p_Cart_Id);
    EXCEPTION
         WHEN OTHERS THEN
              WF_CORE.context (
              'WFCustCheck',
              'MisNotifyDataDesk',
              itemtype,
              itemkey,
              TO_CHAR(actid),
              funcmode,
              SQLERRM
    RAISE_APPLICATION_ERROR (-20005, SQLERRM);
    ===========================================================
    I am using &ORG_NAME in the body and subject of my message. But the value is
    not retrieved into the ITEM ATTRIBUTE when I run my process. It is just displaying in the message and the subject of hte message as "&ORG_NAME"
    CUST_DATA_CHECK used in the resultout, is a function which returns 'T' or 'F'. That part is working fine. Just retrieving the ORG_NAME in the ITEM ATTRIBUTE is not working.
    Am I going wrong somewhere? Please let me know.
    Thanks,

  • How i pass table column  value to string variable or return to java applete

    Hi Master,
    How do I pass a table column value into string variable. See my code below:
    import java.sql.*;
    public class Waheed {
    public Waheed() {
    public static void main (String args [])
    String s = "9 23 45.4 56.7";
    System.out.println ("going for connection");
    // DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
    try{
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection conn =
    DriverManager.getConnection("jdbc:oracle:thin:@fahim:1521:aamir","muhammad","mfa786");
    Statement stmt = conn.createStatement();
    ResultSet rset = stmt.executeQuery("select accid from accbal");
    System.out.println ("going for connection");
    while (rset.next())
    s= rset.getString("accid"); this line give me error
    System.out.println (rset.getString("accid"));
    System.out.println (s);
    catch(Exception e){
    e.printStackTrace();
    This line give me an error:
    s= rset.getString("accid");
    s is string variable
    Plese give me an idea how I can pass accid in s variable.
    Thanks.
    Aamir

    See the code sample in the following thread (try using upeercase).
    JDBC  connection
    Kuassi

  • How to copy a column value in to a variable in Dataflow task?

    Hi All,
    I want to copy a column value to a variable inside the data flow task. Which is the best way to achieve it in SSIS?
    Thanks,
    Sri

    Unless its a conditional based query which returns a single value it doesnt make sense to store result in a variable.
    If query resultset has multiple values then you cant store them in a variable unless its of type object. The easiest way to store values in that case to object variable is by using execute sql task and then setting resultset option as full resultset. Once
    stored you can use for each loop with ado enumerator or script task to iterate through values of resultset.
    Perhaps you could give us some idea on what you're trying to achieve
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to Refresh "Internal table values" in User EXIT.

    Dear All,
    My requirement is to place some checks in exit ZXQQMU20 in different tabs from the TCODE IW21 . IW22 etc.
    Now after placeing the checks towards the different tabs while doing "NOCO" from IW21 the conditions are fullfilled but
    when i go ahead to modify the created  "NOCO " from the TCODE IW22 by deleting the created values and saving in IW22 , the conditions written in the exit are still satisfied eventhough i have deleted the values in IW22.
    The reason for this is that the tables which are there in the exit ZXQQMU20 T_VIQMFE , T_VIQMUR , T_VIQMMA
    still contains the old values which were there at the time of creation of "NOCO"  in IW21 .
    How to refresh my " internal tables values" used in such that even at the time of modification of the NOCO through IW22 my table values should pick the current screen values and not the values which were there at the time of creation.
    Please help.
    The code i have written in the exit is as below:-
    ********************* Changed vide ******START
    *****IW21  IW22 also added in filter criteria of notification *************
    ******The purpose of this modification is that in the execution of IW21 or IW22 or IW24 or IW25 we have to give a check that if the
    ******notification type is M2 than inside the Transaction screen , if the Breakdown duration comes less than 15 min than there are
    ******no issues but if the breakdown duration is more than 15 min than the mandatory fields needs to be entered in the analysis tab.
    **    The user has to fill up either following mandatory fields in Analysis Data tab.
    **    A. Object Parts & Damages sub tab
    **    Code Group - Object Parts (OTGRP, VIQMFE)
    **                          AND
    **    Code Group - Problem / Damage (FEGRP, VIQMFE)
    **    Or
    **    Notification Item Short Text (FETXT, VIQMFE)
    **   B. Cause sub tab
    **    Code Group # Causes (URGRP, VIQMUR)
    **    Or
    **    Cause Text (URTXT, VIQMUR)
    **   C. Action Taken sub tab
    **    Code Group # Activities (MNGRP, VIQMMA)
    **    Or
    **    Activity Text (MATXT, VIQMMA)
    **            Then, allow user to complete notification (NOCO).
    CLEAR : L_VAR , L_COMP_TIME.
    IF ( SY-TCODE EQ 'IW21' OR SY-TCODE EQ 'IW22' OR SY-TCODE EQ 'IW24' OR
          SY-TCODE EQ 'IW25' ).
       IF ( E_VIQMEL-IWERK = '061' ) OR ( E_VIQMEL-IWERK = '062' ).
         IF E_VIQMEL-QMART = 'M2'.
           L_VAR = E_VIQMEL-AUSZT.
           L_COMP_TIME = L_VAR / 60.
           IF L_COMP_TIME < 15.
             EXIT.
           ELSEIF L_COMP_TIME > 15..
    *         IF ( T_VIQMFE-OTGRP IS INITIAL AND T_VIQMFE-FEGRP IS INITIAL )  OR  ( T_VIQMFE-FETXT IS INITIAL ) .
    *           MESSAGE 'Please fill the mandatory analysis data in Object Parts' TYPE 'E'.
    *         ENDIF.
             IF T_VIQMFE-OTGRP EQ '' OR T_VIQMFE-FEGRP EQ ''.
               IF T_VIQMFE-FETXT EQ ''.
                 MESSAGE 'Please fill the mandatory analysis data in Object Parts' TYPE 'E'.
               ENDIF.
             ENDIF.
             CLEAR L_TAG.
             IF T_VIQMUR[] IS INITIAL.
               MESSAGE 'Please fill the mandatory analysis data in Cause tab' TYPE 'E'.
             ELSE.
               LOOP AT T_VIQMUR.
                 IF  T_VIQMUR-URGRP IS INITIAL .
                   IF T_VIQMUR-URTXT IS INITIAL.
                     L_TAG = 'X'.
                   ENDIF.
                 ENDIF.
               ENDLOOP.
               IF L_TAG = 'X'.
                 MESSAGE 'Please fill the mandatory analysis data in Cause tab' TYPE 'E'.
               ENDIF.
             ENDIF.
             CLEAR L_TAG.
             IF T_VIQMMA[] IS INITIAL.
               MESSAGE 'Please fill the mandatory analysis data in Action' TYPE 'E'.
             ELSE.
               LOOP AT T_VIQMMA.
                 IF  T_VIQMMA-MNGRP IS INITIAL .
                   IF T_VIQMMA-MATXT IS INITIAL.
                     L_TAG = 'X'.
                   ENDIF.
                 ENDIF.
               ENDLOOP.
               IF L_TAG = 'X'.
                 MESSAGE 'Please fill the mandatory analysis data in Action' TYPE 'E'.
               ENDIF.
             ENDIF.
           ENDIF.
         ENDIF.
       ENDIF.
    ENDIF.
    <Added code tags>
    Thank you so much in advance..
    -Sudhish
    Please use the code tags when you're posting any code snippet
    Edited by: Suhas Saha on Jul 13, 2011 12:39 PM

    Hi, I was thinking just like XVBAP and YVBAP values in the USEREXIT_SAVE_DOCUMENT.
    Plz check u have x /y versions or tables like _old/ _new suffixes and then move the value accordingly.
    otherwise there may be inconsistency.
    Edited by: Prasenjit S. Bist on Jul 13, 2011 3:03 PM

Maybe you are looking for

  • How do I add a stroke to only the outside of a shape?

    I'm trying to add a stroke to a logo for my company. It's basically similar to the shape of a donut so there is an open area the shape of a circle in the middle of the logo. When I add a stroke, it adds it to the outside of the logo, but also in that

  • Adobe flash player 11.5 on non intel G5

    I'm having trouble viewing videos fromYahoo lately. They require Adobe Flash Player 11.5 which I can't install in my Dual 2 Ghz Power PC G5. This flash player will not work without a intel processor. Is there a way to work around this? I know this is

  • Breakpoints in Ecc 6.0

    Hi all, I am using ecc 6.0 & i am trying to place a breakpoint on a smartform driver program but it is not allowing me to do that. The error which i am getting is 'You cannot set more than 30 breakpoints' .. I have checked the program is active & not

  • Can't Uninstall Air, Mac OS X

    I started having major trouble with my Macbook Pro running OS X 10.6.7, after updating Adobe Flash and Air. I want to uninstall both, as a test. Flash was apparently uninstalled easily. No improvement. However, when I run the Adobe AIR Uninstaller.ap

  • My images will not auto resize for viewing

    This is somewhat embarrassing. When viewing images from the web, if they're too large to fit the current window, they get re-sized to fit. Okay. I have a file/page of thumbnails generated by XnView and when I click, the image is loaded, everything is