Question

How to get the Id of the opportunity related to a deleted record

Hi community,

 

The situation is the following :

 

 

To have some context, after importing some data from an Excel file in the "Calculateur" detail it does some calculations in the "Informations Prix" detail.

 

However, now when trying to implement a business process needed to recalculate the values in the “Informations Prix” detail when we delete some records, I encounter some problems.

I have tried to put a start signal as “When a ‘Calculateur’ is deleted” it starts the process. However, the problem is that I can’t obviously get the Id of the opportunity and the Id of the other calculator records related to it because the record is deleted and only AFTERWARDS it starts the process. So, the business process doesn’t find the Id of the “Calculateur” or the Opportunity related to the deleted record.

 

A good thing to note is that every record of the “Calculateur” has its own Id.

 

Furthermore, I have tried to start the process on an Event like this :

 

 Here, right next to the checkbox, it says : “Before deleting a record”

 

And to start the business process with a “Message signal” with “CSLCalculateurDeleting” as message. However, I don’t really understand how this works because I can’t get the Id of the opportunity anyway.

 

In addition to all this stuff, my idea, according to this article that tried to answer the same need as mine :

 

 

So, my idea was to implement a “Delete” button next to the “Calculateur” detail that will delete the selected record, get the Id of the Opportunity and start a process which now could have all the parameters that I need for my further recalculations. However, how can I get, in the JavaScript Client Side part of code, the Id of the selected record to delete ? See this example :

 

 

I want the Id of the record highlighted in blue.

 

What is the best way to implement this according to the different possibilities above ? Do you have any idea ?

 

Many thanks for the attention paid to this long question. Hopefully you can help me figure this out.

 

Best regards,

Jonathan

Like 0

Like

2 comments

Stop using the normal Delete of a record by rights and instead force users to Delete with a business process.

The business process then runs the logic and then Deletes record in the end. So far so good.

It's simpler to maybe run the Business process from the record page. (Double-click row to open). If you wanna use a button on the row, check this out: https://community.creatio.com/articles/add-button-active-row-detail

Hi Julius,

 

Thanks for your answer. I have found the answer to my questions and it was really simpler that I thought.

 

In fact, on the start signal of the process it is necessary to unthick the checkbox :

 

 

So that it is possible to get the Id of the opportunity related to the deleted record.

 

Best regards,

Jonathan

Show all comments