Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Yusuf Yildirim
6
Views
3
Comments
Getting value for marge calculatingÂ
Question
Hi,
Having a question about getting the right value from a table, where the variable/parameter is the columnname.
The user selects a marge value from a special list ( this is a combobox ) for an article.
The value of this selected combobox must be equal to the column name in PriceMarge table, so the right storeprice can be calculated
getting the value according the columnname. (send an attachment)
For example if the combobox value = Equal to 24
and the price = 84.95
The value i want to get = 35.40
Any idea, how to solve this technical point?
PriceMargin.png
Yusuf Yildirim
Was waiting for some feedback message... but After Putting enough Time into this technical point, I build a Switch which checks what column must be Taken
for getting the right Value from the Different Column...
It seems as follows =)
Working Perfect !
This Solved my Problem...
1 reply
13 Nov 2012
Show thread
Hide thread
Rebecca Hall
You can also do this using an advanced query .... you would have to "build" the column name previously and pass it in (i.e. "{SALES_VIEW}.[MARGIN24]"). The parameter you pass in you will want to set as expand inline. This avoid having a complicated switch statement.
Something like this:
Gonçalo Martins
Staff
Hello Yusuf,
You really should follow the tip given by Rebecca for many reasons..
You'l have a very clean and readable code, easier to maintain, better performance (since you'll query the DB directly - no additional logic) and you'l save a lot of Software Units.
Don't forget to change the parameter highlighted by Rebecca (Expand inline = True), because otherwise it won't work.
This describes whether the parameter should be textually expanded into the SQL or used as a common parameter.
Just a note - When using expand inline parameters, you should use the
EncodeSql
function to prevent SQL injection in the database.
Kind Regards,
Gonçalo Martins
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
 Loading...