How to auto populate the Customer/Account field from current login user's customer in Dynamics 365 Portals

Summary : How to auto populate the Customer/Account field from current login user's customer in Dynamics 365 Portals

Open your EntityForm or WebForm Step and place the following code on advanced JavaScript field.

Code:

$(document).ready(function () {

    {% if user %}
        $("#customerid").val('{{user.parentcustomerid.id}}');
        $("#customerid_name").val('{{user.parentcustomerid.name}}');
        $("#customerid_entityname").val("account");
        
    {% endif %}
});

In the above code replace customerid field with your field schema name and {{user.parentcustomerid.id}} replace with you field name of user entity.
ex: {{user.yourfieldname.id}}




2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. When signed in utilizing semi-login, we should just approach messages which are pre-chosen by the client to be indicated when he is in full login. www.hotmail.com

    ReplyDelete

Popular Posts