Acumatica - Update WFStageID based on Status

时间:2018-04-18 18:09:55

标签: customization acumatica

I am trying to update the WFStageID based on the current status. This is for the Service Orders screen in Acumatica (SD300100). Here is my code:

protected void FSServiceOrder_Status_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
                {
                    var SO = (FSServiceOrder)e.Row;
                    if (SO == null) return;
                    if (SO != null){
                    var s = SO.Status;

                    if(s == "C")
                      {
                        cache.SetValueExt<FSServiceOrder.wFStageID>(SO, 9);
                      }

                    throw new PXException(s);
                    }
                }

Now I do not get an error, it just does not update the field. The status field, not the WFStageID, does only change when the Complete Order action is clicked. I have also tried to update this field if the action is ran in automation steps but with no success. So now I am going at this from a programming standpoint. The WFStageID I want to automatically update to is 9 or for the WFStageCD it is COMPLETED. This needs to change when the Status is equal to "C" which is the character database field for Completed on the Status field.

0 个答案:

没有答案
相关问题