Share ideas, ask questions, and get feedback about developing for ProcessMaker
Forum rules: Please post new questions under "Developing processes & programming" for ProcessMaker 2 or 3.
By bpmconsultant
#57518
Hi,

(PM v2.45)

I have a grid with 3 drop downs

Client - which has a dependent drop down - Client_Type and also an independent dropdown - Activity

The grids are populated from SQL calls - all populate on the front-end OK as expected.

The XML shows savelabel="1" on each of them.

When the grid is populated, in debug mode, ONLY Client_Type (the dependent drop down) has a value for Client_Type_label

[Activity_label] => [Client_label] => [Client_Type_label ] => Legal [Activity] =>11[Client] =>1243 [Client_Type ] =>2

I tried creating the _label fields in the grid definition manually - but this didn't help.

The XML:

<Client type="dropdown" required="0" readonly="0" mode="edit" btn_cancel="Cancel" dependentfields="tmproject" defaultvalue="" hint="" sqlconnection="workflow" options="Array" savelabel="1"><![CDATA[SELECT CLIENTID, CLIENTNAME FROM PMT_xxxxxxxxx WHERE EMPxxxxxx="@#empxxxxxx" AND ACCxxxxxx = "@#ACCxxxxx"]]><en>Client</en></Client>

Basically this means that when I try to show the text selected I am in fact only able to retrieve the value !

I need to create an output document which shows the text e.g. "LEGAL" and not the value e.g. 1234

I don't understand why I get a _label for the dependent dropdown but not for the to others ?

Is there a work around for this?
By marcoramirez
#57847
Hello bpmconsultant:

Sorry I'm just trying to undestand beter.

You want to retrieve other field of you database, right, like the name and not the id, or I'm lost.

Because you can try to retrieve only the clientname.

Maybe works

Marco
By bpmconsultant
#57983
Hi,

Basically I have created some drop-downs which are populated from a database.
I want to save and use the selected "text" not the selected "ID"

Ie: if drop down called "country" shows countries "UK", "USA", "China" then they will have an associated ID 1="UK",2= "USA",3= "China"

If I access the chosen drop down field directly e.g. @@country, even though I choose UK in the dropdown the value in field @@country will be "1"

The wiki says: From version 2.0 this property has been eliminated because the case variables @@field-name_label is created automatically to save the label of the selected option.

So if I access @@country_label I should get the country name selected e.g. "UK"

In my case I have x3 drop downs, and only one is returning data in the _label the other 2 drop-downs are not saving the selected value in their respective _label fields.

In debug I can see that no data is being saved in the _label fields for drop-downs Activity & Client BUT drop-down Client_Type_Label does hold the expected data. Client_Type happens to be a dependent field, the other two are not.

[Activity_label] => [Client_label] => [Client_Type_label ] => Legal [Activity] =>11[Client] =>1243 [Client_Type ] =>2

Is there a trick to getting the others to work ?

Does _Label only work for dependent drop down fields ?


Cheers.
By marcoramirez
#777321
Hi bpmconsultant,

Did you mean, when you see the debug after submit the dynaform, you can't see the @@variable_label value?.

And just in case in which version of PM are trying?
By wadex1
#777968
Try this quick and dirty solution (It's not tested for side effects):

Edit gulliver/system/class.form.php, look for:

while ($rs->next()) {
list ($rowId, $rowContent) = $rs->getRow();

This should be at line 423 in 2.0.45 or line 449 in 2.5.2.

The second line should read:

list($rowId, $rowContent) = array_values($rs->getRow());

Works for me.

Regards and happy coding.

Herbert

In the rapidly evolving world of online sports be[…]

STEPN integrates social networking and games that […]

Cenforce 150 is a medication used to cope with a c[…]

What's SAP FICO?

Trustworthy and skill-building, each of these actu[…]