Note that there are some explanatory texts on larger screens.

plurals
  1. POPSI new task custom fields are not being written
    primarykey
    data
    text
    <p>I am developing a process throught PSI that adds a new task into a existing project. For this purpose, first, via PWA, I have created 4 new task custom fields (one numeric, two dates and one text) I need to inform when I create the task. I also have to write 2 numeric task custom fields that already existed.</p> <p>The task is being created correctly and the two custom fields that existed before are also being written correctly. But, any of the new 4 new custom fields are being written. How can I solve this?</p> <p>This is the code:</p> <pre><code>WSProject.Project project = InitProject(); project.CheckOutProject(projectGuid, sessionId, "Check out"); WSProject.ProjectDataSet dsProject = new WSProject.ProjectDataSet(); Guid taskGuid = CreateTaskRow(dsProject, projectGuid, taskname, duration, startdate); Guid assignmentGuid = CreateAssignmentRow(dsProject, projectGuid, taskGuid, resGuid); //Custom Fields Guid idNCF1 = GetGuidUsingFieldName("NCF1"); //OLD Guid idNCF2 = GetGuidUsingFieldName("NCF2"); //OLD Guid idNCF3 = GetGuidUsingFieldName("NCF3"); //NEW Guid idDCF1 = GetGuidUsingFieldName("DCF1"); //NEW Guid idDCF2 = GetGuidUsingFieldName("DCF2"); //NEW Guid idTCF1 = GetGuidUsingFieldName("TCF1"); //NEW SetNumberCustomField(dsProject, projectGuid, taskGuid, idNCF3, 4); //Not Works SetDateCustomField(dsProject, projectGuid, taskGuid, idDCF1, DateTime.Today); //Not Works SetTextCustomField(dsProject, projectGuid, taskGuid, idTCF1, "A"); //Not Works SetDateCustomField(dsProject, projectGuid, taskGuid, idDCF2, DateTime.Today); //Not Works SetNumberCustomField(dsProject, projectGuid, taskGuid, idNCF1, 1); //Works SetNumberCustomField(dsProject, projectGuid, taskGuid, idNCF2, 2); //Works //Using debug, here I can see that all custom fields are properly set in dsProject TaskCustomFields table Guid jobId = Guid.NewGuid(); project.QueueAddToProject(jobId, sessionId, dsProject, false); WaitForQueue(jobId); jobGuid = Guid.NewGuid(); project.QueueCheckInProject(jobGuid, projectGuid, true, sessionId, "Checked in"); jobGuid = Guid.NewGuid(); project.QueuePublish(jobGuid, projectGuid, true, ""); WaitForQueue(jobGuid); </code></pre> <p>SetNumberCustomField (I omitted data and text functions because essentially are the same)</p> <pre><code>private static void SetNumberCustomField(WSProject.ProjectDataSet dsProject, Guid projectId, Guid taskId, Guid customFieldId, int CFValue) { WSProject.ProjectDataSet.TaskCustomFieldsRow tCustomField = dsProject.TaskCustomFields.NewTaskCustomFieldsRow(); tCustomField.CUSTOM_FIELD_UID = Guid.NewGuid(); tCustomField.PROJ_UID = projectId; tCustomField.TASK_UID = taskId; tCustomField.FIELD_TYPE_ENUM = (byte)PSLibrary.CustomField.Type.NUMBER; tCustomField.NUM_VALUE = CFValue; tCustomField.MD_PROP_UID = customFieldId; dsProject.TaskCustomFields.AddTaskCustomFieldsRow(tCustomField); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload