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)

Set default values in 'Material' entity

(0) ShareShare
ReportReport
Posted on by 550

Hi.

I have a CRM 4.0 implementation already migrated to CRM 2011. We have a tool loading 'Materials' from an external database, and this is working fine.

I'm now working on refining codes for CRM 2013 migration, and I found some problems...

If I try to add a new material manually, I get a message 'You must provide a value for Default Unit'. It seems that the script does not work properly for manually created materials! (the data load works fine).

If I try to populate the field manually, by selecting from list, I get the error in th efirst screenshot. I click OK and then I can select the value from the list. For the second field it works wiothout error - but I have to manually select it.

In both cases we only have 1 value available

Could you please suggest me a proper code to have these 2 fields always populated with the default values?

Many thanks...

--------------------------------------------------

Existing code is:

function Form_onload()
{

if( crmForm.FormType == 1)
{
          document.all.defaultuomscheduleid_ledit.focus();
          document.all.defaultuomscheduleid_ledit.value = 'Default Unit';
}

}
function defaultuomscheduleid_onchange()
{
if( crmForm.FormType == 1)
{
     document.all.defaultuomid_ledit.focus();
     document.all.defaultuomid_ledit.value = 'Primary Unit';
}
}

*This post is locked for comments

I have the same question (0)
  • Claudio Casonato Profile Picture
    550 on at

    Thank you sooo much!

    It worked like magic!

  • Claudio Casonato Profile Picture
    550 on at

    BTW... the 'Custom Code validation tool' (version 2.0.0.1) did not indicate this code as not compatible... so I was sure this one was OK, until I tested in 'real' world...

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