Skip to Content
0

Get modified fields

Nov 15, 2016 at 09:35 AM

166

avatar image

I would like to execute some code, only when a special field changed its value.
I already successfully could check the LifeCycleStatus of an opportunity (DB query in before save).
But when I try to check the note of an opportunity (TextCollection.TextByTextTypeCodeAndLanguageCode.TextContent.GetFirst().Text.content) in db, there is already the new value before save.
I am also not able to create an AfterLoading method in my opportunity extention, or a new custom text element where I could store more than 255 characters.

Is there any possibility to check which fields changed value?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Horst Schaude
Nov 15, 2016 at 01:12 PM
0

Hello Peter,

The data type ENCRYPTED_EXTENDED_Name takes up to 765 characters.

HTH,
Horst

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hello Horst,

do you know any event where I could get the old value, before it got changed?

Maybe after loading, or before modify, or is there an option to see which field changed in after modify?
In a new custom business object I am able to create an after modify method but not for the opportunity extention.

Thanks in advance,
Peter

0

Hello Peter,

Sorry, but this is not possible.

Only if the BO is supporting the ChangeHistory you can get after the Save (!!!) the changed data.

Sorry,
Horst

0
Horst Schaude
Nov 15, 2016 at 02:16 PM
0

Hello Peter,

The only way is to call a query via "ExecuteFromDBDataOnly".

Bye,
Horst

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Is there also a way to retrieve fields like the note of an opportunity from the db?
When I use ExecuteFromDBDataOnly there is no TextCollection available for the opportunity.
And with Execute I only get the already changed value of the note field.

0

Hello Peter,

Sorry, but the Dependent Objects do not support direct quiereis on them. Therefore the framework is not able to retrieve any data except via the instances of the hosting nodes.
And these are only existing in the buffer (the current data).

So, "No" is the answer.

Sorry,
Horst

0
Richie Feeney
Nov 15, 2016 at 03:26 PM
0

Hi Peter,

You create a new element in the Opportunity (oldText for example). Then on the before save you can copy the realText attribute to this.

That way you always have the old value on the aftermodify (stored from the previous save).

This is the only way I know of.

Regards,

Richie.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hello Richie,

but my problem with this solution is, when I save an opportunity the first time, the new custom field is empty and I get a message that the value of my field changed.

I could check an indicator for the first safe, but how do I know whether there is a change or not?

Is there a way to fill the new element initially? (not manually)

Best regards,
Peter

0