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)

CRM Adding a "1" to end of control name?

(0) ShareShare
ReportReport
Posted on by 3,079

We have a web resource on each of our contact forms, that we would like to hide based on a field value.  The code for this works fine, except that apparently on about half of the forms, CRM appears to have added a "1" to the end of the control name.  So each form says the control name is WebResource_theControlName when I look in the edit mode, but when I actually look at the source of the resulting pages, some of them show it as WebResource_theControlName and some as WebResource_theControlName1.

Changes have all been published many times (and again, the "1" doesn't even show when I'm in the form editor).  Each form has the web resource added only once.  Any ideas, either as to why this is happening, and/or how to fix it?

*This post is locked for comments

I have the same question (0)
  • awalters Profile Picture
    3,079 on at

    Hmmm...turns out that the web resource being the same on each was a red herring.  Tried a completely different web resource, and it still added the "1".  Then we realised...the web resources in question are in the header, and the issue was happening only on forms where there were other fields in the header.  It's not multiple instances of the web resource, so I still don't understand why it would feel the need to add a "1", but at least we found a consistent pattern.

    For fun, we tried putting two different web resources in the header, and then they were both given a "1" on the end.  Again, it's important to note that this does not show up in the control name as shown in the form editor - it seems to be dynamically added when the form is rendered?

    Still curious to hear if anyone knows why it would do this, and whether there's a chance it might add a "2" in other circumstances or otherwise behave differently than what we can see in the editor.  I can adjust my script to do it for controlname or controlname1, but I don't feel super comfortable doing that until I understand the logic behind it...

  • Temmy Wahyu Raharjo Profile Picture
    2,916 on at

    As per my understanding, CRM will scan all the control and will check automatically if have same name, it will put n increment number. Same when you have BPF, you will found out that your control name will have new_attribute+n number.

  • awalters Profile Picture
    3,079 on at

    There weren't two controls with the same name on the same form, though - they are different forms.  And as per the follow up, it turns out that even a totally new, different web resource gets a 1 at the end if it's in the header and there are other fields there.

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