Pre-populate the default value in display form?
Hi,
I have a working workflow where the user selects a parcel, prior to running the workflow or in the workflow, and then update a related table of that parcel. The workflow checks if the related ID already exits and then either update or insert into the non-spatial related table. Now this all works perfectly.
What I now want is for the displayform to update the textbox with the existing value from the non-spatial table (the default value) for each of the fields. This is a one to one relationship, so there will only ever be one value displaying per textbox.
I understand how to query the non-spatial table and to get a string for each value to be populated in the displayform. So now my question, is it possible to display a "dynamic" existing value in the textbox as the default value when the default value exists?.
Please note that I'm really new to any form of coding, and have only been working with Geocortex for 1 month.
Thanks in advance,
Andreas Naude
Esri - South Africa
0
-
You can do this using a runtime modification on your Display Form. Assuming you've already queried the table and gotten results back, then here's what you need to do.
1) Add an Assign activity to the RuntimeModifications for your Display Form.
2) Paste this into the To/left side of the Assign statement:
form.Find(Of TextBoxFormItem)("TextBox1").DefaultText
3) Paste this into the right side of the Assign statement:
YourFeatureSet.Features(0).Attributes("YourFieldNameHere").ToString()
4) Replace the feature set with the name you gave your feature set variable and the field name with the field name you want to use from your table.0 -
Hi John,
Thank you for the help, works perfectly!0 -
Hi Andreas, I am trying to accomplish the same thing, however, I am having issues getting the default value to display in the text box. Would it be possible to share your workflow? Thank you! 0 -
I am having difficulty with pre-populating the combobox and datepicker values.Does anyone have any samples they would be willing to share? Here is what I have so far for my combobox:
Display Name: Assign
To: form.Find(Of ComboBoxFormItem)("ComboBox1").SelectText
Value: permitNo_results.Features.First().Attributes("INFOR_DOU_SERVICE_TYPE").Tostring0 -
Hi Stephanie, I've configured an Assign activity in the Runtime Modifications to pre-populate a date picker...
To: form.Find(of DatePickerFormItem)("DatePick1").InitialDate
Value: Date.Parse(sqlqueryresult.Rows.Item(0).Item("Debris_date").toString())
I'm still figuring this out myself so I hope this helps!0 -
Instead of .SelectText you should use .SelectedVaule.
SelectText is only an informative message.0 -
you first have to cast the value (Date.Parse(sqlqueryresult.Rows.Item(0).Item("Debris_date").toString())) to a DateTime object 0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
7 Kommentare