Post

2 followers Follow
0
Avatar

Update duration unit to hours from days in Task

We are creating task using CreateAndRetrieve method using c# api, the work field is set to days instead of hours. Is there a way to update the duration unit to hours instead, using the c# api provided.

Regards,

Santhu

santhosh yalamuri Answered

Please sign in to leave a comment.

4 comments

0
Avatar

Are you able to divide this field by the amount of hours a day? I used such a workaround in custom fields in the past.

Guy 0 votes
Comment actions Permalink
0
Avatar

We did try to divide the field by the amount of hours a day, this did not succeed as CreateAndRetrieve accepts only integer and not a decimal value. Would be helpful if you could recommend any other alternative solution.

santhosh yalamuri 0 votes
Comment actions Permalink
1
Avatar

Hi Santhu,

The value you provide for the Work field should be of type Duration (having Unit & Value). This will allow to to provide the unit.

When you say C# API, do you mean the SOAP/Web services API?
I don't understand how you concluded "CreateAndRetrieve accepts only integer and not a decimal value".

The Value property of Duration is of type double, meaning you can certainly enter non integer numbers.

Hope this helps,

Ophir

Ophir Kenig 1 vote
Comment actions Permalink