function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Reg: Java Script Code



I create 2 objects. Department (P) & Employee (C).

Here Employee Have Look up relation with Department(p).

My requirement is,


I created a Detail Page Button on Employee Object.

When i click on This button i would like to display the look up record in Master object.


I tried it through the customization. I got the solution.

But i want to solve this problem either by  javascript or by any other way.


please reply...







Code in Apexclass:-


global Class ButtonClick
    WebService static string jsValue(String sId)
        child__c Obj = new child__c();
        Obj=[select id,name,department__c from child__c where id=:sId ];
        string strRef = ''+Obj.department__c;       
        return strRef;




Code in Button:-



var c = new sforce.SObject("child__c"); = "{!Child__c.Id}"; 

var ref = sforce.apex.execute("ButtonClick","jsValue", {sId :}); 

window.location = ref