cancel
Showing results for 
Search instead for 
Did you mean: 

Get modified fields

Former Member
0 Kudos

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?

Accepted Solutions (0)

Answers (3)

Answers (3)

Richie
Product and Topic Expert
Product and Topic Expert
0 Kudos

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.

Former Member
0 Kudos

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

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Peter,

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

Bye,
Horst

Former Member
0 Kudos

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.

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

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

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Peter,

The data type ENCRYPTED_EXTENDED_Name takes up to 765 characters.

HTH,
Horst

Former Member
0 Kudos

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

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

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