Using FormValues() and not getting a value returned

Help please!  I am working with the Order Summary screen. This screen is made up of data from the Orders table and data from the OrderItems table.

I need to create a table level script that will update data on the Order table when a user clicks a workflow button confirming data that is in the OrderItems table.

Table level scripts seem to be my nemesis lately.  I had this one working previously.  However, I had to add an if statement to it as it was trying to run when an Order was created (even though I had it in the Update statement?)

The table level script is located on the OrderItems table.  However, I want to look at a field on the Order table.  This field is on the OrdersSummary screen.

My table level script is not working after adding an if statement to it, therefore, I was going to check what was being returned as my "true" for the if statement.  On the order summary screen, there is a field named orde_locationconfirmed.  I want the TLS to fire if this field has a "Y" in it.  (The Y gets populated when a user clicks the "Location Confirmed" workflow button.

I went to the Order Summary screen and added this to the first fields Create script field.

var LocationConfirmed = FormValues("orde_locationconfirmed");
ErrorStr += "Location Confirmed = " + LocationConfirmed + ". ";

I get ....

Location Confirmed = .

If I change that to 

var LocationConfirmed = Values("orde_locationconfirmed");
ErrorStr += "Location Confirmed = " + LocationConfirmed + ". ";

I get ....

Location Confirmed = Y.

I am confused as to why I am not getting a value when using FormValues().  My understanding was that this could be used to get any value on the screen even regardless of the screen block you put it in.

Is this not correct?

As always, any assistance is greatly appreciated!

  • Hmm... I may be wrong here, but I assumed that Sage CRM FormValues was generated when a form was submitted, and only includes fields that are included within the <form> </form> HTML tags.

    Is it possible the field you are trying to access is outside of the submitted form?

  • That is my understanding as well.  The field needs to be on the screen.  For Values() it needs to be in the same screen block.  However, for FormValues() it is on the screen perhaps in another screen block.  

    That is why I don't understand this.  Just to see what value is being returned, I am using it on the same screen block that it is contained on.  However, it seems like it should still work unless being on the same block is not allowed.