Skip to Content

Before save event is not triggered in Custom BO from Task TI Embedded component

Hi Experts,

I have created EC in Task TI to capture the notes using standard EC (singlenoteshistory).

These notes will be stored in custom BO. Here, I m using a standard dependent object with the node as "TextCollection".

I am unable to find the events for the node, I could see the events for root only.

So, I have to write some logic whenever add notes using my EC. The thing is "Before Save" event is triggered for the first time when opening the EC tab. If I want to add new notes without moving on any tab, I will click the change button then type the notes then save. In this scenario, the event is not triggered.

I want to trigger the save before event when clicking task TI change button, please suggest to resolve this.

Thanks,
Ravi

task1.jpg (52.2 kB)
task2.jpg (20.4 kB)
task3.jpg (43.3 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Aug 09 at 12:48 PM

    Hi Ravi Ayyanar,

    You have the Mass Enable indicator on. I guess that's the reason unless your logic is designed for that particular option. I cannot decided unless I see the code. But my first impression is that it's the reason. Please share the before save code.

    Add a comment
    10|10000 characters needed characters exceeded

    • A couple of things:

      • The Before Save trigger only runs if you changed something.
      • This isn't the entire trigger. Something higher might have caused the code to exit prematurely.
      • If your code is mass-enabled your code needs to treat 'this' as a collection with (possibly) more than 1 item.

      The simplest way to handle mass enabled is to make a loop:

      foreach (var myObj in this)
      {
        xxx
      }

      That avoids the .GetFirst() statements and makes your code work if 'this' ever contains >1 object (which doesn't happen often, but can in case of a Mass Data Run or if a button on a screen calls an action with multiple lines selected).

  • Posted on Aug 11 at 09:06 AM

    If the root-level BeforeSave doesn't trigger when changing the text then you might be out of luck I'm afraid. Changing a root-level field and then saving to trigger the BeforeSave is the only real sure-fire way of doing it so far as I know.

    The notes will, of course, save even if the script file isn't triggered. However, are you sure that the script file isn't triggering when you update the notes and then click Save? Have you activated the parent BO?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.