• Kondal Rao learner
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 33
    Questions
  • 34
    Replies
HI Experts,

while posting my code in developers community, getting this error what does it mean by."The operation is not permitted. If you received this in error, please contact info@developerforce.com (code: B2)"
Hi Experts,

Im learning salesforce admin, i would like to expertise my self as well for preparing the interveriew for configuration ,so im looking for the scenario based questions on admin part, kindly help me out.Thanks in advance 

Regars,
Aditya
Hi Experts,

Im new to salesforce i got one doubt what is the difference between pagination and setpagesize and when we will go for the pagination and setpagesize, can we use setpagesize for the standardcontroller and customcontroller , please clear my doubts, i dont know whether this question is right or wrong but looking for the right answer.

Thanks in advance

Hi Experts,

 

 

 

Add check boxes to a list of records, a  check box in the heading , when the header check box is cheked all the check boxes in the list are check and vice versa.  please provide me with sameple code please

 

 

Thanks in advance

 

 

Hi Experts,

 

My questions about visualforce pages

 

how many records we can show on visual force page.

 

Thanks in advance

Hi Experts ,

 

please tell me how to do this if possible a sample code.

 

All the rules related to lead conversion and if I wanted to convert lead and after converging lead only create to account. not contact ,how can i achive this ?

 

thanks in advance

Hi experts,

 

Please can anyone tell me how to send emails through batchapex . please write code by taking one example and sechudling that mails also please .

Hi anyone help me about this issue , see i have to two radio buttons name called p-acitivity , c- activity so when i click on p-activity related records has to display and if i select paricular records those reocrds has to move in a list box but its showing error like "ARGUMENT CANNOT BE NULL 1" please tell me what is this error. please anyoen help me this

 

Apex class

public class ActivityOrgdependencyController{

    public String ParentList{set;get;}

    public String ChildList{set;get;}

    private set<id> ChildListW;

    private set<id> parentListW;

    public ActivityOrgdependencyController() {

    idvalue= ApexPages.currentPage().getParameters().get('id');

        Orgname= ApexPages.currentPage().getParameters().get('Org');

        orgidvalue= ApexPages.currentPage().getParameters().get('orgid');

    }

 

    // String orgid = ApexPages.currentPage().getParameters().get('id');

   String orgid;

    public list<Activity_Master__c> ActivityList ;

    public string idvalue {get;set;}

    public string Orgname {get;set;}

    public string orgidvalue {get;set;}

    public ActivityOrgdependencyController(ApexPages.StandardController act)  

    {

         parentListW = new set<id>();

         ChildListW = new set<id>();

     // idvalue= ApexPages.currentPage().getParameters().get('id');

      //  Orgname= ApexPages.currentPage().getParameters().get('Org');

    }

     public string ids{set;get;}

    

    

   public  PageReference ParentSelection()    

   {    system.debug(ids);

       for(activitywrapper awrp: actList){

           awrp.selected=false;

       }

       integer i = Integer.valueof(ids);

       actList[i].selected=true;

      ParentList = OrgNameID+' : '+actList[i].act.CODE__C;

     return null;

    }

    private string OrgNameID;

   private  OrganizationHierarchyMaster__c Org;

   

   public String ind {get;set;}

   {

   ind= '0';

   }

    public List<activitywrapper> getActivityList()

    {  

      

        OrgStructure orgs = new OrgStructure();

        orgid = orgs.temporgId;

        Cookie orgCookie;

        orgCookie = ApexPages.currentPage().getCookies().get('Orgid');

         idvalue= ApexPages.currentPage().getParameters().get('id');

           if(idvalue != null)

        {

            Org = [select name ,OrgName__c, OrganisationLevel__c, OrganisationLevel__r.name from OrganizationHierarchyMaster__c s where id=:idvalue ];

     

           // orgid = orgCookie.getValue();

            orgid = idvalue;

            //ind = '0';

            if(Org .OrganisationLevel__r.Name!=null)

                Orgname = 'Choosed Organisation :'+Org .OrganisationLevel__r.Name +' - ' + Org .Name;

            else

                Orgname = 'Choosed Organisation :' + Org .Name;

        }

        if(Org ==null)

            OrgNameID='';

        else

            OrgNameID=Org .Name;

      

     

        if(orgid != null)

        {

            if(ind == '0')

            {

             

                actList.clear();

                for(Activity_Master__c a : [Select id,Code__c,Name,Description__c,Frequency__c,Priority__c,Functional__c,Time_Zone__r.name FROM Activity_Master__c

                            where Status__c = 'Active' and id in (Select Activity_Name__c from CT_Org_Activity_Mapping__c

                                                                     WHERE Organisation_Level_Name__c = :orgid )])

                 {

                    actList.add(new activitywrapper(a));

                 }

            }

            else

            {

                actList.clear();

                for(Activity_Master__c a : [Select id,Code__c,Name,Description__c,Frequency__c,Priority__c,Functional__c,Time_Zone__r.name FROM Activity_Master__c

                            where Status__c = 'Active' and id not in (Select Activity_Name__c from CT_Org_Activity_Mapping__c

                                                                     WHERE Organisation_Level_Name__c = :orgid )])

                 {

                    actList.add(new activitywrapper(a));

                 }  

            }

        }

        else

        {

            if(ind == '0')

            {

          

                actList.clear();

                for(Activity_Master__c a : [Select id,Code__c,Name,Description__c,Frequency__c,Priority__c,Functional__c,Time_Zone__r.name FROM Activity_Master__c

                            where Status__c = 'Active' and id in (Select Activity_Name__c from CT_Org_Activity_Mapping__c)])

                 {

                    actList.add(new activitywrapper(a));

                 } 

            }

            else

            {

           // ind = '1';

                 actList.clear();

                for(Activity_Master__c a : [Select id,Code__c,Name,Description__c,Frequency__c,Priority__c,Functional__c,Time_Zone__r.name FROM Activity_Master__c

                            where Status__c = 'Active' and id not in (Select Activity_Name__c from CT_Org_Activity_Mapping__c)])

                 {

                    actList.add(new activitywrapper(a));

                 } 

            }

        }

       return actList;

    }

        //public List<Activity_Master__c> getAlignedActivityList()

  //  {  

  //  system.debug('orgid : ' + orgid );

   //     ActivityList=[Select id,Code__c,Name,Description__c,Frequency__c,Functional__c,Priority__c,Time_Zone__r.name FROM Activity_Master__c

  //                      where Status__c = 'Active' and id not in (Select Activity_Name__c from CT_Org_Activity_Mapping__c

   //                                                              WHERE Organisation_Level_Name__c = :orgid)];       

   //    return ActivityList;

   // }

     List<activitywrapper> actList = new List<activitywrapper>();

    

     public PageReference AssignActivities()

    {

   idvalue= ApexPages.currentPage().getParameters().get('id');

    CT_Org_Activity_Mapping__c orgactmapping;

    try

    {

       // ActivityList.clear();

       if(ind =='0'){

       list<CT_Org_Activity_Mapping__c> orgactmappingList = new list<CT_Org_Activity_Mapping__c>();

        integer i = Integer.valueof(ids);

        actList[i].selected=true;

       for(activitywrapper actwrapper : actList)

              {

                if(actwrapper.selected == true)

                {    system.debug('orgactmapping-->'+orgactmapping);

                     Parentlist = OrgNameID+' : '+actwrapper.act.Code__c;

               

                      orgactmapping = new CT_Org_Activity_Mapping__c();

           orgactmapping.Activity_Name__c = actwrapper.act.id;

            orgactmapping.Organisation_Level_Name__c = idvalue;

            orgactmappingList.add(orgactmapping);

       //insert orgactmapping;

      

               }

              

              }

              insert orgactmappingList;

              system.debug('orgactmappingList-->'+orgactmappingList);

              for(CT_Org_Activity_Mapping__c org:orgactmappingList){

              parentListW.add(orgactmapping.id);

              }

              system.debug('parentListW-->'+parentListW);

      }

      else{

              ChildList= '';

             list<CT_Org_Activity_Mapping__c> orgactmappingList = new list<CT_Org_Activity_Mapping__c>();

           for(activitywrapper actwrapper : actList)

              {

                if(actwrapper.selected == true)

                {

             //   ActivityList.add(actwrapper.act);

                  ChildList +=OrgNameID+' : '+ actwrapper.act.code__c + '\n';

                orgactmapping = new CT_Org_Activity_Mapping__c();

           orgactmapping.Activity_Name__c = actwrapper.act.id;

            orgactmapping.Organisation_Level_Name__c = idvalue;

       orgactmappingList.add(orgactmapping );

               

               }

              }

             

             insert orgactmappingList;

             for(CT_Org_Activity_Mapping__c org:orgactmappingList){

             ChildListW.add(org.id);

            

             }

             }

     

      }          

 

     

    catch(Exception e)

        {

            ApexPages.addMessages(e);

        }

       ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'Activities assigned successfully'));

       

     return null;

    }

      public PageReference UnAssignActivities()

    {

    try

    {

       // ActivityList.clear();

        system.debug(actList.size());

       for(activitywrapper actwrapper : actList)

      {

        if(actwrapper.selected == true)

        {       

        

         List<CT_Org_Activity_Mapping__c> orgactmapping = [SELECT Id From CT_Org_Activity_Mapping__c where Activity_Name__c = :actwrapper.act.id

                                                                             AND Organisation_Level_Name__c = :orgid];

            delete orgactmapping ;

         

       }

      }

      }

    catch(Exception e)

        {

            ApexPages.addMessages(e);

        }

       ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'Activities Un-assigned successfully'));

       

     return null;

    }

   

   

    /*Configure Functionality

     desc: Storing Parent activities to CT_Activity_Dependency__c

    */

    public pagereference configure(){

    system.debug('ChildListW-->'+ChildListW);

    system.debug('ParentListW-->'+ParentListW);

    try{

    List<CT_Activity_Dependency__c> Updatelist = new list<CT_Activity_Dependency__c>();

    CT_Activity_Dependency__c dTemp;

    for(id val: ChildListW){

        dTemp = new CT_Activity_Dependency__c ();

        dTemp.Child_Org_Act_Id__c = val;

        Updatelist.add(dTemp);

    }

    for(id val: ParentListW){

        dTemp = new CT_Activity_Dependency__c ();

        dTemp.Parent_Org_Act_Id__c= val;

        Updatelist.add(dTemp);

    }

    system.debug('Updatelist-->'+Updatelist);

    insert Updatelist;

     ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'Activities Configured successfully'));

    }

    catch(exception e){

   

        ApexPages.addMessages(e);

    }

    ChildList='';ParentList='';

    return null;

    }

   

    public class activitywrapper

    {

    

        public Activity_Master__c act{get; set;}

        public Boolean selected {get; set;}

        public activitywrapper(Activity_Master__c a)

        {

            act = a;

            selected = false;

        }

    }

   

    }

 

Vf page:

<apex:page controller="ActivityOrgdependencyController" sidebar="true">

 

  <script>

  var valuea ;

  function SubmitValue(val){

  var i = val.lastIndexOf(":")

  val = val.substring(0,i);

  var j =  val.lastIndexOf(":")

  val=val.substring(j+1,i);

  //alert(val);

  valuea =val;

 ParentSelection(val);

 

  }

  function getval(){

 

  return valuea ;

  }

  </script>

    <br />

    <br />

       <apex:pageMessages ></apex:pageMessages>

<apex:form >

 

  <apex:actionFunction name="ParentSelection" action="{!ParentSelection}" rerender="radio1" ><!--status="myStatus" >-->

  <apex:param value="" name="Sample" assignTo="{!ids}"/></apex:actionFunction>

 

<body> 

 

  <apex:pageBlock title="Activity Dependency Configuration" id="pbid">

 <div align="center"> <b> <apex:actionStatus startText="Loading Page....." id="myStatus" startStyle="font-size:20px " onstart="PBtable.hidden=true">

    <apex:facet name="start">

             <apex:outputPanel >

                   <apex:image value="/img/loading32.gif" style="height: 30px;"/>

                   <apex:commandButton value="Processing...Please Wait" style="border-style:none;" status="searchStatus" disabled="true"/>                 

               </apex:outputPanel>            

           </apex:facet>   

    </apex:actionstatus>               

    </b></div>

   

 <table id="Table">

 <tr>

<td style="width: 200px;">

<div style="height: 240px" class="bodyDiv" onclick="resizeFrame();">

        <c:OrgHierarchy currentId1="0" />

    </div>

  

</td>

<td>

<table>

<tr>

<td>

<apex:outputPanel id="radio1">

<div align="center" >

    <apex:selectRadio value="{!ind}" style="align:center"  >

    <apex:selectOption itemValue="0"  itemlabel="Parent Activity" />

    <apex:selectOption itemValue="1"  itemlabel="Child Activity"/>

        <apex:actionSupport event="onclick" rerender="activityView" status="myStatus"/>

      

         </apex:selectRadio>

</div>

<div align="left" >

  <b>  {!orgname}</b>

</div>

</apex:outputPanel>

</td>

</tr>

<tr>

<td>

    <apex:outputPanel id="activityView" >

    <apex:pageBlockTable id="PBtable" value="{!ActivityList}" var="a" rows="3" style="font-size:1.0em;" >

 

    <apex:column width="70px" headerValue="Select">

                <Apex:outputPanel id="radio2" rendered="{!ind=='0'}" > <input type="radio" name="group1" id="radio" onclick="SubmitValue(this.parentNode.id)" /></Apex:outputPanel> <!--<input type="radio" name="group1" onclick="SubmitValue" /> -->

 

                          <apex:inputCheckbox value="{!a.selected}" rendered="{!ind!='0'}" id="checkedone">

                         

                          </apex:inputCheckbox>

                        </apex:column>

                         <apex:column width="70px" headerValue="Code" >

                    <apex:outputText value="{!a.act.Code__c}"></apex:outputText> 

                </apex:column>

                         <apex:column width="300px" headerValue="Name">

                    <apex:outputText value="{!a.act.Name}"></apex:outputText>

                </apex:column>

                                             

                          <apex:column width="400px" headerValue="Description" >

                    <apex:outputText value="{!a.act.Description__c}"></apex:outputText>

                </apex:column>

                    <apex:column width="120px" headerValue="Frequency" >

                    <apex:outputText value="{!a.act.Frequency__c}"></apex:outputText>

                </apex:column>

                    <apex:column width="120px" headerValue="Priority" >

                    <apex:outputText value="{!a.act.Priority__c}"></apex:outputText>

                </apex:column>

                          <apex:column width="120px" headerValue="Functional" >

                    <apex:outputText value="{!a.act.Functional__c}"></apex:outputText>

                </apex:column>

                           <apex:column width="120px"  headerValue="Time Zone" >

                    <apex:outputText value="{!a.act.Time_Zone__r.name}"></apex:outputText>

                </apex:column>

              

              </apex:pageBlockTable>

        </apex:outputPanel>

                 </td>

                  </tr>

                    <tr>

                     <td align="center">

     <apex:commandButton action="{!AssignActivities}"  value="Select" status="myStatus" />

     <apex:commandButton action="{!UnAssignActivities}" value="Remove" status="myStatus"/>

</td>

</tr>

</table>

</td>

<td style="width: 200px;">

          <b>Selected Parents:</b><br/>

          <apex:inputTextarea value="{!ParentList}" readonly="true" rows="4" style="width:100%; height:40%"  /><br/>

          <b> Selected Childs: </b>

            <apex:inputTextarea value="{!ChildList}" readonly="true" rows="6" style="width:100%; height:40%" /><br/>

               <br/>

               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <apex:commandButton status="myStatus" Value="Configure"  action="{!configure}" />

           

        </td>

       

 

</tr>

</table>

 

  </apex:pageBlock>

  </body> 

        </apex:form>

</apex:page>

HI experts,

 

Plese anyone can tell me my requriment every radio button is selecting automatically i dont know why please correct my code.

 

vf page:-

 

<apex:page standardController="OrganizationHierarchyMaster__c" extensions="ActivityOrgrelationController" sidebar="true">
    <br />
    <br />
       <apex:pageMessages ></apex:pageMessages>
<apex:form >
<body> 
  <apex:pageBlock title="Activity Organization Alignment" id="pbid">
<table>
<tr>
<td style="width: 150px;">
<div style="height: 250px" class="bodyDiv" onclick="resizeFrame();">
        <c:OrgHierarchy currentId1="{!OrganizationHierarchyMaster__c.OrgName__c}" />
    </div>
  
</td>
<td>
<table>
<tr>
<td>
<div align="center" >
    <apex:selectRadio value="{!ind}" style="align:center">
    <apex:selectOption itemValue="0"  itemlabel="Parent Activity"/>
    <apex:selectOption itemValue="1"  itemlabel="Child Activity"/>
        <apex:actionSupport event="onchange" rerender="activityView" />
         </apex:selectRadio>
</div>
</td>
</tr>
<tr>
<td>
    <apex:outputPanel id="activityView">
    <apex:pageBlockTable value="{!ActivityList}" var="a" style="font-size:1.0em;">
 
    <apex:column width="70px" headerValue="Select">
                 <!--<input type="radio" name="group1" /> -->
     <apex:selectRadio value="{!a.selected}" rendered="{!ind=='0'}" > </apex:selectRadio>
                          <apex:inputCheckbox value="{!a.selected}" rendered="{!ind!='0'}" id="checkedone"/>
                        </apex:column>
                         <apex:column width="70px" headerValue="Code" >
                    <apex:outputText value="{!a.act.Code__c}"></apex:outputText>
                </apex:column>
                         <apex:column width="300px" headerValue="Name">
                    <apex:outputText value="{!a.act.Name}"></apex:outputText>
                </apex:column>
                                            
                          <apex:column width="400px" headerValue="Description" >
                    <apex:outputText value="{!a.act.Description__c}"></apex:outputText>
                </apex:column>
                    <apex:column width="120px" headerValue="Frequency" >
                    <apex:outputText value="{!a.act.Frequency__c}"></apex:outputText>
                </apex:column>
                    <apex:column width="120px" headerValue="Priority" >
                    <apex:outputText value="{!a.act.Priority__c}"></apex:outputText>
                </apex:column>
                          <apex:column width="120px" headerValue="Functional" >
                    <apex:outputText value="{!a.act.Functional__c}"></apex:outputText>
                </apex:column>
                           <apex:column width="120px"  headerValue="Time Zone" >
                    <apex:outputText value="{!a.act.Time_Zone__r.name}"></apex:outputText>
                </apex:column>
              
              </apex:pageBlockTable>
        </apex:outputPanel>
                 </td>
                  </tr>
                    <tr>
                     <td align="center">
     <apex:commandButton action="{!AssignActivities}"  value="Select" />
     <apex:commandButton action="{!UnAssignActivities}" value="Remove"/>
</td>
</tr>
</table>
</td>
<td style="width: 200px;">
          <b>Selected Parents:</b><br/>
          <apex:inputTextarea value="{!ParentList}" readonly="true" rows="4" /><br/>
          <b> Selected Childs: </b>
            <apex:inputTextarea value="{!ChildList}" readonly="true" rows="6" /><br/>
        </td>
       

</tr>
</table>

  </apex:pageBlock>
  </body> 
        </apex:form>
</apex:page>

 

Apex class:-

 

public class ActivityOrgrelationController{
    public String ParentList{set;get;}
    public String ChildList{set;get;}
    public ActivityOrgrelationController() {
idvalue= ApexPages.currentPage().getParameters().get('id');
        Orgname= ApexPages.currentPage().getParameters().get('Org');
    }

    // String orgid = ApexPages.currentPage().getParameters().get('id');
   String orgid;
    public list<Activity_Master__c> ActivityList ;
    public string idvalue {get;set;}
    public string Orgname {get;set;}
  
    public ActivityOrgrelationController(ApexPages.StandardController act)  
    {
     // idvalue= ApexPages.currentPage().getParameters().get('id');
      //  Orgname= ApexPages.currentPage().getParameters().get('Org');
    }
  
   //public PageReference dosomething()    
  //  {
  //      system.debug('test');
   //     string idvalue= ApexPages.currentPage().getParameters().get('id');
   //     system.debug(idvalue);
   //     return null;
   // }
   public String ind {get;set;}
   {
   ind= '1';
   }
    public List<activitywrapper> getActivityList()
    {  
      
        OrgStructure orgs = new OrgStructure();
        orgid = orgs.temporgId;
        Cookie orgCookie;
        orgCookie = ApexPages.currentPage().getCookies().get('Orgid');
        if(idvalue != null)
        {
           // orgid = orgCookie.getValue();
            orgid = idvalue;
            //ind = '0';
            Orgname = 'Choosed Organisation : ' + Orgname;
        }
     
        if(orgid != null)
        {
            if(ind == '0')
            {
             
                actList.clear();
                for(Activity_Master__c a : [Select id,Code__c,Name,Description__c,Frequency__c,Priority__c,Functional__c,Time_Zone__r.name FROM Activity_Master__c
                            where Status__c = 'Active' and id in (Select Activity_Name__c from CT_Org_Activity_Mapping__c
                                                                     WHERE Organisation_Level_Name__c = :orgid)])
                 {
                    actList.add(new activitywrapper(a));
                 }
            }
            else
            {
                actList.clear();
                for(Activity_Master__c a : [Select id,Code__c,Name,Description__c,Frequency__c,Priority__c,Functional__c,Time_Zone__r.name FROM Activity_Master__c
                            where Status__c = 'Active' and id not in (Select Activity_Name__c from CT_Org_Activity_Mapping__c
                                                                     WHERE Organisation_Level_Name__c = :orgid)])
                 {
                    actList.add(new activitywrapper(a));
                 }  
            }
        }
        else
        {
            if(ind == '0')
            {
          
                actList.clear();
                for(Activity_Master__c a : [Select id,Code__c,Name,Description__c,Frequency__c,Priority__c,Functional__c,Time_Zone__r.name FROM Activity_Master__c
                            where Status__c = 'Active' and id  in (Select Activity_Name__c from CT_Org_Activity_Mapping__c)])
                 {
                    actList.add(new activitywrapper(a));
                 } 
            }
            else
            {
           // ind = '1';
                 actList.clear();
                for(Activity_Master__c a : [Select id,Code__c,Name,Description__c,Frequency__c,Priority__c,Functional__c,Time_Zone__r.name FROM Activity_Master__c
                            where Status__c = 'Active' and id not in (Select Activity_Name__c from CT_Org_Activity_Mapping__c)])
                 {
                    actList.add(new activitywrapper(a));
                 } 
            }
        }
       return actList;
    }
        //public List<Activity_Master__c> getAlignedActivityList()
  //  {  
  //  system.debug('orgid : ' + orgid );
   //     ActivityList=[Select id,Code__c,Name,Description__c,Frequency__c,Functional__c,Priority__c,Time_Zone__r.name FROM Activity_Master__c
  //                      where Status__c = 'Active' and id not in (Select Activity_Name__c from CT_Org_Activity_Mapping__c
   //                                                              WHERE Organisation_Level_Name__c = :orgid)];       
   //    return ActivityList;
   // }
     List<activitywrapper> actList = new List<activitywrapper>();
    
     public PageReference AssignActivities()
    {
    try
    {
       // ActivityList.clear();
       if(ind =='0'){
       for(activitywrapper actwrapper : actList)
              {
                if(actwrapper.selected == true)
                {
                     Parentlist = actwrapper.act.Name;
               
              
               }
              }
      }
      else{
              ChildList= '';
           for(activitywrapper actwrapper : actList)
              {
                if(actwrapper.selected == true)
                {
             //   ActivityList.add(actwrapper.act);
                  ChildList += actwrapper.act.Name + '\n';
               
               
               }
              }
     
      }
      }
    catch(Exception e)
        {
            ApexPages.addMessages(e);
        }
       ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'Activities assigned successfully'));
       
     return null;
    }
      public PageReference UnAssignActivities()
    {
    try
    {
       // ActivityList.clear();
        system.debug(actList.size());
       for(activitywrapper actwrapper : actList)
      {
        if(actwrapper.selected == true)
        {       
        
         List<CT_Org_Activity_Mapping__c> orgactmapping = [SELECT Id From CT_Org_Activity_Mapping__c where Activity_Name__c = :actwrapper.act.id
                                                                             AND Organisation_Level_Name__c = :orgid];
            delete orgactmapping ;
         
       }
      }
      }
    catch(Exception e)
        {
            ApexPages.addMessages(e);
        }
       ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'Activities Un-assigned successfully'));
       
     return null;
    }
    public class activitywrapper
    {
    
         public Activity_Master__c act{get; set;}
        public Boolean selected {get; set;}
        public activitywrapper(Activity_Master__c a)
        {
            act = a;
            selected = false;
        }
    }
   
    }

 

 

Thanks in advance

HI experts ,

 

My requirment is that when i click on radio button it has show to show its related records and if i select particular record and if i click on that button called select it has to add seprate box called selected parent activity  which is there to that vf page please tell me how to do that. please tell me in example vise please very urgent

 

Hi experts, Actually i have requirment called when i select parent activity related parent records has to display in radio buttons when i select child activity related child activity has to dispay in check boxes for that i had created one more page block table and i pasted it but while saving this code showing errors please tell me "Error: orgrelation line 100, column 11: The element type "apex:pageblock" must be terminated by the matching end-tag "" Error: The element type "apex:pageblock" must be terminated by the matching end-tag ""." vf page:

 

<apex:page standardController="OrganizationHierarchyMaster__c" extensions="ActivityOrgAlignmentController" sidebar="true">
    <br />
    <br />
       <apex:pageMessages ></apex:pageMessages>
<apex:form >
<body> 
  <apex:pageBlock title="Activity Organization Alignment" id="pbid">
<table>
<tr>
<td style="width: 200px;">
<div style="height: 200px" class="bodyDiv" onclick="resizeFrame();">
        <c:OrgHierarchy currentId1="{!OrganizationHierarchyMaster__c.OrgName__c}" />
    </div>
  
</td>
<td>
<table>
<tr>
<td>
    <apex:selectRadio value="{!ind}">
<apex:selectOption itemValue="0"  itemlabel="parent activity"/>
    <apex:selectOption itemValue="1"  itemlabel="child activity"/>
        <apex:actionSupport event="onchange" rerender="activityView" />
         </apex:selectRadio>
</td>
</tr>
<tr>
<td>
    <apex:outputPanel id="activityView">
    <apex:pageBlockTable value="{!ActivityList}" var="a" style="font-size:1.0em;">
     <apex:column width="70px" headerValue="Select">
     <apex:selectRadio ></apex:selectRadio>


                         <!--<apex:inputCheckbox value="{!a.selected}" id="checkedone"/> -->
                        </apex:column>
                         <apex:column width="70px" headerValue="Code" >
                    <apex:outputText value="{!a.act.Code__c}"></apex:outputText>
                </apex:column>
                         <apex:column width="300px" headerValue="Name">
                    <apex:outputText value="{!a.act.Name}"></apex:outputText>
                </apex:column>
                                            
                          <apex:column width="400px" headerValue="Description" >
                    <apex:outputText value="{!a.act.Description__c}"></apex:outputText>
                </apex:column>
                    <apex:column width="120px" headerValue="Frequency" >
                    <apex:outputText value="{!a.act.Frequency__c}"></apex:outputText>
                </apex:column>
                    <apex:column width="120px" headerValue="Priority" >
                    <apex:outputText value="{!a.act.Priority__c}"></apex:outputText>
                </apex:column>
                          <apex:column width="120px" headerValue="Functional" >
                    <apex:outputText value="{!a.act.Functional__c}"></apex:outputText>
                </apex:column>
                           <apex:column width="120px"  headerValue="Time Zone" >
                    <apex:outputText value="{!a.act.Time_Zone__r.name}"></apex:outputText>
                </apex:column>
              
              </apex:pageBlockTable>
        </apex:outputPanel>
                 </td>
</tr>
</table>
</td>
</tr>
</table>

  <apex:outputPanel id="activityview">
   <apex:pageBlockTable value="{!ActivityList}" var="a" style="font-size:1.0em;">
     <apex:column width="70px" headerValue="Select">
   
                         <apex:inputCheckbox value="{!a.selected}" id="checkedone"/>
                        </apex:column>
                         <apex:column width="70px" headerValue="Code" >
                    <apex:outputText value="{!a.act.Code__c}"></apex:outputText>
                </apex:column>
                         <apex:column width="300px" headerValue="Name">
                    <apex:outputText value="{!a.act.Name}"></apex:outputText>
                </apex:column>
                                            
                          <apex:column width="400px" headerValue="Description" >
                    <apex:outputText value="{!a.act.Description__c}"></apex:outputText>
                </apex:column>
                    <apex:column width="120px" headerValue="Frequency" >
                    <apex:outputText value="{!a.act.Frequency__c}"></apex:outputText>
                </apex:column>
                    <apex:column width="120px" headerValue="Priority" >
                    <apex:outputText value="{!a.act.Priority__c}"></apex:outputText>
                </apex:column>
                          <apex:column width="120px" headerValue="Functional" >
                    <apex:outputText value="{!a.act.Functional__c}"></apex:outputText>
                </apex:column>
                           <apex:column width="120px"  headerValue="Time Zone" >
                    <apex:outputText value="{!a.act.Time_Zone__r.name}"></apex:outputText>
                </apex:column>
              
              </apex:pageBlockTable>
        </apex:outputPanel>
        </td>
                  </tr>
                    <tr>
                     <td align="right">

                     <apex:commandButton action="{!AssignActivities}" value="Assign" />
     <apex:commandButton action="{!UnAssignActivities}" value="UnAssign"/>
     </td>
</tr>
</table>
</td>
</tr>
</table>

</apex:pageBlock>
    </body>

        </apex:form>
</apex:page>

   

 

Hi Experts,

pleaes check my code and i want requirment like this i have to create two radio buttons on top name called parent activity and child activity so when i click on parent activity related parent activity records has to display it should display in radio buttons so when i click a particular parent radio button related child activity records has to display in check boxs and initially when you load page it has display blank when user click DLF heirachey it has to display related records of that display  and one more thing when you clikc on that parent radio button side there a box in that box there record has to move so there is button called configure when i clikc on that configure it has to move into object called activitymaster  anyhow i added my code actually it is in check boxes please convert it in to radio buttons and screen shot im attaching please create vf page and controller like that screens please.

<apex:pagestandardController="OrganizationHierarchyMaster__c" extensions="ActivityOrgAlignmentController" sidebar="true">

<br />

<br />

<apex:pageMessages></apex:pageMessages>

<apex:form>

<body>

<apex:pageBlock title="Activity Organization Alignment" id="pbid">

<table>

<tr>

<td style="width: 200px;">

<div style="height: 200px" class="bodyDiv" onclick="resizeFrame();">

<c:OrgHierarchy currentId1="{!OrganizationHierarchyMaster__c.OrgName__c}" />

</div>



</td>

<td>

<table>

<tr>

<td>

<apex:selectRadio value="{!ind}">

<apex:selectOptionitemValue="0"  itemlabel="assinged Activity"/>

<apex:selectOptionitemValue="0"  itemlabel="unassigned Activity"/>

<apex:actionSupport event="onchange" rerender="activityView" />

</apex:selectRadio>

</td>

</tr>

<tr>

<td>

<apex:outputPanel id="activityView">

<apex:pageBlockTable value="{!ActivityList}" var="a" style="font-size:1.0em;">



<apex:column width="70px" headerValue="Select">

<apex:inputCheckbox value="{!a.selected}" id="checkedone"/>

</apex:column>

<apex:column width="70px" headerValue="Code" >

<apex:outputText value="{!a.act.Code__c}"></apex:outputText>

</apex:column>

<apex:column width="300px" headerValue="Name">

<apex:outputText value="{!a.act.Name}"></apex:outputText>

</apex:column>



<apex:column width="400px" headerValue="Description" >

<apex:outputText value="{!a.act.Description__c}"></apex:outputText>

</apex:column>

<apex:column width="120px" headerValue="Frequency" >

<apex:outputText value="{!a.act.Frequency__c}"></apex:outputText>

</apex:column>

<apex:column width="120px" headerValue="Priority" >

<apex:outputText value="{!a.act.Priority__c}"></apex:outputText>

</apex:column>

<apex:column width="120px" headerValue="Functional" >

<apex:outputText value="{!a.act.Functional__c}"></apex:outputText>

</apex:column>

<apex:column width="120px"  headerValue="Time Zone" >

<apex:outputText value="{!a.act.Time_Zone__r.name}"></apex:outputText>

</apex:column>



</apex:pageBlockTable>

</apex:outputPanel>

</td>

</tr>

<tr>

<td align="right">

<apex:commandButton action="{Assinged Activities}" value="Assign" />

<apex:commandButton action="{!UnAssignActivities}" value="UnAssign"/>

</td>

</tr>

</table>

</td>

</tr>

</table>



</apex:pageBlock>

</body>

</apex:form>

</apex:page>

apex class:

public class ActivityOrgAlignmentController{



publicActivityOrgAlignmentController() {

idvalue= ApexPages.currentPage().getParameters().get('id');

Orgname= ApexPages.currentPage().getParameters().get('Org');

    }



    // String orgid = ApexPages.currentPage().getParameters().get('id');

   String orgid;

public list<Activity_Master__c>ActivityList ;

public string idvalue {get;set;}

public string Orgname {get;set;}



publicActivityOrgAlignmentController(ApexPages.StandardController act) 

    {

     // idvalue= ApexPages.currentPage().getParameters().get('id');

      //  Orgname= ApexPages.currentPage().getParameters().get('Org');

    }



   //public PageReferencedosomething()

  //  {

  //      system.debug('test');

   //     string idvalue= ApexPages.currentPage().getParameters().get('id');

   //     system.debug(idvalue);

   //     return null;

   // }

public String ind {get;set;}

   {

ind= '1';

   }

public List<activitywrapper>getActivityList()

    { 



OrgStructure orgs = new OrgStructure();

orgid = orgs.temporgId;

        Cookie orgCookie;

orgCookie = ApexPages.currentPage().getCookies().get('Orgid');

if(idvalue != null)

        {

           // orgid = orgCookie.getValue();

orgid = idvalue;

            //ind = '0';

Orgname = 'ChoosedOrganisation : ' + Orgname;

        }



if(orgid != null)

        {

if(ind == '0')

            {



actList.clear();

                for(Activity_Master__c a : [Select id,Code__c,Name,Description__c,Frequency__c,Functional__c,Priority__c,Time_Zone__r.name FROM Activity_Master__c

whereStatus__c = 'Active' and id in (Select Activity_Name__c from CT_Org_Activity_Mapping__c

                                                                     WHERE Organisation_Level_Name__c= :orgid)])

                 {

actList.add(new activitywrapper(a));

                 }

            }

else

            {

actList.clear();

                for(Activity_Master__c a : [Select id,Code__c,Name,Description__c,Frequency__c,Functional__c,Priority__c,Time_Zone__r.name FROM Activity_Master__c

whereStatus__c = 'Active' and id not in (Select Activity_Name__c from CT_Org_Activity_Mapping__c

                                                                     WHERE Organisation_Level_Name__c= :orgid)])

                 {

actList.add(new activitywrapper(a));

                 } 

            }

        }

else

        {

if(ind == '0')

            {



actList.clear();

                for(Activity_Master__c a : [Select id,Code__c,Name,Description__c,Frequency__c,Functional__c,Priority__c,Time_Zone__r.name FROM Activity_Master__c

                            where Status__c = 'Active' and id in (Select Activity_Name__c from CT_Org_Activity_Mapping__c)])

                 {

actList.add(new activitywrapper(a));

                 }

            }

else

            {

           // ind = '1';

actList.clear();

                for(Activity_Master__c a : [Select id,Code__c,Name,Description__c,Frequency__c,Functional__c,Priority__c,Time_Zone__r.name FROM Activity_Master__c

                            where Status__c = 'Active' and id not in (Select Activity_Name__c from CT_Org_Activity_Mapping__c)])

                 {

actList.add(new activitywrapper(a));

                 }

            }

        }

returnactList;

    }

        //public List<Activity_Master__c>getAlignedActivityList()

  //  { 

  //  system.debug('orgid : ' + orgid );

 

     List<activitywrapper>actList = new List<activitywrapper>();



publicPageReferenceAssignActivities()

    {

try

    {

       // ActivityList.clear();



for(activitywrapperactwrapper : actList)

      {

if(actwrapper.selected == true)

        {

     //   ActivityList.add(actwrapper.act);



CT_Org_Activity_Mapping__corgactmapping = new CT_Org_Activity_Mapping__c();

orgactmapping.Activity_Name__c = actwrapper.act.id;

orgactmapping.Organisation_Level_Name__c = orgid;

insertorgactmapping;

       }

      }

      }

catch(Exception e)

        {

ApexPages.addMessages(e);

        }

ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'Activities assigned successfully'));



return null;

    }

publicPageReferenceUnAssignActivities()

    {

try

    {

       // ActivityList.clear();

system.debug(actList.size());

for(activitywrapperactwrapper : actList)

      {

if(actwrapper.selected == true)

        {      



         List<CT_Org_Activity_Mapping__c>orgactmapping = [SELECT Id From CT_Org_Activity_Mapping__c where Activity_Name__c= :actwrapper.act.id

                                                                             AND Organisation_Level_Name__c= :orgid];

deleteorgactmapping ;



       }

      }

      }

catch(Exception e)

        {

ApexPages.addMessages(e);

        }

ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'Activities Un-assigned successfully'));



return null;

    }

public class activitywrapper

    {



publicActivity_Master__c act{get; set;}

public Boolean selected {get; set;}

publicactivitywrapper(Activity_Master__c a)

        {

act = a;

selected = false;

        }

    }    }

Hi Experts,

 

I requirment is that how to assign landing pages for different profiles , i have created landing pages but i dont know how to assign these pages to profilesinseated of creating different landing pages for different profiles cant we create a single lading page for different profiles  any how  please could you guide me how to do landing pages for different profiles please. thanks in advance " please give me with naviagation"

Hi Experts,

 

Im very new to salesforce so when i write the program in salesforce , so when i displaying the records in tabluar format but it showing some error "

Visualforce Error


System.QueryException: List has no rows for assignment to SObject
Class.mySecondController.getAccount: line 5, column 1 "

 

please check my code once ,

 

public class mySecondController {
  public Account getAccount() {
    return [select id, name,
            (select id, firstname, lastname
             from Contacts limit 5)
            from Account 
            where id =:System.currentPageReference().getParameters().get('id')];
  }
  public String getName() {
    return 'My Second Custom Controller';
  }
}

visual force page:

 

<apex:page controller="mySecondController" tabStyle="Account">
   <apex:pageBlock title="Hello {!$User.FirstName}!">
   You belong to the {!account.name} account.
   </apex:pageBlock>
   <apex:pageBlock title="Contacts">
   <apex:dataTable value="{!account.Contacts}" var="contact" cellPadding="4" border="1">
    <apex:column >
      {!contact.FirstName}
    </apex:column>
    <apex:column >
      {!contact.LastName}
    </apex:column>
   </apex:dataTable>
   </apex:pageBlock>
</apex:page>

 

Hi Experts,

 

My question is that i want to find  duplicate records on my vf page , for example there are two boxes are there like id and name and one button called sumbit , so when i enter id and name in thoes boxes when i click on that submit button it has to find out the duplicate records, please give me interms of sample code .

 

Thanks in advace

HI Experts,

 

Actually my requirment is that when lead is created with the startdate and endate right so i will assign this lead to some other one so when owner changes of lead so i want to find the days , between this time slot i mean between first owner of lead to second owner of the lead so please guide me how to do that.

 

 

 

Thans in advance

 

 

 

 

 

Hi expert,

 

1.       Create a trigger on External Review object
2.       Whenever the status is “Review Submitted” trigger should fire and pick the Owner from the related opportunity(Lookup on External Review) and send a notification to Proposal Owner
 pls how to do that

HI experts,

 

If the Payment Type is equal to Refund, send a notification when the payment is approved that differs from the notification sent when the Payment Type is not equal to Refund,

when the payment type is equal to refund then we have to create workflow  pls create how to do that

 

 

 

hi experts,

object is opportunity

 

Modified Org Minimal Proposal and 'Individual Layout' and 'OSF Fellowship'  and 'Conference Grant' Page Layouts:  Recommender field mandatory on the Opportunity Page

Hi ,

 

My requirmeent is that there is deal page so we need to create button name called save , when user click on that button what ever data he give it has to save and when user click on the program asscoation it has go deal probram setup page and there is one more button called  program associton when user click on that it has throw an error .

 

This is the code:

 

public class VFC_ProgramSetup{

    public Deal__c dealRecord;
    public List<ProgramWrapper> lstProgramWrapper{get;set;}
    public id DealId2;
    public class ProgramWrapper{
        public Campaign ProgramRecord{get;set;}
        public boolean checkBox{get;set;}
    }

    public VFC_ProgramSetup(){
        PageReference pageRef = ApexPages.currentPage();
        Id DealId = pageRef.getParameters().get('DealId');
        Id CustId = pageRef.getParameters().get('CustId');
        
        DealId2 = DealId;
        //logged in partner details
        User loggedInUser = [select id,name,AccountId from User where id=:UserInfo.getUserId()];
        Account partnerAcc= [select id,Partner_Specializations__c from Account where id = :loggedInUser.AccountId];
       
        //details of End Customer
        Account endCustomer= [select id,Segment__c,Industry__c from Account where id = :CustId];
        
        lstProgramWrapper = new List<ProgramWrapper>();
        Deal__c dealRec = [select Quantity__c, Value__c,id, Product_Category__c from Deal__c where id=:DealId];
        system.debug('####Segment:'+endCustomer.Segment__c); 
        system.debug('####Industry:'+endCustomer.Industry__c);
        system.debug('####Partner_Specializations:'+partnerAcc.Partner_Specializations__c);
        
        string query = 'select id,name, Program_Type__c, Expiration_Date__c, Expiration_duration__c, Quantity__c, Value__c from Campaign';
        String[] opts =  partnerAcc.Partner_Specializations__c.split(';');
        String[] optsProdCat =  dealRec.Product_Category__c.split(';');
        
        //for Partner's Specializations
        boolean hasCondition = false;
        if(!opts.isempty()) {
          hasCondition = true;
          query += '  where Partner_Specializations__c includes (\''+opts[0]+'\'';
          opts.remove(0);
        }
        while(!opts.isempty()) {
          query += ',\''+opts[0]+'\'';
          opts.remove(0);
        }
        if(hasCondition)
          query += ')';

        //for Product Category on Deal
        boolean hasConditionProdCat = false;
        if(!optsProdCat.isempty()) {
          hasConditionProdCat = true;
          query += '  and Product_Category__c includes (\''+optsProdCat[0]+'\'';
          optsProdCat.remove(0);
        }
        while(!optsProdCat.isempty()) {
          query += ',\''+optsProdCat[0]+'\'';
          optsProdCat.remove(0);
        }
        if(hasConditionProdCat)
          query += ')';
          
        //for End Customer's Segment and Industry
        query += ' and Segment__c includes (\''+endCustomer.Segment__c+'\') and Industry__c includes (\''+endCustomer.Industry__c+'\')';
        
        //for Quantity and Value on Deal
        query += ' and Quantity__c <='+dealRec.Quantity__c + ' and Value__c <='+dealRec.Value__c;
        
        system.debug('#########Final Query:'+query);
        List<Campaign> lstEligiblePrograms = Database.query(query);
        
        //fetching the associated programs
        List<String> lstCampaignId = new List<String>();
        for(Deal_Program_Association__c AssociatedProgram :[select id,Campaign__c  from Deal_Program_Association__c where Deal__c=:DealId])
        {
            lstCampaignId.add(AssociatedProgram.Campaign__c);
        }
        
        List<Campaign> lstAssociatedPrograms = [select id from Campaign where id in :lstCampaignId];
        List<Campaign> lstFinalEligiblePrograms = new List<Campaign>();
        boolean flag=false;
        for(Campaign camp:lstEligiblePrograms)
        {
            for(Campaign assCampaign: lstAssociatedPrograms)
            {
                 if(assCampaign.id == camp.id)
                 {
                     flag = true;
                 }   
            }
            if(flag == false)
            {
                lstFinalEligiblePrograms.add(camp);
            }
            flag=false;
        }    

        for(Campaign camp:lstFinalEligiblePrograms)
        {
            ProgramWrapper prog = new ProgramWrapper();
            prog.ProgramRecord = camp;
            prog.checkBox  = false;
            lstProgramWrapper.add(prog);
        }
        if(lstProgramWrapper.size()<1)
        {
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'No Eligible Programs found'));
        }
    }
    
    public VFC_ProgramSetup(ApexPages.StandardController controller){
        this.dealRecord = (Deal__c)controller.getRecord();
    }
        
    public PageReference proceed() 
    {
       try{
           database.upsert(dealRecord);
       }catch(Exception e)
       {
           return null;
       }
       
       PageReference pageRef = Page.SelectProgram;
       pageRef.getParameters().put('DealId', dealRecord.id);
       pageRef.getParameters().put('CustId', dealRecord.End_Customer__c);
       //pageRef.getParameters().put('PartnerId', dealRecord.End_Customer__c);
       //system.debug('##USER Details:'+UserInfo.getUserId());
       return pageRef;
    }
    
    public PageReference SaveProgram() 
    {
       PageReference pageRef = ApexPages.currentPage();
       Id DealId = pageRef.getParameters().get('DealId');
       
       List<ProgramWrapper> lstSelectedPrograms = new List<ProgramWrapper>();
       List<Deal_Program_Association__c> lstDealProgramAssn = new List<Deal_Program_Association__c>();
       for(ProgramWrapper pg:lstProgramWrapper)
       {
           if(pg.checkbox == true){
               lstSelectedPrograms.add(pg);
           }
       }
       
       if(lstSelectedPrograms.size()>0){
           string tempProgramType = lstSelectedPrograms[0].ProgramRecord.Program_Type__c;
           List<Deal_Program_Association__c> lstExistingDPA = [select id,Campaign__r.Program_Type__c  from Deal_Program_Association__c where Deal__c=:DealId];

           for(ProgramWrapper pg:lstSelectedPrograms)
           {
               if(tempProgramType != pg.ProgramRecord.Program_Type__c)
               {
                   ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Programs of similar type can be stacked'));
                   return null;
               }
               else{
                   Deal_Program_Association__c dpa = new Deal_Program_Association__c();
                   dpa.Deal__c = DealId;
                   dpa.Campaign__c = pg.ProgramRecord.id;
                   //dpa.Deal_Registration_Status__c = 'Draft';
                   lstDealProgramAssn.add(dpa);
                   
               }
           }
           if(lstExistingDPA.size()>0 && lstExistingDPA[0].Campaign__r.Program_Type__c != tempProgramType){
                   ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Programs of different type already exists for this Deal'));
                   return null;
           }
           else if(lstExistingDPA.size()+lstDealProgramAssn.size()>3)
           {
               ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'No more than 3 programs of similar type can be stacked'));
               return null;
           }
           else{
               database.insert(lstDealProgramAssn);
           }
       }
       String redirectURL = URL.getSalesforceBaseUrl().toExternalForm()+'/'+DealId;
       PageReference pageRef2 = new PageReference(redirectURL);
       return pageRef2;
    }
    
    public PageReference cancelProgram() 
    {
       /*//try{
       //    if(dealRecord==null){
               Deal__c deal = new Deal__c(id=DealId2);
               database.delete(deal);
          
       //}catch(Exception e)
       //{
         //  return null;
      // }*/
       PageReference pageRef = ApexPages.currentPage();
       Id DealId = pageRef.getParameters().get('DealId');
       //String redirectURL = URL.getSalesforceBaseUrl().toExternalForm()+'/home/home.jsp';
       String redirectURL = URL.getSalesforceBaseUrl().toExternalForm()+'/'+DealId;
       PageReference pageRef2 = new PageReference(redirectURL);
       return pageRef2;
    }
    
}

HI Experts,

while posting my code in developers community, getting this error what does it mean by."The operation is not permitted. If you received this in error, please contact info@developerforce.com (code: B2)"
HI Experts,

while posting my code in developers community, getting this error what does it mean by."The operation is not permitted. If you received this in error, please contact info@developerforce.com (code: B2)"
Hi Experts,

Im new to salesforce i got one doubt what is the difference between pagination and setpagesize and when we will go for the pagination and setpagesize, can we use setpagesize for the standardcontroller and customcontroller , please clear my doubts, i dont know whether this question is right or wrong but looking for the right answer.

Thanks in advance
A fantastic opportunity to join one of the most well-known digital marketing companies in the country.  They are looking to hire immediatly and we have open on-site interview slots set up for the right candidates. We have contract and contract to hire positions The company works . Contact me at (972) 421-4683 or mgray@ettaingroup.com for more information and to set up an interview time. 

Hi Experts,

 

 

 

Add check boxes to a list of records, a  check box in the heading , when the header check box is cheked all the check boxes in the list are check and vice versa.  please provide me with sameple code please

 

 

Thanks in advance

 

 

Hi Experts ,

 

please tell me how to do this if possible a sample code.

 

All the rules related to lead conversion and if I wanted to convert lead and after converging lead only create to account. not contact ,how can i achive this ?

 

thanks in advance

Hi anyone help me about this issue , see i have to two radio buttons name called p-acitivity , c- activity so when i click on p-activity related records has to display and if i select paricular records those reocrds has to move in a list box but its showing error like "ARGUMENT CANNOT BE NULL 1" please tell me what is this error. please anyoen help me this

 

Apex class

public class ActivityOrgdependencyController{

    public String ParentList{set;get;}

    public String ChildList{set;get;}

    private set<id> ChildListW;

    private set<id> parentListW;

    public ActivityOrgdependencyController() {

    idvalue= ApexPages.currentPage().getParameters().get('id');

        Orgname= ApexPages.currentPage().getParameters().get('Org');

        orgidvalue= ApexPages.currentPage().getParameters().get('orgid');

    }

 

    // String orgid = ApexPages.currentPage().getParameters().get('id');

   String orgid;

    public list<Activity_Master__c> ActivityList ;

    public string idvalue {get;set;}

    public string Orgname {get;set;}

    public string orgidvalue {get;set;}

    public ActivityOrgdependencyController(ApexPages.StandardController act)  

    {

         parentListW = new set<id>();

         ChildListW = new set<id>();

     // idvalue= ApexPages.currentPage().getParameters().get('id');

      //  Orgname= ApexPages.currentPage().getParameters().get('Org');

    }

     public string ids{set;get;}

    

    

   public  PageReference ParentSelection()    

   {    system.debug(ids);

       for(activitywrapper awrp: actList){

           awrp.selected=false;

       }

       integer i = Integer.valueof(ids);

       actList[i].selected=true;

      ParentList = OrgNameID+' : '+actList[i].act.CODE__C;

     return null;

    }

    private string OrgNameID;

   private  OrganizationHierarchyMaster__c Org;

   

   public String ind {get;set;}

   {

   ind= '0';

   }

    public List<activitywrapper> getActivityList()

    {  

      

        OrgStructure orgs = new OrgStructure();

        orgid = orgs.temporgId;

        Cookie orgCookie;

        orgCookie = ApexPages.currentPage().getCookies().get('Orgid');

         idvalue= ApexPages.currentPage().getParameters().get('id');

           if(idvalue != null)

        {

            Org = [select name ,OrgName__c, OrganisationLevel__c, OrganisationLevel__r.name from OrganizationHierarchyMaster__c s where id=:idvalue ];

     

           // orgid = orgCookie.getValue();

            orgid = idvalue;

            //ind = '0';

            if(Org .OrganisationLevel__r.Name!=null)

                Orgname = 'Choosed Organisation :'+Org .OrganisationLevel__r.Name +' - ' + Org .Name;

            else

                Orgname = 'Choosed Organisation :' + Org .Name;

        }

        if(Org ==null)

            OrgNameID='';

        else

            OrgNameID=Org .Name;

      

     

        if(orgid != null)

        {

            if(ind == '0')

            {

             

                actList.clear();

                for(Activity_Master__c a : [Select id,Code__c,Name,Description__c,Frequency__c,Priority__c,Functional__c,Time_Zone__r.name FROM Activity_Master__c

                            where Status__c = 'Active' and id in (Select Activity_Name__c from CT_Org_Activity_Mapping__c

                                                                     WHERE Organisation_Level_Name__c = :orgid )])

                 {

                    actList.add(new activitywrapper(a));

                 }

            }

            else

            {

                actList.clear();

                for(Activity_Master__c a : [Select id,Code__c,Name,Description__c,Frequency__c,Priority__c,Functional__c,Time_Zone__r.name FROM Activity_Master__c

                            where Status__c = 'Active' and id not in (Select Activity_Name__c from CT_Org_Activity_Mapping__c

                                                                     WHERE Organisation_Level_Name__c = :orgid )])

                 {

                    actList.add(new activitywrapper(a));

                 }  

            }

        }

        else

        {

            if(ind == '0')

            {

          

                actList.clear();

                for(Activity_Master__c a : [Select id,Code__c,Name,Description__c,Frequency__c,Priority__c,Functional__c,Time_Zone__r.name FROM Activity_Master__c

                            where Status__c = 'Active' and id in (Select Activity_Name__c from CT_Org_Activity_Mapping__c)])

                 {

                    actList.add(new activitywrapper(a));

                 } 

            }

            else

            {

           // ind = '1';

                 actList.clear();

                for(Activity_Master__c a : [Select id,Code__c,Name,Description__c,Frequency__c,Priority__c,Functional__c,Time_Zone__r.name FROM Activity_Master__c

                            where Status__c = 'Active' and id not in (Select Activity_Name__c from CT_Org_Activity_Mapping__c)])

                 {

                    actList.add(new activitywrapper(a));

                 } 

            }

        }

       return actList;

    }

        //public List<Activity_Master__c> getAlignedActivityList()

  //  {  

  //  system.debug('orgid : ' + orgid );

   //     ActivityList=[Select id,Code__c,Name,Description__c,Frequency__c,Functional__c,Priority__c,Time_Zone__r.name FROM Activity_Master__c

  //                      where Status__c = 'Active' and id not in (Select Activity_Name__c from CT_Org_Activity_Mapping__c

   //                                                              WHERE Organisation_Level_Name__c = :orgid)];       

   //    return ActivityList;

   // }

     List<activitywrapper> actList = new List<activitywrapper>();

    

     public PageReference AssignActivities()

    {

   idvalue= ApexPages.currentPage().getParameters().get('id');

    CT_Org_Activity_Mapping__c orgactmapping;

    try

    {

       // ActivityList.clear();

       if(ind =='0'){

       list<CT_Org_Activity_Mapping__c> orgactmappingList = new list<CT_Org_Activity_Mapping__c>();

        integer i = Integer.valueof(ids);

        actList[i].selected=true;

       for(activitywrapper actwrapper : actList)

              {

                if(actwrapper.selected == true)

                {    system.debug('orgactmapping-->'+orgactmapping);

                     Parentlist = OrgNameID+' : '+actwrapper.act.Code__c;

               

                      orgactmapping = new CT_Org_Activity_Mapping__c();

           orgactmapping.Activity_Name__c = actwrapper.act.id;

            orgactmapping.Organisation_Level_Name__c = idvalue;

            orgactmappingList.add(orgactmapping);

       //insert orgactmapping;

      

               }

              

              }

              insert orgactmappingList;

              system.debug('orgactmappingList-->'+orgactmappingList);

              for(CT_Org_Activity_Mapping__c org:orgactmappingList){

              parentListW.add(orgactmapping.id);

              }

              system.debug('parentListW-->'+parentListW);

      }

      else{

              ChildList= '';

             list<CT_Org_Activity_Mapping__c> orgactmappingList = new list<CT_Org_Activity_Mapping__c>();

           for(activitywrapper actwrapper : actList)

              {

                if(actwrapper.selected == true)

                {

             //   ActivityList.add(actwrapper.act);

                  ChildList +=OrgNameID+' : '+ actwrapper.act.code__c + '\n';

                orgactmapping = new CT_Org_Activity_Mapping__c();

           orgactmapping.Activity_Name__c = actwrapper.act.id;

            orgactmapping.Organisation_Level_Name__c = idvalue;

       orgactmappingList.add(orgactmapping );

               

               }

              }

             

             insert orgactmappingList;

             for(CT_Org_Activity_Mapping__c org:orgactmappingList){

             ChildListW.add(org.id);

            

             }

             }

     

      }          

 

     

    catch(Exception e)

        {

            ApexPages.addMessages(e);

        }

       ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'Activities assigned successfully'));

       

     return null;

    }

      public PageReference UnAssignActivities()

    {

    try

    {

       // ActivityList.clear();

        system.debug(actList.size());

       for(activitywrapper actwrapper : actList)

      {

        if(actwrapper.selected == true)

        {       

        

         List<CT_Org_Activity_Mapping__c> orgactmapping = [SELECT Id From CT_Org_Activity_Mapping__c where Activity_Name__c = :actwrapper.act.id

                                                                             AND Organisation_Level_Name__c = :orgid];

            delete orgactmapping ;

         

       }

      }

      }

    catch(Exception e)

        {

            ApexPages.addMessages(e);

        }

       ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'Activities Un-assigned successfully'));

       

     return null;

    }

   

   

    /*Configure Functionality

     desc: Storing Parent activities to CT_Activity_Dependency__c

    */

    public pagereference configure(){

    system.debug('ChildListW-->'+ChildListW);

    system.debug('ParentListW-->'+ParentListW);

    try{

    List<CT_Activity_Dependency__c> Updatelist = new list<CT_Activity_Dependency__c>();

    CT_Activity_Dependency__c dTemp;

    for(id val: ChildListW){

        dTemp = new CT_Activity_Dependency__c ();

        dTemp.Child_Org_Act_Id__c = val;

        Updatelist.add(dTemp);

    }

    for(id val: ParentListW){

        dTemp = new CT_Activity_Dependency__c ();

        dTemp.Parent_Org_Act_Id__c= val;

        Updatelist.add(dTemp);

    }

    system.debug('Updatelist-->'+Updatelist);

    insert Updatelist;

     ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'Activities Configured successfully'));

    }

    catch(exception e){

   

        ApexPages.addMessages(e);

    }

    ChildList='';ParentList='';

    return null;

    }

   

    public class activitywrapper

    {

    

        public Activity_Master__c act{get; set;}

        public Boolean selected {get; set;}

        public activitywrapper(Activity_Master__c a)

        {

            act = a;

            selected = false;

        }

    }

   

    }

 

Vf page:

<apex:page controller="ActivityOrgdependencyController" sidebar="true">

 

  <script>

  var valuea ;

  function SubmitValue(val){

  var i = val.lastIndexOf(":")

  val = val.substring(0,i);

  var j =  val.lastIndexOf(":")

  val=val.substring(j+1,i);

  //alert(val);

  valuea =val;

 ParentSelection(val);

 

  }

  function getval(){

 

  return valuea ;

  }

  </script>

    <br />

    <br />

       <apex:pageMessages ></apex:pageMessages>

<apex:form >

 

  <apex:actionFunction name="ParentSelection" action="{!ParentSelection}" rerender="radio1" ><!--status="myStatus" >-->

  <apex:param value="" name="Sample" assignTo="{!ids}"/></apex:actionFunction>

 

<body> 

 

  <apex:pageBlock title="Activity Dependency Configuration" id="pbid">

 <div align="center"> <b> <apex:actionStatus startText="Loading Page....." id="myStatus" startStyle="font-size:20px " onstart="PBtable.hidden=true">

    <apex:facet name="start">

             <apex:outputPanel >

                   <apex:image value="/img/loading32.gif" style="height: 30px;"/>

                   <apex:commandButton value="Processing...Please Wait" style="border-style:none;" status="searchStatus" disabled="true"/>                 

               </apex:outputPanel>            

           </apex:facet>   

    </apex:actionstatus>               

    </b></div>

   

 <table id="Table">

 <tr>

<td style="width: 200px;">

<div style="height: 240px" class="bodyDiv" onclick="resizeFrame();">

        <c:OrgHierarchy currentId1="0" />

    </div>

  

</td>

<td>

<table>

<tr>

<td>

<apex:outputPanel id="radio1">

<div align="center" >

    <apex:selectRadio value="{!ind}" style="align:center"  >

    <apex:selectOption itemValue="0"  itemlabel="Parent Activity" />

    <apex:selectOption itemValue="1"  itemlabel="Child Activity"/>

        <apex:actionSupport event="onclick" rerender="activityView" status="myStatus"/>

      

         </apex:selectRadio>

</div>

<div align="left" >

  <b>  {!orgname}</b>

</div>

</apex:outputPanel>

</td>

</tr>

<tr>

<td>

    <apex:outputPanel id="activityView" >

    <apex:pageBlockTable id="PBtable" value="{!ActivityList}" var="a" rows="3" style="font-size:1.0em;" >

 

    <apex:column width="70px" headerValue="Select">

                <Apex:outputPanel id="radio2" rendered="{!ind=='0'}" > <input type="radio" name="group1" id="radio" onclick="SubmitValue(this.parentNode.id)" /></Apex:outputPanel> <!--<input type="radio" name="group1" onclick="SubmitValue" /> -->

 

                          <apex:inputCheckbox value="{!a.selected}" rendered="{!ind!='0'}" id="checkedone">

                         

                          </apex:inputCheckbox>

                        </apex:column>

                         <apex:column width="70px" headerValue="Code" >

                    <apex:outputText value="{!a.act.Code__c}"></apex:outputText> 

                </apex:column>

                         <apex:column width="300px" headerValue="Name">

                    <apex:outputText value="{!a.act.Name}"></apex:outputText>

                </apex:column>

                                             

                          <apex:column width="400px" headerValue="Description" >

                    <apex:outputText value="{!a.act.Description__c}"></apex:outputText>

                </apex:column>

                    <apex:column width="120px" headerValue="Frequency" >

                    <apex:outputText value="{!a.act.Frequency__c}"></apex:outputText>

                </apex:column>

                    <apex:column width="120px" headerValue="Priority" >

                    <apex:outputText value="{!a.act.Priority__c}"></apex:outputText>

                </apex:column>

                          <apex:column width="120px" headerValue="Functional" >

                    <apex:outputText value="{!a.act.Functional__c}"></apex:outputText>

                </apex:column>

                           <apex:column width="120px"  headerValue="Time Zone" >

                    <apex:outputText value="{!a.act.Time_Zone__r.name}"></apex:outputText>

                </apex:column>

              

              </apex:pageBlockTable>

        </apex:outputPanel>

                 </td>

                  </tr>

                    <tr>

                     <td align="center">

     <apex:commandButton action="{!AssignActivities}"  value="Select" status="myStatus" />

     <apex:commandButton action="{!UnAssignActivities}" value="Remove" status="myStatus"/>

</td>

</tr>

</table>

</td>

<td style="width: 200px;">

          <b>Selected Parents:</b><br/>

          <apex:inputTextarea value="{!ParentList}" readonly="true" rows="4" style="width:100%; height:40%"  /><br/>

          <b> Selected Childs: </b>

            <apex:inputTextarea value="{!ChildList}" readonly="true" rows="6" style="width:100%; height:40%" /><br/>

               <br/>

               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <apex:commandButton status="myStatus" Value="Configure"  action="{!configure}" />

           

        </td>

       

 

</tr>

</table>

 

  </apex:pageBlock>

  </body> 

        </apex:form>

</apex:page>

Hi Experts,

pleaes check my code and i want requirment like this i have to create two radio buttons on top name called parent activity and child activity so when i click on parent activity related parent activity records has to display it should display in radio buttons so when i click a particular parent radio button related child activity records has to display in check boxs and initially when you load page it has display blank when user click DLF heirachey it has to display related records of that display  and one more thing when you clikc on that parent radio button side there a box in that box there record has to move so there is button called configure when i clikc on that configure it has to move into object called activitymaster  anyhow i added my code actually it is in check boxes please convert it in to radio buttons and screen shot im attaching please create vf page and controller like that screens please.

<apex:pagestandardController="OrganizationHierarchyMaster__c" extensions="ActivityOrgAlignmentController" sidebar="true">

<br />

<br />

<apex:pageMessages></apex:pageMessages>

<apex:form>

<body>

<apex:pageBlock title="Activity Organization Alignment" id="pbid">

<table>

<tr>

<td style="width: 200px;">

<div style="height: 200px" class="bodyDiv" onclick="resizeFrame();">

<c:OrgHierarchy currentId1="{!OrganizationHierarchyMaster__c.OrgName__c}" />

</div>



</td>

<td>

<table>

<tr>

<td>

<apex:selectRadio value="{!ind}">

<apex:selectOptionitemValue="0"  itemlabel="assinged Activity"/>

<apex:selectOptionitemValue="0"  itemlabel="unassigned Activity"/>

<apex:actionSupport event="onchange" rerender="activityView" />

</apex:selectRadio>

</td>

</tr>

<tr>

<td>

<apex:outputPanel id="activityView">

<apex:pageBlockTable value="{!ActivityList}" var="a" style="font-size:1.0em;">



<apex:column width="70px" headerValue="Select">

<apex:inputCheckbox value="{!a.selected}" id="checkedone"/>

</apex:column>

<apex:column width="70px" headerValue="Code" >

<apex:outputText value="{!a.act.Code__c}"></apex:outputText>

</apex:column>

<apex:column width="300px" headerValue="Name">

<apex:outputText value="{!a.act.Name}"></apex:outputText>

</apex:column>



<apex:column width="400px" headerValue="Description" >

<apex:outputText value="{!a.act.Description__c}"></apex:outputText>

</apex:column>

<apex:column width="120px" headerValue="Frequency" >

<apex:outputText value="{!a.act.Frequency__c}"></apex:outputText>

</apex:column>

<apex:column width="120px" headerValue="Priority" >

<apex:outputText value="{!a.act.Priority__c}"></apex:outputText>

</apex:column>

<apex:column width="120px" headerValue="Functional" >

<apex:outputText value="{!a.act.Functional__c}"></apex:outputText>

</apex:column>

<apex:column width="120px"  headerValue="Time Zone" >

<apex:outputText value="{!a.act.Time_Zone__r.name}"></apex:outputText>

</apex:column>



</apex:pageBlockTable>

</apex:outputPanel>

</td>

</tr>

<tr>

<td align="right">

<apex:commandButton action="{Assinged Activities}" value="Assign" />

<apex:commandButton action="{!UnAssignActivities}" value="UnAssign"/>

</td>

</tr>

</table>

</td>

</tr>

</table>



</apex:pageBlock>

</body>

</apex:form>

</apex:page>

apex class:

public class ActivityOrgAlignmentController{



publicActivityOrgAlignmentController() {

idvalue= ApexPages.currentPage().getParameters().get('id');

Orgname= ApexPages.currentPage().getParameters().get('Org');

    }



    // String orgid = ApexPages.currentPage().getParameters().get('id');

   String orgid;

public list<Activity_Master__c>ActivityList ;

public string idvalue {get;set;}

public string Orgname {get;set;}



publicActivityOrgAlignmentController(ApexPages.StandardController act) 

    {

     // idvalue= ApexPages.currentPage().getParameters().get('id');

      //  Orgname= ApexPages.currentPage().getParameters().get('Org');

    }



   //public PageReferencedosomething()

  //  {

  //      system.debug('test');

   //     string idvalue= ApexPages.currentPage().getParameters().get('id');

   //     system.debug(idvalue);

   //     return null;

   // }

public String ind {get;set;}

   {

ind= '1';

   }

public List<activitywrapper>getActivityList()

    { 



OrgStructure orgs = new OrgStructure();

orgid = orgs.temporgId;

        Cookie orgCookie;

orgCookie = ApexPages.currentPage().getCookies().get('Orgid');

if(idvalue != null)

        {

           // orgid = orgCookie.getValue();

orgid = idvalue;

            //ind = '0';

Orgname = 'ChoosedOrganisation : ' + Orgname;

        }



if(orgid != null)

        {

if(ind == '0')

            {



actList.clear();

                for(Activity_Master__c a : [Select id,Code__c,Name,Description__c,Frequency__c,Functional__c,Priority__c,Time_Zone__r.name FROM Activity_Master__c

whereStatus__c = 'Active' and id in (Select Activity_Name__c from CT_Org_Activity_Mapping__c

                                                                     WHERE Organisation_Level_Name__c= :orgid)])

                 {

actList.add(new activitywrapper(a));

                 }

            }

else

            {

actList.clear();

                for(Activity_Master__c a : [Select id,Code__c,Name,Description__c,Frequency__c,Functional__c,Priority__c,Time_Zone__r.name FROM Activity_Master__c

whereStatus__c = 'Active' and id not in (Select Activity_Name__c from CT_Org_Activity_Mapping__c

                                                                     WHERE Organisation_Level_Name__c= :orgid)])

                 {

actList.add(new activitywrapper(a));

                 } 

            }

        }

else

        {

if(ind == '0')

            {



actList.clear();

                for(Activity_Master__c a : [Select id,Code__c,Name,Description__c,Frequency__c,Functional__c,Priority__c,Time_Zone__r.name FROM Activity_Master__c

                            where Status__c = 'Active' and id in (Select Activity_Name__c from CT_Org_Activity_Mapping__c)])

                 {

actList.add(new activitywrapper(a));

                 }

            }

else

            {

           // ind = '1';

actList.clear();

                for(Activity_Master__c a : [Select id,Code__c,Name,Description__c,Frequency__c,Functional__c,Priority__c,Time_Zone__r.name FROM Activity_Master__c

                            where Status__c = 'Active' and id not in (Select Activity_Name__c from CT_Org_Activity_Mapping__c)])

                 {

actList.add(new activitywrapper(a));

                 }

            }

        }

returnactList;

    }

        //public List<Activity_Master__c>getAlignedActivityList()

  //  { 

  //  system.debug('orgid : ' + orgid );

 

     List<activitywrapper>actList = new List<activitywrapper>();



publicPageReferenceAssignActivities()

    {

try

    {

       // ActivityList.clear();



for(activitywrapperactwrapper : actList)

      {

if(actwrapper.selected == true)

        {

     //   ActivityList.add(actwrapper.act);



CT_Org_Activity_Mapping__corgactmapping = new CT_Org_Activity_Mapping__c();

orgactmapping.Activity_Name__c = actwrapper.act.id;

orgactmapping.Organisation_Level_Name__c = orgid;

insertorgactmapping;

       }

      }

      }

catch(Exception e)

        {

ApexPages.addMessages(e);

        }

ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'Activities assigned successfully'));



return null;

    }

publicPageReferenceUnAssignActivities()

    {

try

    {

       // ActivityList.clear();

system.debug(actList.size());

for(activitywrapperactwrapper : actList)

      {

if(actwrapper.selected == true)

        {      



         List<CT_Org_Activity_Mapping__c>orgactmapping = [SELECT Id From CT_Org_Activity_Mapping__c where Activity_Name__c= :actwrapper.act.id

                                                                             AND Organisation_Level_Name__c= :orgid];

deleteorgactmapping ;



       }

      }

      }

catch(Exception e)

        {

ApexPages.addMessages(e);

        }

ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'Activities Un-assigned successfully'));



return null;

    }

public class activitywrapper

    {



publicActivity_Master__c act{get; set;}

public Boolean selected {get; set;}

publicactivitywrapper(Activity_Master__c a)

        {

act = a;

selected = false;

        }

    }    }

Hi Experts,

 

Im very new to salesforce so when i write the program in salesforce , so when i displaying the records in tabluar format but it showing some error "

Visualforce Error


System.QueryException: List has no rows for assignment to SObject
Class.mySecondController.getAccount: line 5, column 1 "

 

please check my code once ,

 

public class mySecondController {
  public Account getAccount() {
    return [select id, name,
            (select id, firstname, lastname
             from Contacts limit 5)
            from Account 
            where id =:System.currentPageReference().getParameters().get('id')];
  }
  public String getName() {
    return 'My Second Custom Controller';
  }
}

visual force page:

 

<apex:page controller="mySecondController" tabStyle="Account">
   <apex:pageBlock title="Hello {!$User.FirstName}!">
   You belong to the {!account.name} account.
   </apex:pageBlock>
   <apex:pageBlock title="Contacts">
   <apex:dataTable value="{!account.Contacts}" var="contact" cellPadding="4" border="1">
    <apex:column >
      {!contact.FirstName}
    </apex:column>
    <apex:column >
      {!contact.LastName}
    </apex:column>
   </apex:dataTable>
   </apex:pageBlock>
</apex:page>

 

Hi Experts,

 

My question is that i want to find  duplicate records on my vf page , for example there are two boxes are there like id and name and one button called sumbit , so when i enter id and name in thoes boxes when i click on that submit button it has to find out the duplicate records, please give me interms of sample code .

 

Thanks in advace

HI experts,

 

If the Payment Type is equal to Refund, send a notification when the payment is approved that differs from the notification sent when the Payment Type is not equal to Refund,

when the payment type is equal to refund then we have to create workflow  pls create how to do that

 

 

 

hi experts,

object is opportunity

 

Modified Org Minimal Proposal and 'Individual Layout' and 'OSF Fellowship'  and 'Conference Grant' Page Layouts:  Recommender field mandatory on the Opportunity Page

hi experts,

 

I have one problem can u tell me ,in what cases we are unble to delete the junction object.

 

Hi experts,

 

i have custom object called deal and standard object called oppotuntiy i created button called convert when i click on that deal has to convert in to opporuntiy its working fine now but my requirement is that

 
Once the deal converts to Opportunity transfer this benefit information to the Opportunity and apply deal benefits to Opportunity Line Items.
 
In opportuniy there is two custom fileds called %incentive and Doller incentive those benefits has to assign only these twoo filds and agian deal benefits to opportunity lineitem
 
 
This is my apexcode:
 
public with sharing class MyDealControllerExtension {
public ApexPages.StandardController CONTROL; 


    public MyDealControllerExtension(ApexPages.StandardController stdController) {
      this.CONTROL = stdController;
 
}
public pageReference doCreateOpportunity() {
 
    Opportunity   newOpp = new Opportunity();
    
    
   Deal__c Deal = [select Id, Name, Distributor__c, End_Customer__c, Industry__c, Partner_Specializations__c,Partner_Tier__c,Product_Category__c,Segment__c from Deal__c where id = :CONTROL.getId()];
 
     // add your field mappings here  
 
    newOpp.Name = Deal.Name;
    newOpp.stagename = 'Negotiation/Review';
    newOpp.CloseDate= system.today()+30;
    Deal.Deal_Status__c = 'Converted';
    
 // etc.
 
 
     insert newOpp;
 
     pageReference p = new pageReference('/' + newOpp.id);
 
    p.setRedirect(true);
 
     return p;
    }
 
Vf page:
 
<apex:page standardController="Deal__c" extensions="MyDealControllerExtension" action="{!doCreateOpportunity}" />

HI experts,

 

There is deal custom object and opporunity standard i created one button name called convert in deal object so when user click on that deal objects what ever are there it has covert in to opportunity so my requriment is now only approved deal has to convert opportuntiy so give me idea on this pls.

 

 

Hi All,

 

I am using addError method in a trigger to show some error messages.  I need to show the error message in two different lines, like below

 

***DO NOT ISSUE THIS ORDER***

***The order is currently with the DEV team***

 

I am unable to add the break between the lines. I tried the below:

 

AMet[0].addError('***DO NOT ISSUE THIS ORDER***'+BR()+'***The order is currently with the DEV team***');

 

But it says, there is no BR() method.

 

Help!!!

 

Thanks,

community