0 votes

Hi everyone,

I use EditNewWithScript with an extraparam _reference
(which is 14 and is equal to the value from the select input i want to target)

But my field reference gets filled with the value "14" and doesn't fetch the
select value.

Is there a simple solution to this problem or will it need me
to edit the editView.js and manipulate the values with jQuery?

asked in Efficy/ Client side by (102 points)

3 Answers

+3 votes

In the web application the reference handling is a bit special because we have to distinguish the case of an already generated reference - which is a text value that can be modified by the user if the field REFFIXED is 0 - and the case of a reference to be generated - which is an integer value corresponding to the list of references.

When you pick a reference in the drop-down list of references, the web page sends a CEB_REFERENCE value to the back-end. This value gets copied to the REFERENCE field, and the REFFIXED value is put to 2 to indicate that the reference field contains the ID of the reference to be generated.

You can mimic this behavior during the creation of the entity. Just add _reference=14&_reffixed=2 to your initialisation URL.

answered by (836 points)
0 votes

If you're using EditNewWithScript, you can set the Reference in the script.
Simply use efficy.setReference(editHandle, referenceID).

answered by (836 points)
Hello Robert,
Can we really do that ?

With an EditNewWithScript we cannot set the reference because at the end of the script, we don't commit.
0 votes

Hello Everyone,

We already tried to use the "Efficy.setReference". But because we don't commit, this is the result :

enter image description here

The reference is not pre-selected.

answered by (460 points)
edited by
1,166 questions
1,424 answers
1,715 comments
325 users