web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Workflow to update a hidden field not working

(0) ShareShare
ReportReport
Posted on by 3,079

I've got a custom entity I've created.  I have a field in this entity that I would like to be hidden, and then for a realtime workflow to update it based on other info in the entity.  The workflow works fine when the field is visible.  But when the field is hidden, any new records created for the entity are not having that field get populated/updated.  Any records created when the field was visible continue to have the field update properly even when it's hidden.  (The behaviour is also the same if I have the field itself visible but put it in a hidden section.)

Anyone have any idea why this might be, and how I can work around it?

*This post is locked for comments

I have the same question (0)
  • Royal King Profile Picture
    27,686 on at

    Make sure you are populating the field in the real-time workflow. If you are populating the field value from other field check other field has value. I dont think the issue is with the workflow either you are not populating the other field which you use to populate the filed in workflow

  • awalters Profile Picture
    3,079 on at

    The other field very definitely has a value.  I only have a couple of fields in here at this stage, so I'm not mistaking it for anything else, or missing an empty field.  Also, I've tested numerous times and it always works when the field I'm populating is visible when I'm creating the record, and never works when it's hidden when I'm creating the record.  It's definitely not user error.

  • Community Member Profile Picture
    on at

    I've run into an issue where a field that is set to invisible never actually loads, if the visible parameter is set on the server side.  It a regular ASP.NET page you could look at the source and see if it even loaded.

    One solution I have used is making the control invisible in the onLoad event using javascript.  I have not had a problem accessing the control if I did it that way.

    However, I don't really know when or where you're doing this, so I'm shooting blind.

  • awalters Profile Picture
    3,079 on at

    I'm hiding it in the field properties from the form editor (unchecking the "Visible by default" box).  Strangely, when I view the source of the page I'm not seeing any of the field names, even the visible ones.  That whole main section of the form shows:

    <div class='crmContentPanel' id='crmContentPanel'><a class='crmContentPanel' id='contentPanelAnchor' href='#' style='width: 100%; position: absolute; top: 0px;'></a></div>

    ETA:  Ugh, okay I can get to it by opening dev tools and inspecting elements and whatnot.  Total pain, but...anyway, I can definitely see the code for the field even when it's hidden.  It'll take a bit longer to dive through some permutations and see if there's anything different about *how* it's being loaded, but it is there.

  • awalters Profile Picture
    3,079 on at

    Okay.  So digging in, I noticed that on the records where the workflow is firing on change (i.e. ones made at a time when the field was visible), there is a "defaultvalue" attribute set in the ms-crm-Inline-Edit class.  On ones made when the field was hidden, there is not.  

    For fun, I made a business rule on the entity that says if this field (the one I'm trying to set programmatically) does not contain data, set a default value of "new".  Now if I create a new record with the field hidden, when I save it, this field has a value of "new".  If I go back into it and edit the input field, triggering the workflow, it now works.  This implies to me that the workflow can't set the value if the field is hidden and it doesn't contain any data....??  Seems odd, but it's the only explanation I have so far.  And I did find this post regarding 2011 saying a workflow would error if you were trying to set a field without data, so maybe there is a relation there somewhere:  http://www.magnetism.co.nz/blog/paul-nieuwelaars-blog/2012/11/25/workflow-wait-conditions-best-practices-dynamics-crm-2011  

    It's not a solution yet, since on the first save after creation it just gives me "new" instead of my desired value, but it's a clue I think...

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans