Hi there all `CRM` experts.I have a problem.
The problem is when I create new records of my custom entity(named Receipt-Step or Receipt ) or delete one of its records, `sales order` status reason goes null( I have checked DB and DB display null value ).
Note that This is a custom entity with state and status reason of active and inactive and has relation 1:N between sales order entity(sales order entity as primary entity and my custom entity as related entity) ,that means each sales order has many custom entities)
When I Insert new custom entity record the status reason goes crazy ! or even delete it.
It seems the problem in saving and deleting is the same.
Here is what happen in the picture.
In the form of sales order it does not display any status-reason.
And in Deleting, crm audit history says that it happened by the SYSTEM user !
Here is the picture.
Some information :
-I have added some status reason to the sales order entity.
-This custom entity is named Receipt Step and there is look up field in this entity to the sales order,
And when we create new records of this, It do some changes on the on the final price.(some Subtraction on the final price for each receipt step )
-I have not developed this entity.
-I have disabled all scripts running on the sales order and this custom entity, But the problem exists.
.........................................................................................................................................
The question is this that What happen?
What cause the status Reason does not appear or lost?
Can any one give me a lead to solve the problem? !!
What can cause that status reason change?
Note that when this is in in progress status reason ( submitted state code )
this not happen!
......................................................................................................................................................
EDIT 1 :
I disabled the SDK Messages in create event, And this not happened any more.
So one of the SDK Messages causes the problem.
EDIT 2 :
......................................................................................................................................................
I disabled one the sdk message that works on create of the receipt step and the problem solved !
And I can not export the plugin to see it's code. I export whole solution But no success.
I understood that the status code of the related entity ( in our case is receipt step entity )changes to Null too!!
It means when I add a receipt step, the receipt step and sales order status code changes to null.
Some Information :
The sales order entity has the parental relation with this entity.
Receipt step works in this way : It calculate some steps of receipt, each receipt step has some prices.
These fields are read-only, But SDK plugin can write on them, and these fields exist on both entities.
when I add some receipt step with some field values, the values fill some other values in sales order.
Can the read-only be the cause?
Another thing:
I tried to get the status code of receipt step and sales order entity and pass them again in save of receipt entity record( that cause this problem ), but no success.
Can I write a plugin to pass the same status code of receipt step and sales order entity before saving? Maybe this solve the problem.
*This post is locked for comments