02-24-2014 07:07 AM
What do you mean by some part ?
you can use substr function to pull some sub string of this.
$b=substr(date.field in$file, 1, 7)
or if you need date or time then us function like day,date,dayof week,month
RAD function: substr
A RAD function that extracts a substring from a string.
substr(string, beginning position, length)
The following parameters are valid for the substr function: Parameter Data type Description
$string String The string being modified.
beginning position Number The position in the string where the substring is to begin.
length Number The total number of characters you want the substring to contain. The default behavior is to include all remaining characters in the string from the starting position. You can use the length parameter to specify a shorter substr length.
$a=substr("Service Manager", 8)
$b=substr("Service Manager", 1, 7)
After execution, the value of $a is Center and the value of $b is Service.
02-24-2014 08:11 PM - edited 02-24-2014 08:12 PM
Thank you for answer.
When i told about part i mean if field have value "08:00:00" and i whant to get 1/2 и 3/4 of this value - that 04:00:00 and 06:00:00. (multiplying and dividing the value of the field by a specified amount.)
part of value not part of string :)
02-24-2014 09:37 PM - edited 02-24-2014 09:50 PM
It appears that you can perform a mathmatical operation directly against a duration. From the RAD Debugger:
08:08:12 set variable to date/time duration
true verify successful initializtion of variable
3 field type is date/time before the calculation
3 field type is still date/time after the calculation
04:04:06 value is 1/2 original duration
If you want to be really careful, you could convert your duration to numeric, divide, then convert back to date/time:
$placeholder=val(duration in $file,1) converts duration in record to numeric equivalent
$placeholder=$placeholder/2 divides numeric equivalent by two
duration in $file=val($placeholder,3) converts result back to date/time and saves result to duration field in record
You could probably even nest it like crazy!
duration in $file=val((val(duration in $file,1)/2),3)
02-25-2014 12:46 AM - edited 02-25-2014 01:40 AM
[EDIT: not sure what happened to the rest this post, but adding it now.]
--It takes the urgency and impact (character fields), converts them to numbers, does some math to calculate priority, then changes the result back to a character field to save as priority.code.
You could use that as a model for what you want to do.
02-25-2014 01:41 AM
02-25-2014 02:02 AM
I did use next line in trigger:
var TemplateBreach_50 = system.functions.val(((system.functions.val(Templa
var TemplateBreach_75 = system.functions.val(((system.functions.val(Templa