Recent Posts

ads

Onclickof Ribbon button how to create new form and copying the same data into new form

Here in this post I might want to clarify about the onclickof Ribbon button how to make new frame and duplicating similar information into new structure without sparing. 

In this post I will take "offer"entity.in this we have some feilds in that I might want to duplicate not many feilds information in new structure on snap of strip button.

MicrosoftCRM javascipt



onclickof Ribbon button how to create new form and copying the same data into new form using Microsoft CRM JavaScript

function openAccount()
{
    var parameters = {};
    debugger;
    var Id = Xrm.Page.data.entity.getId()
    var entity = Xrm.Page.data.entity.getEntityName();
    var data = Xrm.Page.getAttribute("new_pricefeild").getValue();
    var accountLookupObj = Xrm.Page.getAttribute("new_lookup");
    if (accountLookupObj != null)
    {
        if (entity == "new_offer") {
            parameters["new_pricefeild"] = data;
            //parameters["accountLookupObj"] = subject;
            //if (agent != null) {

            //    parameters["lvt_agentname"] = agent[0].id.replace("{", "").replace("}", "");
            //    parameters["lvt_agentnamename"] = agent[0].name;



            }
        //if (entity == "new_offer") {
            
        //    var data1 = Xrm.Page.getAttribute("new_lookup").getValue();
        //}
        var entityName = "new_offer";
        accountLookupRecordGuid =""; // To get record GUID

        if (entityName != null && accountLookupRecordGuid != null)
        {
            // Open the window.
            Xrm.Utility.openEntityForm(entityName, accountLookupRecordGuid,parameters)
        }
    }
}

Post a Comment

0 Comments