Hi,
i want to detect a value in a field either as zero or negative so that i can decide value of another field depending upon it. How to do that?
Hi,
i want to detect a value in a field either as zero or negative so that i can decide value of another field depending upon it. How to do that?
0 out of 0 found this helpful
Comments
6 comments
Hi Sara,
It is a little bit confusing. Maybe there is no need to fill new field with 0 or -1, but it depends on your requirements. What kind of value you want to detect?
Best regards,
Vladimir
Hi vladimir.....
For eg. a field "pqr" has a value -54.18. I want to detect this field as negative value and export "not ok" if negative or " ok" if positive..Hope it is clear.
Hi Sara,
Easiest solution is if you are using export script, you can assign the value in script. If not, you can create new field, add script rule (warning) to this field to check if value is less than 0 and assign a value, for example:
double pqr = Convert.ToDouble(Context.Field("pqr").Text);
if(pqr < 0)
Context.Field("YOURFIELD").Text = "not ok";
else
Context.Field("YOURFIELD").Text = "ok";
Best regards,
Vladimir
Hi Vladimir,
When i execute that code in c#, i get an error "The name convert does not exist in the current context".
Hi Sara,
System.Convert.ToDouble(....
Best regards,
Vladimir
Thanks Vladimir. Its working fine. Thanks very much
Please sign in to leave a comment.