Custom Field EntityType of Project Onlin

Home Forums Bulk Edit Support Forum Custom Field EntityType of Project Onlin

Viewing 0 reply threads
  • Author
    Posts
    • #119646 Reply
      AvatarMantu Singh
      Guest

      Hi,

      I am writing some code for retrieving Custom Field which Entity Type is Projects, But i am not able to retrieve Entity Type of any particular custom Field.
      Please see this code and correct me how to solve it.

      ‘use strict’;

      ExecuteOrDelayUntilScriptLoaded(initializePage, “sp.js”);
      //SP.SOD.executeOrDelayUntilScriptLoaded(initializePage, “PS.js”);

      var projContext;
      var projects;
      var customFields;
      var entityTypes;
      var projEntity;
      var pCustomFields;

      function GetCustomFieldsName() {
      var projContexts = PS.ProjectContext.get_current();
      customFields = projContexts.get_customFields();
      entityTypes = projContexts.get_entityTypes();
      projEntity = entityTypes.get_projectEntity();
      projContexts.load(customFields);
      projContexts.load(entityTypes);
      projContexts.load(projEntity);

      // Run the request on the server.
      projContexts.executeQueryAsync(getCFName, getCFFailed);
      }
      function getCFName() {
      var cfEnumerator = customFields.getEnumerator();
      var projentitypes = projEntity.get_name();
      var SelectedOption;
      var count = 1;
      while (cfEnumerator.moveNext()) {
      var cf = cfEnumerator.get_current();
      // var cfProjType = cf.get_entityTypes().get_name();

      projContext.load(cf);
      projContext.executeQueryAsync(function () {
      var s = cf.get_entityTypes();
      }, getCFFailed);
      if (projEntity.get_name() == “Project”) {
      SelectedOption += “<option value=” + cf.get_internalName() + “>” + cf.get_name() + “</option>”;
      count++;
      }
      }
      $(‘#ddlListBox1’).html(SelectedOption);
      $(‘#spanTotalCF’).html(count);

      }
      function getCFFailed(sender, args) {
      $(‘#divCustomFieldMessage’).text(“Failed to execute: ” + args.get_message());
      }

Viewing 0 reply threads
Reply To: Custom Field EntityType of Project Onlin
Your information: