Good day all. I am trying to use a variant on my previously posted Workflow Process Get Change ItemType. I want to reuse some of the code multiple times without having to write it out every time. The code references identId, but I can't figure out how to change the variable based on information pulled from the Workflow. I have tried If statements to change the variable, but they return an error about not being able to convert a string to a string. I know if there is a way to change the identId then I don't have to continue to copy/paste the foreach section. Thank you for any help that can be provided.
foreach (string i in identId) { Item assignment = this.newItem("Activity Assignment", ""); assignment.setAction("add"); assignment.setProperty("source_id", actId); assignment.setPropertyAttribute("locked_by_id","is_null","1"); assignment.setProperty("related_id",(i)); assignment.setProperty("voting_weight", (100 / identId.Count() + 1).ToString()); // Divides the number of IDs in identId and adds 1 assignment.setProperty("is_required", "1"); assignment = assignment.apply(); if (assignment.getItemCount() != 1) return inn.newError("Error creating assignment: "+assignment.getErrorDetail()); } |