You are viewing limited content. For full access, please sign in.

Question

Question

Add a field value within a workflow SDK Script

asked on November 23, 2015

Wrote some time ago to created a folder in a record series and set a file date.  I would like to add to this a field and field value to the folder, not a template.  I can't seem to figure this out and any help would be appreciated.

 

   public class Script1 : RAScriptClass92
    {
        /// <summary>
        /// This method is run when the activity is performed.
        /// </summary>
        protected override void Execute()
        {
            string FD = WorkflowApi.GetTokenValueFromNameAsString("FileDate",1);
            string FL = WorkflowApi.GetTokenValueFromNameAsString("RecFolder",1);
            int id = Folder.Create(FL,"Default",0,RASession);
            FolderInfo FI = Folder.GetFolderInfo(id,RASession);
            RecordFolderProperties RFprop = FI.GetRFProperties();
            RFprop.FilingDate = Convert.ToDateTime(FD);
            RFprop.Save();
           
        }
    }

0 0

Answer

SELECTED ANSWER
replied on November 23, 2015

See the SDK documentation for an example:

EntryInfo EI = Entry.GetEntryInfo(123456, mySess);
FieldValueCollection FVC = EI.GetFieldValues();
FVC.Add("MyFieldName", "DesiredValue"); //Use the Add method to add a field name/value pair
EI.Lock(LockType.Exclusive);
EI.SetFieldValues(FVC);
EI.Save(); //Set the field value.
EI.Unlock();

 

1 0

Replies

replied on November 24, 2015

Thanks!  That was what I was looking for.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.