Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

SalesOrder Status-Reason change after create or delete new Custom entity

(0) ShareShare
ReportReport
Posted on by 452

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.

 8662.101.JPG

 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.
null1.png

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

  • Albert_ Profile Picture
    Albert_ 452 on at
    RE: SalesOrder Status-Reason change after create or delete new Custom entity

    Could you explain more at

    community.dynamics.com/.../294529

    please?

  • Radu Chiribelea Profile Picture
    Radu Chiribelea 6,667 on at
    RE: SalesOrder Status-Reason change after create or delete new Custom entity

    Hi,

    You would need to look at the plug-in assembly that contains the code behind the sdk message processing step.

    If it's a 3rd party assembly you need to reach out directly to the vendor if the code is not open source

    Regards,

    Radu

  • Albert_ Profile Picture
    Albert_ 452 on at
    RE: SalesOrder Status-Reason change after create or delete new Custom entity

    Thank you, But our friend Ravi point at this first Bro. :-D

    The problem was in the SdkMessages.

    But a question.

    Can I export SDKMessage and see what happen in that?

  • Albert_ Profile Picture
    Albert_ 452 on at
    RE: SalesOrder Status-Reason change after create or delete new Custom entity

    Thank you, But our friend Ravi point at this first. :-D

    The problem was in the SdkMessages.

    But a question.

    Can I export SDKMessage and see what happen in that?

  • Albert_ Profile Picture
    Albert_ 452 on at
    RE: SalesOrder Status-Reason change after create or delete new Custom entity

    Thank you

    The problem was in the SdkMessages.

    But a question.

    Can I export SDKMessage and see what happen in that?

  • Suggested answer
    Radu Chiribelea Profile Picture
    Radu Chiribelea 6,667 on at
    RE: SalesOrder Status-Reason change after create or delete new Custom entity

    If after disabling workflows and plug-ins you still have the problem, if the issue is reproducible by demand, you can also enable a set of CRM Platform traces at a verbose level and include the call stack and identify the Update statement that gets sent to the CRM DB. Once you have that - check the thread number and filter the traces based on the thread. You should see there what's causing this behavior.

    To enable the traces you can use this tool: archive.codeplex.com

    To parse the logs you can use blogs.msdn.microsoft.com/.../pfe-crm-trace-log-file-reader

  • Suggested answer
    gdas Profile Picture
    gdas 50,089 on at
    RE: SalesOrder Status-Reason change after create or delete new Custom entity

    Hi Albert,

    Go to settings - > customization ->customize the system -> SDK Message processing steps..-> check whether any step associated with the entity. Disable the step.

    You can also check in process any workflow associated with the entity.

    Try to disable one by one and test.

  • Albert_ Profile Picture
    Albert_ 452 on at
    RE: SalesOrder Status-Reason change after create or delete new Custom entity

    The SYSTEM do it.

    How can I check the plugins?

  • Verified answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: SalesOrder Status-Reason change after create or delete new Custom entity

    Hi,

    Check if you have any plugin/ workflow running on your custom entity & sales order. Try deactivating one by one and see if you could find any plugin/ workflow.

    Hope this helps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,321 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans