Hi -
I have a form with multiple fields and display methods. I need to add a new control on the form which will display the concatenated value from other controls in the same form. Is this possible to do ?
for example
I have a Control Account, Name and Dob. The new control is empty for now. Is it possible that I can use the values from Account Name and Dob control and concatenate them and display it in my new Control something like this ?
Thank You
*This post is locked for comments
Also you might create a view and use it as the datasource.
Setting the control with AutoDeclaration = Yes and putting its control from code won't work if the control is a column in grid and therefore it has many different values (one for each record in the grid).
You might want to populate a temporary table with all your calculated values and simply using this temporary table as the datasource.
True but how can I do that ? I tried doing this but all the records on my form are displaying the same value from the first record in the form. I mean it only works for the first row of the form and then it repeat the same value from the first row record to all the other records in the forms grid.
Yes, you can try, of course. But any way, calling value from another control also will call logic from control's display method.
ok that is an option I agree but I was thinking maybe if I can set the Auto Declaration property of a control to yes and use the value of that control on another control in the same form ? I need to know if this is possible ?
To get values from another table or display methods you should get the records of another table which depends from first table and call logic from another display methods to get the values. And keep in mind what this will affect performance.
Maybe the best way is to create a field on the table and fill it?
Just to clarify the values I'm trying to concatenate are through other display methods. These values are not present in a table(Data source). I have two display methods on two different controls which are getting the values for them. Now I need to concatenate these two values in a new control altogether. I hope I'm making sense.
Thanks
is it possible for me to use Multiple datasource tables on this method ?
Because I have multiple Datasources on my form. And the values I need to concatenate are from 2 different data sources
for example
display str getConcatinatedValue(YourDSTable1 , YourDSTable2 )
{
return strFmt("%1 %2", _yourDSTable1.Field1, _yourDSTable2.Field2);
}
Thank You
Create display method on form's DS and set this method as DataMethod property on your form control, also set DataSource property on your form control.
As example:
display str getConcatinatedValue(YourDSTable _yourDSTable = YourDSTable) { return strFmt("%1 %2", _yourDSTable.Field1, _yourDSTable.Field2); }
It is just a form Control. Now I need to add a value to this control by concatenating the values from the other controls which are already on the form.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156