0 votes

Hi,

in Efficy 10 SP1 this is my workflow function

function BeforeCommitActi(EditHandle, Inserted){
var ds = Database.GetMasterDataSet(EditHandle, 0);

var result = "";

result = "old : " + Database.OldFieldValue(EditHandle, 0, "DURATION");
result += " - ";
result += "new : " + ds.FieldByName("DURATION").AsString;

throw new Error(result);

}

after modifying an action duration from 3h to 3h30 my error message only contains the old value :

Message: "old : 10800 - new : 10800"

How can I access the new one?

asked in Efficy/ Client side by (989 points)

2 Answers

0 votes

Hi Louis,

I've just tested your code in Efficy 10SP2 and this resulted in:

Message: "old : 10800 - new : 12600"

You could also try to use the following for the new value:

Database.GetFieldValue(EditHandle, "DURATION", 0);

This also resulted in 12600 for the new value.

Are you sure that the value for the field Duration has changed to 3h30?

Best regards,
Jeroen Floor

answered by (352 points)
unfortunatly yes the only difference is the version.

Is this possible for you to test this code on SP1 to be sure?

the Database.GetFieldValue(EditHandle, "DURATION", 0); also return 10800 ...
Unfortunatly not. I haven't got SP1 installed (only 10 and 10SP2, I've skipped 10SP1).

But I've used this kind of code in all other versions of Efficy and haven't noticed any different behavior between them.

Is it possible to check another field to be sure the code is working?

What does the following code tell you about the moderation of the field Duration:
Database.FieldModified(EditHandle, 0, "DURATION")
Thank you for your help on this I ll check this out as soon as I can. (internal CRM is the one with lowest priority^^)
0 votes

Actually this works with tasks but it doesn't with appointments... maybe the duration calculation is done AFTER the commit in a triggered function...

answered by (989 points)
1,249 questions
1,521 answers
1,859 comments
328 users