urgent requirment - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
kundan kkkundan kk 

urgent requirment

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;

        }

    }    }

im attaching scnees related to my code please prepare my code like screens pleaase
David LiuDavid Liu
Hey Kundan,

We want to help you but need some of your help first!

- That's too much code to look at!
- The code doesn't format very well here
- Try minimizing the problem as much as possible so we don't have to understand the entire code to help!

David
kundan kkkundan kk
its nothing much there is radio button called activity master its related records are displyaing in check boxes i want those in radio buttons and unassigned actvities are there those have to display ccheck boxes once you copy ur code you will get to know entire thing please help me out
kundan kkkundan kk
i want requirment as shown in the screens please