Get City Field
function getcityfielddata() {
//debugger;
if (Xrm.Page.getAttribute("new_city") != null) //verify the field is presented on the
form or not
{
if (Xrm.Page.getAttribute("new_city").getValue() != null)////if the field is
presented on the form then check the value of the filed whether value is there ot not
{
var cityValue = Xrm.Page.getAttribute("new_city").getValue();
alert(cityValue);
}
Set City field
//bind the function to onsave if user forget to enter city then by defauly city value
should set
function setcityfielddata()
{
var Cityname = Xrm.Page.getAttribute("new_city").getValue();
if (Cityname == null)
{
Xrm.Page.getAttribute("new_city").setValue("Chennai");
showandhidesectionsbasedoncustomer
//just bind this function Onchange event Of Customer Type
function showandhidesectionsbasedoncustomer() {
debugger;
var customertypeValue = Xrm.Page.getAttribute("icici_customertype").getValue();
var customertypename = Xrm.Page.getAttribute("icici_customertype").getText();
if (customertypename == "Individual") {
//here
HideShowSection("tab_2", "tab_2_section_2", false);//hide the corporate section
HideShowSection("tab_2", "tab_2_section_1", true);//show the individual section
}
if (customertypename == "Corporate") {
HideShowSection("tab_2", "tab_2_section_1", false);//hide the individual section
HideShowSection("tab_2", "tab_2_section_2", true);//show the corporate section