This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Appscript "call current.GetFieldValue" is clearing out the multirelational value.

Hello,

SBM version 12.0, using Appscript

I'm scratching my head on this one. The logic of the code uses multirelational field arrays to work with checkbox lists. The lists are in an aux table. ,1,2,3,4,5,  etc. 

I'm reading a multirelational field and the values are getting cleared on the read.

The field gets written in a previous transition.

On that transition I do a

call current.SetFieldValue("Field_one", var_one)       The write will show:  ,1,2,3,   in the database field for Field_one.

call current.SetFieldValue("Field_two,var_one)         ,1,2,3, also gets written.

When I work down the workflow on another transition I do a GetFieldValue:

call current.GetFieldValue("field_one",variable_name)    

Immediately after the GefTfieldValue call "Field_one" and "Field_two" are cleared out and show   " , ,"

What happened? I am not clearing out the fields in the field overrides and I don't see any field clearing in the Project through the Application administrator.

Why would Field_two get cleared out on the field_one read? Why would Field_one get cleared out? I'm just doing a Get? Maybe I don't understand "Get" in Appscript?

Regards,

Will

  • Things to check:

    Check the item's history and see if the value really did get updated to ",1,2,3,", then it get's cleared.

    The clearing definitely sounds like an App Admin over-ride.  Run the System report "Workflow Fields" to get a more complete list of over-rides.

    Confirm that AppRecord "current" in the second transition/script is pointing to the same table & record as "current" was in the first transition. (Use "GetRecTableId" and "GetId")

    If "current" is set to "Shell.Item" in both transitions, make sure you don't explicitly call the "Update" method on "current".

    if "current" is not set to "Shell.Item", make sure that you did a "Read" or "ReadWithWhere" before trying to do a "GetFieldValue", and make sure that operation actually found a record.

    If the second transition is triggered by the first transition, or if second transition is "downstream"  of the first transition in a Decision tree, you could be running into version-specific behavior about when SBM actually updates "the current item".  Be especially suspicious in the "Decision" context.