Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Field information its not saved after the record is created

Posted on by 250

Hello everyone, my name is Taniguchi and i am using Project service on portals, and i am using  ann entity called time entry and to create a record is required for i fill the msdyn_bookableresource field, i created a lookup field to contacts, and coded a odataquery to when i fill the contact field it will auto populate the  msdyn_bookableresource field and the coded worked but when i will create the record appears ann unknown error and the field that was before filled appears enpty.

does anyone know what is happening and how to fix it?

code:

$(document).ready(function(){
   $("#cr14d_contatodoportal").change(function(){
    // Write JS code here
      // Pega os 3 campo do portal pro lookup
      var name = $("#cr14d_contatodoportal_name").val();
      var id = $("#cr14d_contatodoportal").val();
      var entityname = $("#cr14d_contatodoportal_entityname").val();
 
      if (id !== '' && id !== null) {
 
          var GetCustomer = "~/_odata/Contatos?$filter=contactid eq (guid'"+id+"')";
          $.ajax({
              type: "GET",
              url: GetCustomer,
              dataType: 'json',
              success: function (result){
                  //alert('Successfully called');
              },
              error: function (exception) { }
          }).done(function (json) {
              var RecursoId = json.value[0].cr14d_recursosreservveis.Id; // Pega id do gerente json
              var RecursoName = json.value[0].cr14d_recursosreservveis.Name;
 
              if (RecursoId !== null && RecursoId !== undefined) {
                  $("#msdyn_bookableresource").attr("value",RecursoId);
                  $("#msdyn_bookableresource_name").attr("value",RecursoName);
                  $("#msdyn_bookableresource_entityname").attr("value","contact");
                  //$("#emailaddress1").attr("value",ContaId);
              }
          });
    }else{
          $("#msdyn_bookableresource").attr("value",null);
          $("#msdyn_bookableresource_name").attr("value", null);
          $("#msdyn_bookableresource_entityname").attr("value",null);
      }
   });
});

*This post is locked for comments

  • crm development Profile Picture
    crm development 870 on at
    RE: Field information its not saved after the record is created

    Hi Taniguchi, what error are you getting? Is there any javascript written on OnLoad/ OnSave event for same field?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans