Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Workflow Elements by Aiden Kaskela Get Results SUM returning a 0 or Null value

(0) ShareShare
ReportReport
Posted on by

I have a Kaskela's Get Results query that runs on Dynamics 365 Online to calculate the sum of profit (custom field) on all products in a quote.  

I then run (in a workflow) an update passing the results of the fetch from Kaskelas Get Results into a currency field on the quote entity.  If I return the value as single money, the field stays null.  If I return the value as single decimal it comes back as zero.  

If I run the exact query through the fetch tester in XRM Tools I get the result (that I need 600) as follows:

<resultset morerecords="0">

<result>

<new_profit_sum formattedvalue="£600.00">600</new_profit_sum>

</result>

</resultset>

Fetch XML Used:

<fetch version="1.0" output-format="xml-platform" mapping="logical" aggregate="true"><entity name="quotedetail"><attribute name="new_profit" alias="new_profit_sum" aggregate="sum" /><filter type="and"><condition attribute="new_activeproducttype" operator="eq" value="100000000" /></filter><link-entity name="quote" from="quoteid" to="quoteid" alias="aa"><filter type="and"><condition attribute="quotenumber" operator="like" value="QUO-01188-L5S0Z2" /></filter></link-entity></entity></fetch>

The quote number in the workflow is passed as a field quoteid into the workflow.  For the above purposes testing in the xrm fetch tester tool I put in an actual quote number.  I also tried that in the actual Kaskela's fetch and the same thing happens so its definitely not that.

This query used to work ok but stopped working for some reason.  I updated to the latest Kaskela's 1.2.0

I have other queries that used to work and now don't.


Any Ideas what could be going wrong?

John

*This post is locked for comments

  • KJohnston Profile Picture
    10 on at
    RE: Workflow Elements by Aiden Kaskela Get Results SUM returning a 0 or Null value

    I am having the same issue. I have used the Fetch Builder in XRM Toolbox and I'm getting the correct sum quantity of tickets. Which is what I'm trying to capture. Yet when I attempt to update the field on the form with thr Single Value ( Result as Decimal) it is not returning the correct value. It is displaying 0.00. I have been working on this all evening and do not understand why it is not working. I am on the most current version of kaskela 1.6.... (not at my computer). 

    Also, I have this same step for a different condition in the same workflow and it is working correct for that particular condition. Can someone give any advice? 

  • Community Member Profile Picture
    on at
    RE: Workflow Elements by Aiden Kaskela Get Results SUM returning a 0 or Null value

    Weirdly it works on other fetch xml entities but not quote lines  In the end I used a aggregate sum on quantity of product based on a category of product which achieved what I wanted to achieve.  I did upgrade to 2.2 but had the same problem.  Very bizarre.

  • Aiden Kaskela Profile Picture
    19,694 on at
    RE: Workflow Elements by Aiden Kaskela Get Results SUM returning a 0 or Null value

    Hi John,

    I'll have to investigate this, but I haven't had any issues in the past and use this feature frequently. Are you on the latest version (2.2)?

    Thanks,

     Aiden

  • Community Member Profile Picture
    on at
    RE: Workflow Elements by Aiden Kaskela Get Results SUM returning a 0 or Null value

    Aiden I have a very similar issue but this time got a Get Results # of Results.

    When I run this fetch in a dialog:

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"><entity name="quotedetail"><attribute name="productid"/><filter type="and"><condition attribute="new_activproductarea" operator="eq" value="100000001" /><condition attribute="new_activproducttype" operator="eq" value="100000003" /></filter><link-entity name="quote" from="quoteid" to="quoteid" link-type="inner" alias="ad"><filter type="and"><condition attribute="quotenumber" operator="eq" value="{Quote ID(Choose quote (Quote))}" /></filter></link-entity></entity></fetch>

    The query finds all quote lines that have a product area of IT (1000000001) and product type as consultancy (100000003) from a quote selected in the dialog.

    And I return a result as a # number of results (count of records) it returns a zero value.  Tearing my hair out as to what I'm doing wrong.  Any Ideas?  This is running in a dialog.

    If I run the same query in XML Tester in xrm tools I get the following result which is correct:  (2 records)

    <resultset morerecords="0" paging-cookie="<cookie page="1"><quotedetailid last="{1559B4EF-9649-E911-A977-000D3A38C9F2}" first="{A1E60B03-9349-E911-A977-000D3A38C9F2}" /></cookie>">

     <result>

       <quotedetailid>{A1E60B03-9349-E911-A977-000D3A38C9F2}</quotedetailid>

     </result>

     <result>

       <quotedetailid>{1559B4EF-9649-E911-A977-000D3A38C9F2}</quotedetailid>

     </result>

    </resultset>

    When you display the # of results of the query on a dialog page, the figure returned is 0.  

  • Aiden Kaskela Profile Picture
    19,694 on at
    RE: Workflow Elements by Aiden Kaskela Get Results SUM returning a 0 or Null value

    Hi John,

    Sorry for the mix-up - I missed your first reply about getting an advanced version. A new version is available for download (2.0.0) and it has some really cool new features that I'll be documenting in the next few days.

    Thanks,

      Aiden

    EDIT: It's available right now on https://WorkflowElements.com but isn't on AppSource yet. It's going through the approval process now.

  • Community Member Profile Picture
    on at
    RE: Workflow Elements by Aiden Kaskela Get Results SUM returning a 0 or Null value

    Any progress on the release?

  • Community Member Profile Picture
    on at
    RE: Workflow Elements by Aiden Kaskela Get Results SUM returning a 0 or Null value

    Thanks Aiden for the response.  Yes if you could email me an advanced version and Ill test it for you on our environment.

  • Verified answer
    Aiden Kaskela Profile Picture
    19,694 on at
    RE: Workflow Elements by Aiden Kaskela Get Results SUM returning a 0 or Null value

    Hi John,

    Thanks for checking out Workflow Elements. You're right about this bug - it's only for Money type fields used in aggregate queries (or any where a Money field is the result of a scalar query).  It looks like it was introduced in v1.0.5.2 when I fixed some issues around aliased columns.

    The code is fixed and I'm wrapping up a few minor things and I'll be releasing v2.0 with this fix (and support for scheduled workflows via Flow!) It'll be on https://WorkflowElements.com in the next day or two, and on AppSource a week or two later. If you'd like, I can email you details for an advanced version and you can retest this issue in your environment and verify it works.

    Thanks,

     Aiden

  • Community Member Profile Picture
    on at
    RE: Workflow Elements by Aiden Kaskela Get Results SUM returning a 0 or Null value

    On further testing when the figures are outputted to text the result is £600,  If you output it as single value result as decimal it returns 0 and currency is null.  I'm pretty sure its a bug in Kaskela's workflow.  I think the returned value is the formatted value (with the pound symbol) and the currency field wont accept it.

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 the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans