cancel
Showing results for 
Search instead for 
Did you mean: 

No AfterLoading event in BO Extension

NagaPrakashT
Contributor
0 Kudos

Hi all.

I need to enhance a standard BO and need to add a field-A. The newly added field has to dynamically enabled/disabled.

My Approach is to add a new field called "EnableIndicator" to the BO and populate this field based on some logic in AfterLoading event. In the

Extensibility Explorer i will adjust the properties of field-A to bound to the EnableIndicator.

But the AfterLoading() event is not available when i extended the standard BO. Is there any way to meet this requirement.

Thanks,

Naga

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Naga,

since in AfterLoading you can only populate transient fields and since transient fields are not allowed on extension BO nodes (except new nodes) your scenario would not work as you assume.

However, since AfterLoading is "evil" performance-wise anyhow, I would suggest filling the custom field in the AfterModify or BeforeSave event and persist it's content.

Best regards,

Ludger

--

Custom development with All4Cloud.de

Former Member
0 Kudos

Hi Naga, as Horst said you can use the prospect indicator. If you have trouble using this indicator you can try to check if the event aftermodify is called (as Ludger said) and try to modify your custom indicator there.

Regards

NagaPrakashT
Contributor
0 Kudos

Hi All,

I will try the solution and let you know.

Thanks,

Naga

NagaPrakashT
Contributor
0 Kudos

Hi Ludger,

I have a problem here.

1. I created a opportunity with a Account as "Prospect" and saved the opportunity. I also saved by custom indicator flag.

2. Some one changed the Account as "Customer".

3. Reopened the Opportunity, now the custom indicator is still the same , as AfterSave/AfterModify not got triggered to change the indicator.

Any idea how to handle this scenario.

Do i need to update the custom indicator on AfterSave of Account OR

Can i do it in Opportunity at run time.

Thanks,

Naga

Former Member
0 Kudos

Hi Naga,

I am not familiar with the data structures and their dependencies of C4C since I am doing mostly ByDesign.

Furthermore I am not familiar with your requirement and the dependencies resulting from them.

So I can only give general advice:

Keep in mind the dependencies of your flag and pay attention which data modification requires recomputation of your flag.

The flag needs to be recomputed every time when a field it depends on is modified.

This means every node where a modification may happen requires an AfterModify or BeforeSave-Event where recomputation is triggered from since only the AfterModify/BeforeSave of the node where the field resides on is triggered reliably.

You do not need to duplicate your code everywhere.

Using a Reuse-Library or modifying a field of the BO node where the computation happens will suffice (usually - there are some dependencies when which event is called and when not).

Best regards,

Ludger

--

Custom Development with All4Cloud.de

Answers (1)

Answers (1)

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Naga,

Is it possible to enhance the SAP BO with a new node?

In this case you will have the AfterLoading for a transient element.

You may also add another field which indicates if the evaliation was already executed...

Bye,

   Horst

NagaPrakashT
Contributor
0 Kudos

Hi Horst,

Does the transient field which i added in the node should be added on the UI to trigger the AfterLoading event.

Thanks,

Naga

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Naga,

Every field you wan to use in the UI Designer must be part of the UI model.

Bye,

  Horst

NagaPrakashT
Contributor
0 Kudos

Hi Horst,

I have added transient field("EnableIndicator") in the new node to populate it by using AfterLoading event. I have placed a breakpoint in this event script file but it is not getting triggered.

Thanks,

Naga

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Naga,

I've just tested it in my tenant and it hit the breakpoint.

Do you see the result: populating the field?

Bye,

    Horst

NagaPrakashT
Contributor
0 Kudos

Hi Horst,

No, still the break-point is not getting triggered. Let me explain my requirement

I have added a extension field in CAS on Opportunity TI. This field has to be enabled/disabled based on the Opportunity's Account's prospect indicator. Any suggestions on how to achieve this.

Thanks,

Naga

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Naga,

Why can't you use the Prosopect Indicator direct?

Bye,

   Horst

NagaPrakashT
Contributor
0 Kudos

Hi Horst,

Thank you. How to inverse it , like if prospect indicator is true, my field should be set editable(readOnly=false) and vice versa.

Thanks,

Naga

Former Member
0 Kudos

Just checked: not possible to invert in extensibility explorer. I suggest you to proceed with the other tentative (after modify event)