Unfortunately, any code written for the Classic Designer isn't going to work on the Layout Designer without serious modification, for several reasons:
- The Form structure on the Layout Designer is drastically different than the structure of form in the Classic Designer. I don't think that the vo attribute is even used any more for example.
- The Javascript on the Layout Designer uses vanilla Javascript, not JQuery like the Classic Designer, so the shorthand ways to reference objects (like $('#Field1') for example) and the shorthand methods (like .attr() and .change() for example) are not going to work.
- Most importantly, the Javascript on the Layout Designer runs within a Sandboxed iFrame, and does not have direct access to the document, form, fields, attributes, etc. The only parts of the form and fields that can be edited are those that have been made available via the LFForm Object (also known as the LFForm Interface) which you can read about in the help files (here's a link). Unfortunately, that means we can't do things like edit attributes of a field, unless they are specifically set-up in the LFForm Object, and we cannot do things like trigger events (like the change event), unless they are specifically set-up in the LFForm Object.
That means that we have to completely re-think how these kinds of things are implemented, and possibly accept that they may not be possible in many cases.
In this case, I have an idea for how this might work (I have not fully tested this, so it might not work, but some brief testing seemed positive). This code uses the LFForm object to work with the field that triggers the lookup (the source of the lookup, not the destination of it). In this example, I'm using the field with ID # q1, so I'm referencing "fieldId: 1" in three places. This code stores the current value of the field into a variable, then it clears the contents of the field, and then it reapplies the stored value back into the field. Because the setFieldValues method is not only updating the value of the field but also triggering a change event, this should trigger the lookup to process again.
var triggerFieldValue = LFForm.getFieldValues({fieldId: 1});
LFForm.setFieldValues({fieldId: 1}, "");
LFForm.setFieldValues({fieldId: 1}, triggerFieldValue);