How to create record or Entity form in ADX Studio Portal / D365 Portal (Create Entity Form)

In this post, i will show you how to create a Account's form which is use to create account's records in MS Dynamic CRM. You can create your own entity form depending upon your requirement.

Step 1: Go to Portal > Web page. Create a new web page as show in below image.

Step 2: Go to Portal > Entity Form.

Step 3: Create a New Entity form.
Name : Give the name of Entity form as you like.
Entity Name : Select the Entity for which you are creating form.
Form Name: Select the form.
Tab Name: It is optional. If you want to show any specific tab then select the tab else it show whole form on portal.
Mode : It must be Insert.
Website: Select website for which you are creating form.

Step 4: Open the Web page which you created in Step-1. Set the entity form value which you created in Step-3.

Step 5: Open your ADX/D365 portal and click on edit as show in below image. Add a link of web page which you created in Step-1. I added the link in header.





Open Portal and check.....


Note: Sometime form not visible. To check this issue...
 # Click on edit web page and check Entity form is set or not. If not then set its value(which you created in Step-3).


 To change the name of submit button :

Step 1: Open the Entity form which you created in step-3 and go to the Additional Setting Tab. Click on +submit



Step 2: Give the button label as you want 
.

Check Portal........
   


Click Here to know, How to get list of all Records which you created here and view it in ADX Retail portal / D365 Portal.   

How to disable open registration process in D365 Portal.

To disable open registration process, you need to hide registration page like this
Now follow the steps to disable open registration process.

Step 1: Go to Portal > Site settings.

Step 2: Open the record whose name is Authentication/Registration/OpenRegistrationEnabled.

Step 3: Set its value to false and save the record.

Go to portal and then check..... registration page has been hide. Now question raised How to create user account for portal after disable Open registration process. 

Now follow the steps to Create user account for portal after disable open registration process.

Step 5: Firstly you have to create contact in MS Dynamic CRM for Portal's User's Account.  

Step 6: After Create contact, Click on Create Invitation button.

Step 7: After click on button, it will open a new Invitation form. Now Save this form after fill infomation.

Step 8: Now Scroll down the Invitation record which you created in step-7. Go to Advance tab
and check Invitation code.

Step 9: Now you can send this Invitation code through an Email. We have a By-default Workflow whose name is Send-Invitation. This workflow send Invitation code to User's Email. You can also Modify this workflow as per your need.

Step 10: After got an Invitation code through an E-mail. Copy-Paste the code in portal's Redeem Invitation and then click on register.
Step 11: After click on register, it will open a registration page. Here you can set your username and password for portal's account.
Note: It will update the contact which you created in Step 5.

Note: You can also create workflow to create invitation code. Now the process become
* Create Contact in Dynamic CRM.
* After create contact, a workflow will run which create an Invitation record which contain invitation code.
* After create invitation record, again workflow (Send-Invitation) will run which send Invitation code through an E-mail. 



Click Here to know, How to Create Entity Form in ADX Studio Portal / D365 Portal.

Click Here to know, How to Hide Sign in with External account label and AzureAD in D365 Portal. 

How to create a new Admin User for D365 Portal / ADX Studio Portal.

Follow the steps to create a new admin user for D365 Portal / ADX Studio Portal.

Step 1: Open the Portal and then click on Register page. Here you can create your new account for portal.
Step 2: When you register your account in portal, it create a new Contact in your MS Dynamic CRM.

Step 3: Now to give the Admin role, Open that Contact record and then open the Portal Contact form.
Step 4: Now scroll down and go to the Web Role section.

 Step 5: Add Administrator role to this contact.

Now check the portal......

Note: This is open registration page. Anyone can register his fake account, so we need to disable the open registration process. Click Here to know, How to Disable Open Registration process.

How to Install Online Portal for MS Dynamic CRM 365

If you want to Host Portal on IIS then click Here to check how to do it. But if you want to install portal online in Dynamic CRM 365 then follow the below steps.

Here I will show you How to install Customer Portal in Dynamic CRM 365.

Step 1: Open the Dynamic CRM 365 then go to the Admin Center.

Step 2: Now Open Dynamic 365 as show in below image.
Step 3: Click on the solution Icon.

Step 4: It will open all the Solutions. If you see there are many portals are available. Click on the Portal's Solution which you want to install. Here i am installing Customer Portal.



After complete installation, the status will be installed.
Step 5: Go to Application tab. Click on Portal Add-On application and then click on Manage.
Step 6: It will open a form which is use to configure your portal. After Submit form, your portal will configure in 5-10 min. and Status become Configured.

Now Open the portal.....customer portal look like....

   

How to use Java-Script in ADX Studio Portal / D365 Portal

In this post, I will show you how to use Java-Script in ADX Studio Portal.

Step 1: Login the portal by using Administrator Role. By default Admin's credential is:
              UserId :  Administrator
              Password : pass@word1

Step 2: Now open the Web-Page on which you want to use JS.

Step 3: Click on Edit and go to Option section.



Here you can Write your JS.

Apply the JS OnLoad of WebPage :

 $(document).ready(function(){
  // Write JS code here
});

There are list of some JS we can use on the Portal.


To Hide Tab :
  var tab = $('table[data-name="Section_Name"]').closest('.tab'); 
  var label = tab.prev('.tab-title');
  tab.hide();
  label.hide();  // Hides the tab's title
                    OR
  $(".tab[data-name='TAB_NAME']").hide();
  $(".tab[data-name='TAB_NAME']").prev().hide();   // Hides the tab's title

To Show Tab :
  var tab = $('table[data-name="Section_Name"]').closest('.tab'); 
  var label = tab.prev('.tab-title');
  tab.show();
  label.show();  // Show the tab's title
                    OR
  $(".tab[data-name='TAB_NAME']").show();
  $(".tab[data-name='TAB_NAME']").prev().show();   // Hides the tab's title

To Hide Section :
  $('table[data-name="Section_Name"]').closest('fieldset').hide();
                    OR
  $(".section[data-name='tab_2_section_1']").closest("fieldset").hide();

To Show Section :
  $('table[data-name="tab_2_section_1"]').closest('fieldset').show();
                   OR
  $(".section[data-name='tab_2_section_1']").closest("fieldset").hide();

To Hide Field with Label:
    $("#FIELD_NAME").closest("td").hide();

To Show Field with Label:
    $("#FIELD_NAME").closest("td").show();

To Hide Field without Label:
     $("#FieldName").hide();

To Show Field without Label:
     $("#FieldName").show();    

Check Visibility of Field:
   var hidden = $("#alletec_portalproblemcategory").is(":hidden");
 Value would be true or false, if true mean invisible. if false mean visible.

Get value of Text Field : 
var fieldValue=$("#FieldName").val();

Get Value of LookUp Field :
var entityName= $("#FieldName_entityname").val();
var lookupGUID = $("#FieldName").val();
var lookupValue = $("#FieldName_name").val();

Get Option Set Value:
var value= $("#FieldName").val();

Set Value of Text Field :
$("#FieldName").val("Value");

Set Value of LookUp :
$("#FieldName_entityname").val(entityName);
$("#FieldName").val(lookupGUID );
$("#FieldName_name").val(lookupValue );
                  OR
 $("#FieldName_name").attr("value",lookupValue );
 $("#FieldName").attr("value",lookupGUID );
 $("#FieldName_entityname").attr("value",entityName);

Set Option Set Value:
var value= $("#FieldName").val("Value");

Enable Text Field Readonly :
 $("#FieldName").attr('readonly', true);

Disable Text field Readonly :
 $("#FieldName").attr('readonly', false);

Disable Text field :
 $("#FieldName").prop('disabled', true);

Enable Text Field :
$("#FieldName").prop('disabled',false);

Check field is Enable or Disabled:
var disabled = $("#FieldName").is(":disabled");
value either be true or false. If true i.e field is disabled otherwise it is enabled.

Disable LookUp Field :
 $("#FieldName_name").parent().find('.input-group-btn').hide(); 

Enable LookUp Field :
$("#FieldName_name").parent().find('.input-group-btn').show(); 

To Make Section Read-Only :
$('table[data-name="tab_2_section_1"]').closest('fieldset').find("input,button,textarea,select").attr("readonly", true);

To Make Tab Collapsible :
// Replace TAB_NAME with your tab name.
// Collapsible tabs for TAB_NAME
$('h2:contains("TAB_NAME")').html("<span class='tabMargin'> TAB_NAME </span> <span id='collapseTabNameId' class='glyphicon glyphicon-triangle-top' style='float: right;margin-top: 2px;margin-right: 4px;'></span><span id='expandTabNameId' class='glyphicon glyphicon-triangle-bottom' style='float: right;margin-top: 2px;margin-right: 4px;'></span>");

// Hide Collapse Icon on load
$('#collapseTabNameId').hide();
// Show expand icon, hide collapse icon and show respective tab on click of collapse icon
 $("#collapseTabNameId").click(function () {
    $('#expandTabNameId').show();
    $('#collapseTabNameId').hide();
    $("div[data-name='TAB_NAME']").fadeIn(1000);
});
// Show collapse icon, hide expand icon and show respective tab on click of expand icon
$("#expandTabNameId").click(function () {
  $('#collapseTabNameId').show();
  $('#expandTabNameId').hide();
  $("div[data-name='TAB_NAME']").fadeOut();
});

// Also add below CSS to look good, you can also change this based on your requirement.
.tab-title{
  background-color: #e0dada;
  font-size: 22px;
  padding: 10px;
  font-weight: bold;
}
.section-title{
  font-size: 15px;
  background-color: #f9f9f9;
  padding: 6px;
}

Get LoggedIn User Information:
   var userId = '{{user.contactid}}';
   var userName = '{{user.fullname}}';

Get LoggedIn User Roles:
   var roles = "{{user.roles}}";
   console.log(roles);
   var role = roles.contains("ROLE_NAME");

Get Count or No of records from a Sub-Grid on a Entity/Basic Form:
   var rows = $("#ID_OF_GRID").find("tbody tr").length;

Get Count or No of records from a Entity List on a Web Page:
Register the function on load of List and use the below code to get the no of records. Replace the ENTITY_NAME with name of table.
    var rows = $(this).children(".view-grid").find("tr[data-entity='ENTITY_NAME']");

Get Query Parameter Data from URL:
    var queryString = window.location.search;
    if (queryString) {
       var params = new URLSearchParams(queryString);
       var nfa = params.get('Id');
    }

Refresh the Entity List :
    $(".entitylist.entity-grid").trigger("refresh");

*************************************************************

Now I am showing How to set Contact Look Up based on User Login.


Copy Paste the following code in your portal webpage...

 $(document).ready(function(){
   // get user login info.
    var userName = '{{user.fullname}}';
    var userId = '{{user.contactid}}';

// set user info.
$("#FieldName").val(userId);
$("#FieldName_name").val(userName);
$("#FieldName_entityname").val("contact");

// Make the Look-Up Read Only
    $("#FieldName_name").parent().find('.input-group-btn').hide();
 });



Click Here to know, Apply Client Side validation in D365 Portal / ADX Studio Portal.

Click Here to know, Retrieve the data using Odata Query in D365 Portal / ADX Studio Portal.

Click Here to know, How to Disable open registration process in D365 Portal.

Unable to Retrieve Purchase Information in ADX Retail Portal

If you are getting an error during the Product's Order in Retail Portal like this as show in below image then you are at right location.

To Solve this Error.... firstly you have to understand why this error is coming.

When you click on Checkout button during order of products this will create a record in Quote entity. When you open the record in Quote entity then you will see there is no product in product grid of it, that's why it showing an error Unable to Retrieve Purchase Information.

Now to solve this error go to Product on which it show an error. Move to Additional Details Tab.
 Now check the Price list. It must be the Retail Portal Price List, if it is not Retail portal then change it to Retail Portal Price List.

It will solve this error.

How to add products in Product category of ADX Retail Portal

Add Products in Product Category like in Hand Tool as show in below Image.



Before moving forward, click Here to know how to create a product category in product catalog and then follow the below steps

Step 1: Go to Sales Module in CRM. Click on Brand Entity.

Step 2: Create a new Brand. Brand Name depend upon your requirement.

Step 3: Click on the " + " sign of Product grid. Create a New Product under the brand which you have created and fill information in it.
Most important point is:
1) Subject field same as for which Product category you are creating product.
2) After create Product, it is Draft state. you need to publish the product.


Now check the Portal, we have successfully create the product.


But there is no image in this product and price of this product is showing 0.

To add image of product follow the steps:

Step 4: Go to Sales Module in CRM. Click on Sales Literature Entity. Create a new Sales Literature and add following information in it.
Name :  Should be same as the name of product for which you are adding image.
Type : must be "image gallery".
Customer viewable : must be "yes".
Step 5: Click on + sign of Product Grid and add the product in it for which you are adding image.


Step 6: click on "+" sign of SALES ATTACHMENTS and add 6 sales attachment in it like this.


Now check the portal....image is showing in product.

Now the price of product is showing 0.
Click Here to check, How to change the price of product.