• Varun Annadata
  • NEWBIE
  • 118 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 69
    Questions
  • 31
    Replies
How does sharing rules of campaign impact adding of members to campaigns?Will it add more members than what is selected using segmentation filters if they are sharing rules in place?
I am not able to install the component.I am getting the error that i dont have enough permissions to install the app.

User-added image
I have loggined into workbench with my production credentials.I am not able to access account standard object.Do i need to provide any access in the Production Org for it to reflect?


User-added image
User-added image

Is it possible to change the fields available here and add campaign fields?
What is meant by sent status of campaign member?Does it mean a mail is sent to the member?User-added image
@isTest

private class ContactInfoDeleteTriggerTestMVN {
    
    @isTest 
    private static void testDelete() {
        TestDataFactoryMVN.createFieldSetMappings();
        TestDataFactoryMVN.createPSSettings();

        Account doc = TestDataFactoryMVN.createPhysician();
        Account pat = TestDataFactoryMVN.createMember();
        Program_MVN__c prog = TestDataFactoryMVN.createProgram();
        Program_Stage_MVN__c parent = TestDataFactoryMVN.createParentProgramStage(prog);
        Program_Stage_MVN__c child = TestDataFactoryMVN.createChildProgramStage(prog, parent);
        Program_Member_MVN__c member = TestDataFactoryMVN.createProgramMember(prog, pat);
        Address_vod__c add = TestDataFactoryMVN.createTestAddress(pat);

        List<Contact_Information_MVN__c> info = [SELECT Id,Name FROM Contact_Information_MVN__c WHERE Address_MVN__c = :add.Id];
        system.debug('Varun1'+info);
        //System.assertEquals(1, info.size(), 'Incorrect number of contact information records retrieved.');

        List<Communication_Preference_MVN__c> pref = [SELECT Id,Name FROM Communication_Preference_MVN__c WHERE Contact_Information_MVN__c = :info[0].Id];
        system.debug('VArun'+pref);
        System.assertEquals(1, pref.size(), 'Incorrect number of communication preference records retrieved.');
        Id testCommPrefId = pref[0].Id;

        delete info[0];

        info = [SELECT Id FROM Contact_Information_MVN__c WHERE Address_MVN__c = :add.Id];
        pref = [SELECT Id FROM Communication_Preference_MVN__c WHERE Id = :testCommPrefId];
        List<Address_vod__c> adds = [SELECT Id FROM Address_vod__c WHERE Id = :add.Id];

        System.assertEquals(0, info.size(), 'Should have returned no contact information records');
        System.assertEquals(0, pref.size(), 'Should have returned no communcation preference records');
        System.assertEquals(0, adds.size(), 'Should have returned no address records');
    }
}

I am getting System.List Exception at Line         List<Communication_Preference_MVN__c> pref = [SELECT Id,Name FROM Communication_Preference_MVN__c WHERE Contact_Information_MVN__c = :info[0].Id];

Any help why this error is coming in production?
I have two process builders
One will be updating a lookup object due/Date when triggering object process builder is fired
second one will check the lookup object due/date and will change its status
Both process builders are triggered from same object and with same conditions
So for second process builder i have to get Due/Date which should not be updated by first process builder

So If there are more than two process builders for a object which one will be running first or they will be running simultaneously?
My Vf Page:
<apex:page standardcontroller="Program_Member_MVN__c" extensions="ProgramMemberCaseAttachment" showHeader="false" >
<head>
        <apex:includeScript value="/support/console/40.0/integration.js"/>
        <apex:includescript value="/soap/ajax/33.0/connection.js"/>
        <apex:includescript value="/soap/ajax/33.0/apex.js"/>
        <apex:includescript value="//code.jquery.com/jquery-1.11.1.min.js"/>
        <apex:includescript value="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js"/>
        <apex:stylesheet value="//cdn.datatables.net/1.10.4/css/jquery.dataTables.css"/>
        <script type="text/javascript">
            j$ = jQuery.noConflict();
            j$(document).ready( function () {
                var contactTable = j$('[id$="accounttable"]').DataTable({
                    
                });
            });
                         
            <!-- var Type = '{!AttType}';
             
            const selectEl = document.getElementById('{!$Component.newPageBlock.Section.DateRange}');-->
             
            function Callmefunc()
               {
                
                alert(document.getElementById('{!$Component.form.newPageBlock.Section.DateRange}'));
                if(document.getElementById('{!$Component.form.newPageBlock.Section.DateRange}') == 'None')
                    {
                alert('Select a Type');
                    }                    
                }
          
        </script>
            
</head>


            <apex:form id="form">
                                   
            <!--<apex:pageMessages id="showmsg"></apex:pageMessages>-->
            
            <apex:pageBlock id="newPageBlock">
            
            <apex:pageBlockSection title="Input Type" columns="3" >
            <apex:outputLabel ></apex:outputLabel>
            <apex:repeat value="{!fields}" var="f">
              <apex:inputField value="{!docList[f.fieldPath]}" label="Select Input Type (then click save) =>"/>
            </apex:repeat>
            
            </apex:pageBlockSection>
            
            <apex:pageBlockSection columns="3" id="Section">
            
            <!--<apex:outputLabel ></apex:outputLabel>

            <apex:outputLabel style="font-weight:bold"><p1>Select Input Type (then click save) =></p1>
                        
            <apex:selectList id="DateRange" value="{!AttType}" size="0"  style="background-color:{!(IF(AttType!=null,'red','white'))}">
                            <apex:actionSupport event="onchange" action="{!processSelected1}"/>
                            <apex:selectOption itemValue="None" itemLabel="None"/>
                            <apex:selectOption itemValue="Chart Notes" itemLabel="Chart Notes"/>
                            <apex:selectOption itemValue="Consent" itemLabel="Consent"/>
                            <apex:selectOption itemValue="Insurance Communication" itemLabel="Insurance Communication"/>
                            <apex:selectOption itemValue="MDO Communication" itemLabel="MDO Communication"/>
                            <apex:selectOption itemValue="PA Form" itemLabel="PA Form"/>
                            <apex:selectOption itemValue="Patient Communication" itemLabel="Patient Communication"/>
                            <apex:selectOption itemValue="SRF Incomplete" itemLabel="SRF Incomplete"/>
                            <apex:selectOption itemValue="SRF PFS" itemLabel="SRF PFS"/>
                            <apex:selectOption itemValue="SRF Rebidose" itemLabel="SRF Rebidose"/>
                            <apex:selectOption itemValue="SRF Sample" itemLabel="SRF Sample"/>

                        </apex:selectList>
                        
                        </apex:outputLabel>-->
                        
            <!--<apex:outputText value="{!callfunc}" escape="false"></apex:outputText>-->
            
            </apex:pageBlockSection>
          
            <apex:pageBlockTable id="accounttable" value="{!PMresults}" var="N" columnClasses="display">
                        
            <apex:column headerValue="Save">
            
            <apex:commandLink value="Save" action="{!processSelected}" oncomplete="window.location.href='/apex/ProgramMemberCaseAttachment?id={!Program_Member_MVN__c.id}'; return false">
                        
            <apex:param name="{!N.Attachment_Id__c}" value="{!N.Attachment_Id__c}" assignTo="{!Attid}"/>

            </apex:commandLink>
            
            </apex:column>
            
            <!--<apex:column headerValue="Attachment Name">
            
            <apex:outputField value="{!N.Attachment_Name__c}"/>     
                  
            </apex:column>-->
            
            <apex:column headerValue="Attachment">
            
            <apex:outputField value="{!N.Attachment__c}"/>      
                  
            </apex:column>
            
            <apex:column headerValue="Type">
            
            <apex:outputField value="{!N.Type__c}"/>      
                  
            </apex:column>
            
            <apex:column headerValue="PM Number">
            
            <apex:outputLink value="/{!N.Program_Member_Lookup__c}" target="_blank">{!N.Program_Member_Lookup__r.Name}</apex:outputLink>     
                  
            </apex:column>
            
            <apex:column headerValue="Case Number">
            
            <apex:outputLink value="/{!N.Case_Lookup__c}" target="_blank">{!N.Case_Lookup__r.Casenumber}</apex:outputLink>     
                  
            </apex:column>
            
            <apex:column headerValue="Created Date">
            
            <apex:outputField value="{!N.Created_Date__c}"/>    
                  
            </apex:column>
            
            <!--<apex:column headerValue="Name">
            
            <apex:outputLink value="/{!N.Id}" target="_blank">{!N.Name}</apex:outputLink>
            
            </apex:column>-->
            
            <apex:column headerValue="Description">
            
            <apex:outputField value="{!N.Attachment_Description__c}"/>    
                  
            </apex:column>
                  
            </apex:pageBlockTable>
      
            </apex:pageBlock>
            
            </apex:form>
</apex:page>
Apex Class:
 
/**
*  ProgramMemberCaseAttachment
*  Created By:     Varun 
 *  Created On:     11/07/2017
*  Description:    This class is responsible for displaying Attachment Details
                     Under Each Program Member
*                  
 **/
public with sharing class ProgramMemberCaseAttachment{

    public Attachment_Type__c docList{get; set;}

    public string callfunc{get;set;}

    public string AttType{get;set;}

    public Id Attid{get;set;}
    
    public List<Attachment_Type__c> PMresults{get;set;}
        
    public Program_Member_MVN__c cs;
    
    public ProgramMemberCaseAttachment(ApexPages.StandardController controller)
    {
    
    //AttType ='';
    
    cs=(Program_Member_MVN__c)controller.getRecord();
        
    List<case> Test = new List<case>([select id from case where Program_Member_MVN__c =: cs.id]);
    
    System.debug('Test:'+Test);
    
    List<String> Id = new List<String>();
    
    System.debug('AttType:'+AttType);
    
    for(case Cs1 : Test){
    
    Id.add(Cs1.id);
    
    }
    
    PMresults = [select Created_Date__c,Program_Member_Lookup__r.Name,Case_Lookup__r.Casenumber,Attachment__c,Case_Lookup__c,Program_Member_Lookup__c,Attachment_Id__c,Parent_Id__c,Id,Attachment_Name__c,Attachment_Description__c,Name,Type__c from Attachment_Type__c where Program_Member_Lookup__c =: cs.id OR Case_Lookup__c IN: Id];
    
    System.debug('PMresults '+PMresults );
    
    }
    
    public List<Schema.FieldSetMember> getFields() {
        return SObjectType.Attachment_Type__c.FieldSets.Attachment_Type.getFields();
    }
    
    public void processSelected1(){
    
    //AttType = System.currentPageReference().getParameters().get('Test');
    
    System.debug('AttType'+AttType);
    
    }
    
    public void processSelected(){
    
    String strList = String.valueOf(docList);
    
    System.debug('AttType 1'+AttType);
    
    System.debug('AttType 2'+docList);
    
    List<Attachment_Type__c> PMType = new List<Attachment_Type__c>();
    
    Attachment_Type__c At1 = new Attachment_Type__c ();
    
    At1 = [select Type__c from Attachment_Type__c where Attachment_Id__c =: Attid];
    
    System.debug('At1 '+At1 );
    
    if(strList == 'None'){
    
     //pagereference p = apexpages.Currentpage();
     
      //ApexPages.Message myMsg = new ApexPages.Message(ApexPages.severity.FATAL,'You can not choose none');
      
      //ApexPages.addMessage(myMsg);
      
     //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.FATAL,'You can not choose none'));
    
    //callfunc = '<script> Callmefunc(); </script>';
    
    }
    
    else{
    
    At1.Type__c  = strList;
    
    
    PMType.add(At1);
    
    }

          set<Attachment_Type__c> dedupSet = new set<Attachment_Type__c>();
          dedupSet.addAll(PMType);
          List<Attachment_Type__c> dedupList = new List<Attachment_Type__c>();
          dedupList.addAll(dedupSet);
          System.debug('dedupList'+dedupList);
          Update dedupList;
       
    }
    
    }

I want to pass the Input Field of type picklist to apex Class which i am displaying in Vf page using fieldset.I am not able to get the value in the apex class.where Am i going Wrong?
 
My Vf Page:
<apex:page standardcontroller="Program_Member_MVN__c" extensions="ProgramMemberCaseAttachment" showHeader="false" >
<head>
        <apex:includescript value="//code.jquery.com/jquery-1.11.1.min.js" / >
        <apex:includescript value="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js" />
        <apex:stylesheet value="//cdn.datatables.net/1.10.4/css/jquery.dataTables.css" />
        <script>
            j$ = jQuery.noConflict();
            j$(document).ready( function () {
                var contactTable = j$('[id$="accounttable"]').DataTable({
                    
                });
            });
                         
            <!-- var Type = '{!AttType}';
             
            const selectEl = document.getElementById('{!$Component.newPageBlock.Section.DateRange}');-->
             
            function Callmefunc()
               {
                
                   alert('Select a Type');
                    
                }
          
        </script>
            
</head>


            <apex:form id="form">
            
            <apex:pageBlock id="newPageBlock">
            
            <apex:pageBlockSection columns="3" id="Section">
            
            <apex:outputLabel ></apex:outputLabel>
          
            <apex:outputLabel style="font-weight:bold"><p1>Select Input Type (then click save) =></p1>
                        
            <apex:selectList id="DateRange" value="{!AttType}" size="0"  style="background-color:{!(IF(AttType!=null,'red','white'))}">
                            <apex:actionSupport event="onchange" action="{!processSelected1}"/>
                            <apex:selectOption itemValue="None" itemLabel="None"/>
                            <apex:selectOption itemValue="Type1" itemLabel="Type1"/>
                            <apex:selectOption itemValue="Type2" itemLabel="Type2"/>
                            <apex:selectOption itemValue="Type3" itemLabel="Type3"/>
                        </apex:selectList>
                        
                        </apex:outputLabel>

            <apex:outputText value="{!callfunc}" escape="false"></apex:outputText>
            
            </apex:pageBlockSection>
          
            <apex:pageBlockTable id="accounttable" value="{!PMresults}" var="N" columnClasses="display">
                        
            <apex:column headerValue="Save">
            
            <apex:commandLink value="Save" action="{!processSelected}" oncomplete="window.location.href='/apex/ProgramMemberCaseAttachment?id={!Program_Member_MVN__c.id}'; return false">
                        
            <apex:param name="{!N.Attachment_Id__c}" value="{!N.Attachment_Id__c}" assignTo="{!Attid}"/>

            </apex:commandLink>
            
            </apex:column>
            
            <!--<apex:column headerValue="Attachment Name">
            
            <apex:outputField value="{!N.Attachment_Name__c}"/>     
                  
            </apex:column>-->
            
            <apex:column headerValue="Attachment">
            
            <apex:outputField value="{!N.Attachment__c}"/>      
                  
            </apex:column>
            
            <apex:column headerValue="Type">
            
            <apex:outputField value="{!N.Type__c}"/>      
                  
            </apex:column>
            
            <apex:column headerValue="PM Number">
            
            <apex:outputLink value="/{!N.Program_Member_Lookup__c}" target="_blank">{!N.Program_Member_Lookup__r.Name}</apex:outputLink>     
                  
            </apex:column>
            
            <apex:column headerValue="Case Number">
            
            <apex:outputLink value="/{!N.Case_Lookup__c}" target="_blank">{!N.Case_Lookup__r.Casenumber}</apex:outputLink>     
                  
            </apex:column>
            
            <!--<apex:column headerValue="Name">
            
            <apex:outputLink value="/{!N.Id}" target="_blank">{!N.Name}</apex:outputLink>
            
            </apex:column>-->
            
            <apex:column headerValue="Description">
            
            <apex:outputField value="{!N.Attachment_Description__c}"/>    
                  
            </apex:column>
                  
            </apex:pageBlockTable>
      
            </apex:pageBlock>
            
            </apex:form>
</apex:page>
My Apex Class:
/**
*  ProgramMemberCaseAttachment
*  Created By:     Varun 
 *  Created On:     11/07/2017
*  Description:    This class is responsible for displaying Attachment Details
                     Under Each Program Member
*                  
 **/
public with sharing class ProgramMemberCaseAttachment{

    public string callfunc{get;set;}

    public string AttType{get;set;}

    public Id Attid{get;set;}
    
    public List<Attachment_Type__c> PMresults{get;set;}
        
    public Program_Member_MVN__c cs;
    
    public ProgramMemberCaseAttachment(ApexPages.StandardController controller)
    {
    
    //AttType ='';
    
    cs=(Program_Member_MVN__c)controller.getRecord();
        
    List<case> Test = new List<case>([select id from case where Program_Member_MVN__c =: cs.id]);
    
    System.debug('Test:'+Test);
    
    List<String> Id = new List<String>();
    
    System.debug('AttType:'+AttType);
    
    for(case Cs1 : Test){
    
    Id.add(Cs1.id);
    
    }
    
    PMresults = [select Program_Member_Lookup__r.Name,Case_Lookup__r.Casenumber,Attachment__c,Case_Lookup__c,Program_Member_Lookup__c,Attachment_Id__c,Parent_Id__c,Id,Attachment_Name__c,Attachment_Description__c,Name,Type__c from Attachment_Type__c where Program_Member_Lookup__c =: cs.id OR Case_Lookup__c IN: Id];
    
    System.debug('PMresults '+PMresults );
    
    }
    
    public void processSelected1(){
    
    //AttType = System.currentPageReference().getParameters().get('Test');
    
    System.debug('AttType'+AttType);
    
    }
    
    public void processSelected(){
    
    System.debug('AttType 1'+AttType);
    
    List<Attachment_Type__c> PMType = new List<Attachment_Type__c>();
    
    Attachment_Type__c At1 = new Attachment_Type__c ();
    
    At1 = [select Type__c from Attachment_Type__c where Attachment_Id__c =: Attid];
    
    System.debug('At1 '+At1 );
    
    if(AttType == 'None'){
    
    callfunc = '<script> Callmefunc(); </script>';
    
    }
    
    else{
    
    At1.Type__c  = AttType ;
    
    
    PMType.add(At1);
    
    }

          set<Attachment_Type__c> dedupSet = new set<Attachment_Type__c>();
          dedupSet.addAll(PMType);
          List<Attachment_Type__c> dedupList = new List<Attachment_Type__c>();
          dedupList.addAll(dedupSet);
          System.debug('dedupList'+dedupList);
          Update dedupList;
       
    }
    
    }

I am trying to call a javascript function from apex class when a None Picklist vlaue is selected.I am not able to get a alert message on the vf page.Where am i doing wrong? 
 
My Vf Page:

<apex:page standardcontroller="Program_Member_MVN__c" extensions="ProgramMemberCaseAttachment" showHeader="false" >
<head>
        <apex:includescript value="//code.jquery.com/jquery-1.11.1.min.js" / >
        <apex:includescript value="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js" />
        <apex:stylesheet value="//cdn.datatables.net/1.10.4/css/jquery.dataTables.css" />
        <script>
            j$ = jQuery.noConflict();
            j$(document).ready( function () {
                var contactTable = j$('[id$="accounttable"]').DataTable({
                    
                });
            });
            
            function Callmefunc()
               {
                  var error='{!AttType}';
                  
                  if({error == 'None') {
                  
                  alert("Please select a Type");
                  
                  }
                }
                
               
    
        </script>
            
</head>
            <apex:form >
            
            <apex:pageBlock id="newPageBlock">
            
            <apex:pageBlockSection columns="3">
            
            <apex:outputLabel ></apex:outputLabel>
          
            <apex:outputLabel style="font-weight:bold"><p1>Input Type:::::</p1>
                        
            <apex:selectList id="DateRange" value="{!AttType}" size="0"  style="background-color:{!(IF(AttType!=null,'red','white'))}">
                            <apex:actionSupport event="onchange" action="{!processSelected1}"/>
                            <apex:selectOption itemValue="None" itemLabel="None"/>
                            <apex:selectOption itemValue="Type1" itemLabel="Type1"/>
                            <apex:selectOption itemValue="Type2" itemLabel="Type2"/>
                            <apex:selectOption itemValue="Type3" itemLabel="Type3"/>
                        </apex:selectList>
                        
                        </apex:outputLabel>
            
            </apex:pageBlockSection>
          
            <apex:pageBlockTable id="accounttable" value="{!PMresults}" var="N" columnClasses="display">
            
            <apex:column headerValue="Save">
            
            <apex:commandLink value="Save" action="{!processSelected}" oncomplete="window.location.href='/apex/ProgramMemberCaseAttachment?id={!Program_Member_MVN__c.id}'; return false" onclick="Callmefunc();">
                        
            <apex:param name="{!N.Attachment_Id__c}" value="{!N.Attachment_Id__c}" assignTo="{!Attid}"/>

            </apex:commandLink>
            
            </apex:column>
            
            <!--<apex:column headerValue="Attachment Name">
            
            <apex:outputField value="{!N.Attachment_Name__c}"/>     
                  
            </apex:column>-->
            
            <apex:column headerValue="Attachment">
            
            <apex:outputField value="{!N.Attachment__c}"/>      
                  
            </apex:column>
            
            <apex:column headerValue="Type">
            
            <apex:outputField value="{!N.Type__c}"/>      
                  
            </apex:column>
            
            <apex:column headerValue="Pm Number">
            
            <apex:outputLink value="/{!N.Program_Member_Lookup__c}" target="_blank">{!N.Program_Member_Lookup__r.Name}</apex:outputLink>     
                  
            </apex:column>
            
            <apex:column headerValue="Case Number">
            
            <apex:outputLink value="/{!N.Case_Lookup__c}" target="_blank">{!N.Case_Lookup__r.Casenumber}</apex:outputLink>     
                  
            </apex:column>
            
            <!--<apex:column headerValue="Name">
            
            <apex:outputLink value="/{!N.Id}" target="_blank">{!N.Name}</apex:outputLink>
            
            </apex:column>-->
            
            <apex:column headerValue="Description">
            
            <apex:outputField value="{!N.Attachment_Description__c}"/>    
                  
            </apex:column>
                  
            </apex:pageBlockTable>
      
            </apex:pageBlock>
            
            </apex:form>
</apex:page>

I am trying to display alert message when "None" picklist is selected but i am not getting the alert message.Where am i going wrong?
Vf Page:
 
<apex:page standardcontroller="Program_Member_MVN__c" extensions="ProgramMemberCaseAttachment" showHeader="false" >
 <head>
        <apex:includescript value="//code.jquery.com/jquery-1.11.1.min.js" / >
        <apex:includescript value="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js" />
        <apex:stylesheet value="//cdn.datatables.net/1.10.4/css/jquery.dataTables.css" />
        <script>
            j$ = jQuery.noConflict();
            j$(document).ready( function () {
                var contactTable = j$('[id$="accounttable"]').DataTable({
                    
                });
            });
            
            
            function Callmefunc(id)
               {
                  // alert(''+id); 
                   var type = document.getElementById(id).value;
                   
                   jQuery('[id$=myHiddenField]').val(id);
                   
                   alert(type);
                    check(type); 
                    //return true;                 
                }
            
        </script>
 </head>
            <apex:form >
            <body>
            <table id="accounttable" class="display"  >
            <thead>
                <tr>
                    <th>Edit</th>
                    <th>ID</th>
                    <th>Name</th>
                    <th>Type</th>
                    <th>Attachment Name</th>
                    <th>Description</th>
                   
                </tr>
            </thead>
            <tbody> 
            
                    <apex:actionFunction name="Callmefunc" action="{!processSelected1}" >
                    <apex:param name="test" value="myHiddenField" assignTo="{!AttType}"/>
                    </apex:actionFunction>
                
                 

            
                <apex:repeat value="{!PMresults}" var="N">
                
                        <tr>
                        
                        <!--<apex:inputHidden value="{!AttType}" id="myHiddenField"/>-->
                        
                        <!--<td><apex:commandLink value="Edit" action="{!URLFOR($Action.Attachment_Type__c.Edit, N.Id ,[saveURL='/'+N.Id,retURL='/'+N.Id,saveandnewURL='/'+N.Id])}" target="_blank" styleClass="btn" style="text-decoration:none;padding:1px;"/> -->
                        
                        <td><apex:commandLink value="Save" action="{!processSelected}">
                        
                        <apex:param name="{!N.Program_Memeber_Id__c}" value="{!N.Program_Memeber_Id__c}" assignTo="{!Attid}"/>
                        
                        <!--<apex:param name="{!N.Type__c}" value="{!N.Type__c}" assignTo="{!AttType}"/> -->

                        </apex:commandLink>
  
                        </td>
                        
                        <td><apex:outputField value="{!N.Program_Memeber_Id__c}" /></td>
                        
                        <td><apex:outputLink value="/{!N.Id}" target="_blank">{!N.Name}</apex:outputLink></td>
                        
                        <td><apex:inputField value="{!N.Type__c}" id="Check"  onchange="Callmefunc('{!$Component.check}');">
                    
                        <!--<apex:param name="Check" value="{!N.Program_Memeber_Id__c}" assignTo="{!Attid}"/>-->
                                                     
                        </apex:inputField> 
                         
                        </td>
                         
                    <!--<td><apex:outputtext value="{!Attid}"/></td>-->
                 
                    
                        <td><apex:outputField value="{!N.Attachement_Name__c}"/></td> 
                        
                        
                        <td><apex:outputField value="{!N.Attachment_Description__c}"/></td>
                   
                    <!--<td>{!N.At.LastModifiedDate}</td>-->
                   

                    <!--<td>
                    <apex:outputField value="{!N.At.Description}"/></td>-->

                        </tr>    
                                                                       
                </apex:repeat>
            </tbody>
            </table>
            </body>
            </apex:form>
</apex:page>

Apex class:
/**
 *  ProgramMemberCaseAttachment
 *  Created By:     Varun 
 *  Created On:     11/07/2017
 *  Description:    This class is responsible for displaying Attachment Details
                     Under Each Program Member
 *                  
 **/
public with sharing class ProgramMemberCaseAttachment{

    public string AttType{get;set;}

    public Id Attid{get;set;}
    
    public List<Attachment_Type__c> PMresults{get;set;}
        
    public Program_Member_MVN__c cs;
    
    public ProgramMemberCaseAttachment(ApexPages.StandardController controller)
    {
    
    //AttType ='';
    
    cs=(Program_Member_MVN__c)controller.getRecord();
        
    List<case> Test = new List<case>([select id from case where Program_Member_MVN__c =: cs.id]);
    
    System.debug('Test:'+Test);
    
    List<String> Id = new List<String>();
    
    System.debug('AttType:'+AttType);
    
    for(case Cs1 : Test){
    
    Id.add(Cs1.id);
    
    }
    
    PMresults = [select Program_Memeber_Id__c,Id,Attachement_Name__c,Attachment_Description__c,Name,Type__c from Attachment_Type__c where Program_Memeber_Id__c =: cs.id OR Program_Memeber_Id__c IN: Id];
    
    System.debug('PMresults '+PMresults );
    
    }
    
    public void processSelected1(){
    
    //AttType = System.currentPageReference().getParameters().get('Test');
    
    System.debug('AttType'+AttType);
    
    }
    
    public void processSelected(){
    
    System.debug('AttType 1'+AttType );
    
    List<Attachment_Type__c> PMType = new List<Attachment_Type__c>();
    
    Attachment_Type__c At1 = new Attachment_Type__c ();
    
    At1 = [select Type__c from Attachment_Type__c where Program_Memeber_Id__c =: Attid];
    
    System.debug('At1 '+At1 );
    
    if(At1.Type__c  != null){
    
    At1.Type__c  = AttType ;
    
    }
    
    
    PMType.add(At1);
 
          set<Attachment_Type__c> dedupSet = new set<Attachment_Type__c>();
          dedupSet.addAll(PMType);
          List<Attachment_Type__c> dedupList = new List<Attachment_Type__c>();
          dedupList.addAll(dedupSet);
          System.debug('dedupList'+dedupList);
          Update dedupList;
       
    }
    
    }

 
My Vf Page:
<apex:page standardcontroller="Program_Member_MVN__c" extensions="ProgramMemberCaseAttachment" showHeader="false" >
 <head>
        <apex:includescript value="//code.jquery.com/jquery-1.11.1.min.js" / >
        <apex:includescript value="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js" />
        <apex:stylesheet value="//cdn.datatables.net/1.10.4/css/jquery.dataTables.css" />
        <script>
            j$ = jQuery.noConflict();
            j$(document).ready( function () {
                var contactTable = j$('[id$="accounttable"]').DataTable({
                    
                });
            });
            
            
            function Callmefunc(id)
               {
                  // alert(''+id); 
                   var type = document.getElementById(id).value;
                   
                   jQuery('[id$=myHiddenField]').val(id);
                   
                   alert(type);
                    check(type); 
                    //return true;                 
                }
            
        </script>
 </head>
            <apex:form >
            <body>
            <table id="accounttable" class="display"  >
            <thead>
                <tr>
                    <th>Edit</th>
                    <th>ID</th>
                    <th>Name</th>
                    <th>Type</th>
                    <th>Attachment Name</th>
                    <th>Description</th>
                   
                </tr>
            </thead>
            <tbody> 
            
                    <apex:actionFunction name="check" action="{!processSelected1}" >
                    <apex:param name="test" value="" assignTo="{!AttType}"/>
                    </apex:actionFunction>
                
                 

            
                <apex:repeat value="{!PMresults}" var="N">
                
                        <tr>
                        
                        <!--<apex:inputHidden value="{!AttType}" id="myHiddenField"/>-->
                        
                        <!--<td><apex:commandLink value="Edit" action="{!URLFOR($Action.Attachment_Type__c.Edit, N.Id ,[saveURL='/'+N.Id,retURL='/'+N.Id,saveandnewURL='/'+N.Id])}" target="_blank" styleClass="btn" style="text-decoration:none;padding:1px;"/> -->
                        
                        <td><apex:commandLink value="Save" action="{!processSelected}">
                        
                        <apex:param name="{!N.Program_Memeber_Id__c}" value="{!N.Program_Memeber_Id__c}" assignTo="{!Attid}"/>
                        
                        <!--<apex:param name="{!N.Type__c}" value="{!N.Type__c}" assignTo="{!AttType}"/> -->

                        </apex:commandLink>
  
                        </td>
                        
                        <td><apex:outputField value="{!N.Program_Memeber_Id__c}" /></td>
                        
                        <td><apex:outputLink value="/{!N.Id}" target="_blank">{!N.Name}</apex:outputLink></td>
                        
                        <td><apex:inputField value="{!N.Type__c}" id="Check"  onchange="Callmefunc('{!$Component.check}');">
                    
                        <!--<apex:param name="Check" value="{!N.Program_Memeber_Id__c}" assignTo="{!Attid}"/>-->
                                                     
                        </apex:inputField> 
                         
                        </td>
                         
                    <!--<td><apex:outputtext value="{!Attid}"/></td>-->
                 
                    
                        <td><apex:outputField value="{!N.Attachement_Name__c}"/></td> 
                        
                        
                        <td><apex:outputField value="{!N.Attachment_Description__c}"/></td>
                   
                    <!--<td>{!N.At.LastModifiedDate}</td>-->
                   

                    <!--<td>
                    <apex:outputField value="{!N.At.Description}"/></td>-->

                        </tr>    
                                                                       
                </apex:repeat>
            </tbody>
            </table>
            </body>
            </apex:form>
</apex:page>

I am trying to pass the variable which stores the input field value to my apex controller.But the variable to which i am passing is returning null in the apex class.

My apex class:
 
/**
 *  ProgramMemberCaseAttachment
 *  Created By:     Varun 
 *  Created On:     11/07/2017
 *  Description:    This class is responsible for displaying Attachment Details
                     Under Each Program Member
 *                  
 **/
public with sharing class ProgramMemberCaseAttachment{

    public string AttType{get;set;}

    public Id Attid{get;set;}
    
    public List<Attachment_Type__c> PMresults{get;set;}
        
    public Program_Member_MVN__c cs;
    
    public ProgramMemberCaseAttachment(ApexPages.StandardController controller)
    {
    
    //AttType ='';
    
    cs=(Program_Member_MVN__c)controller.getRecord();
        
    List<case> Test = new List<case>([select id from case where Program_Member_MVN__c =: cs.id]);
    
    System.debug('Test:'+Test);
    
    List<String> Id = new List<String>();
    
    System.debug('AttType:'+AttType);
    
    for(case Cs1 : Test){
    
    Id.add(Cs1.id);
    
    }
    
    PMresults = [select Program_Memeber_Id__c,Id,Attachement_Name__c,Attachment_Description__c,Name,Type__c from Attachment_Type__c where Program_Memeber_Id__c =: cs.id OR Program_Memeber_Id__c IN: Id];
    
    System.debug('PMresults '+PMresults );
    
    }
    
    public void processSelected1(){
    
    //AttType = System.currentPageReference().getParameters().get('Test');
    
    System.debug('AttType'+AttType);
    
    }
    
    public void processSelected(){
    
    System.debug('AttType 1'+AttType );
    
    List<Attachment_Type__c> PMType = new List<Attachment_Type__c>();
    
    Attachment_Type__c At1 = new Attachment_Type__c ();
    
    At1 = [select Type__c from Attachment_Type__c where Program_Memeber_Id__c =: Attid];
    
    System.debug('At1 '+At1 );
    
    if(At1.Type__c  != null){
    
    At1.Type__c  = AttType ;
    
    }
    
    
    PMType.add(At1);
 
          set<Attachment_Type__c> dedupSet = new set<Attachment_Type__c>();
          dedupSet.addAll(PMType);
          List<Attachment_Type__c> dedupList = new List<Attachment_Type__c>();
          dedupList.addAll(dedupSet);
          System.debug('dedupList'+dedupList);
          Update dedupList;
       
    }
    
    }

What am i doing wrong?​
My Visual force page:
<apex:page standardcontroller="Program_Member_MVN__c" extensions="ProgramMemberCaseAttachment" showHeader="false" >
 <head>
        <apex:includescript value="//code.jquery.com/jquery-1.11.1.min.js" / >
        <apex:includescript value="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js" />
        <apex:stylesheet value="//cdn.datatables.net/1.10.4/css/jquery.dataTables.css" />
        <script>
            j$ = jQuery.noConflict();
            j$(document).ready( function () {
                var contactTable = j$('[id$="accounttable"]').DataTable({
                    
                });
            });
            
            
            function Callmefunc(id)
               {
                   alert(''+id); 
                   var type = document.getElementById(id).value;
                   alert(type);
                    check(type); 
                    //return true;                 
                }
            
        </script>
 </head>
            <apex:form >
            <body>
            <table id="accounttable" class="display"  >
            <thead>
                <tr>
                    <th>Edit</th>
                    <th>ID</th>
                    <th>Name</th>
                    <th>Type</th>
                    <th>Attachment Name</th>
                    <th>Description</th>
                   
                </tr>
            </thead>
            <tbody> 
            
            <apex:actionFunction name="check" action="{!processSelected1}">
                    <apex:param name="Mahavir" value=""/>
                </apex:actionFunction>
                
                <!--<apex:inputHidden value="{!AttType}" id="myHiddenField"/>-->

            
                <apex:repeat value="{!PMresults}" var="N">
                
                        <tr>
            
                        <!--<td><apex:commandLink value="Edit" action="{!URLFOR($Action.Attachment_Type__c.Edit, N.Id ,[saveURL='/'+N.Id,retURL='/'+N.Id,saveandnewURL='/'+N.Id])}" target="_blank" styleClass="btn" style="text-decoration:none;padding:1px;"/> -->
                        
                        <td><apex:commandLink value="Save" action="{!processSelected}">
                        
                        <apex:param name="{!N.Program_Memeber_Id__c}" value="{!N.Program_Memeber_Id__c}" assignTo="{!Attid}"/>
                        
                        <!--<apex:param name="{!N.Type__c}" value="{!N.Type__c}" assignTo="{!AttType}"/> -->

                        </apex:commandLink>
  
                        </td>
                        
                        <td><apex:outputField value="{!N.Program_Memeber_Id__c}" /></td>
                        
                        <td><apex:outputLink value="/{!N.Id}" target="_blank">{!N.Name}</apex:outputLink></td>
                        
                        <td><apex:inputField value="{!N.Type__c}" id="Check"  onchange="Callmefunc('{!$Component.check}');">
                    
                        <apex:param name="Check" value="{!N.Program_Memeber_Id__c}" assignTo="{!Attid}"/>
                                                     
                        </apex:inputField> 
                         
                        </td>
                         
                    <!--<td><apex:outputtext value="{!Attid}"/></td>-->
                 
                    
                        <td><apex:outputField value="{!N.Attachement_Name__c}"/></td> 
                        
                        
                        <td><apex:outputField value="{!N.Attachment_Description__c}"/></td>
                   
                    <!--<td>{!N.At.LastModifiedDate}</td>-->
                   

                    <!--<td>
                    <apex:outputField value="{!N.At.Description}"/></td>-->

                        </tr>    
                                                                       
                </apex:repeat>
            </tbody>
            </table>
            </body>
            </apex:form>
</apex:page>
I am trying to update type field when save button is pressed.I am storing the input field value in the variable in the java script function.How can i pass this variable to apex controller and when i click on save i am passing the param value to apex controller.So when i click on save both param value and var in the javascript should be present in my apex class?How can i achieve this?

My Apex Class:
/**
 *  ProgramMemberCaseAttachment
 *  Created By:     Varun 
 *  Created On:     11/07/2017
 *  Description:    This class is responsible for displaying Attachment Details
                     Under Each Program Member
 *                  
 **/
public with sharing class ProgramMemberCaseAttachment{

    public string AttType{get;set;}

    public Id Attid{get;set;}
    
    public List<Attachment_Type__c> PMresults{get;set;}
        
    public Program_Member_MVN__c cs;
    
    public ProgramMemberCaseAttachment(ApexPages.StandardController controller)
    {
    
    cs=(Program_Member_MVN__c)controller.getRecord();
        
    List<case> Test = new List<case>([select id from case where Program_Member_MVN__c =: cs.id]);
    
    System.debug('Test:'+Test);
    
    List<String> Id = new List<String>();
    
    for(case Cs1 : Test){
    
    Id.add(Cs1.id);
    
    }
    
    PMresults = [select Program_Memeber_Id__c,Id,Attachement_Name__c,Attachment_Description__c,Name,Type__c from Attachment_Type__c where Program_Memeber_Id__c =: cs.id OR Program_Memeber_Id__c IN: Id];
    
    System.debug('PMresults '+PMresults );
    
    }
    
    public void processSelected1(){
    
    AttType = System.currentPageReference().getParameters().get('Mahavir');
    
    System.debug('AttType '+AttType );
    
    }
    
    public void processSelected(){
    
    System.debug('AttType 1'+AttType );
    
    List<Attachment_Type__c> PMType = new List<Attachment_Type__c>();
    
    Attachment_Type__c At1 = new Attachment_Type__c ();
    
    At1 = [select Type__c from Attachment_Type__c where Program_Memeber_Id__c =: Attid];
    
    System.debug('At1 '+At1 );
    
    if(At1.Type__c  != null){
    
    At1.Type__c  = AttType ;
    
    }
    
    
    PMType.add(At1);
 
          set<Attachment_Type__c> dedupSet = new set<Attachment_Type__c>();
          dedupSet.addAll(PMType);
          List<Attachment_Type__c> dedupList = new List<Attachment_Type__c>();
          dedupList.addAll(dedupSet);
          System.debug('dedupList'+dedupList);
          Update dedupList;
       
    }
    
    }

 
I have a vf section in my record detail page which displays the attachments under the object.How can i make a command button in such a way that when clicked on it it redirects to new record Attachment creation page for the current object?
Vf Page
<apex:page standardcontroller="Program_Member_MVN__c" extensions="ProgramMemberCaseAttachment" showHeader="false" >
 <head>
        <apex:includescript value="//code.jquery.com/jquery-1.11.1.min.js" / >
        <apex:includescript value="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js" />
        <apex:stylesheet value="//cdn.datatables.net/1.10.4/css/jquery.dataTables.css" />
        <script>
            j$ = jQuery.noConflict();
            j$(document).ready( function () {
                var contactTable = j$('[id$="accounttable"]').DataTable({
                    
                });
            });
        </script>
 </head>
              
            
 
            <apex:form >
            
            <body>
            <table id="accounttable" class="display"  >
            <thead>
                <tr>
                    <th>Save</th>
                    <!--<th>ID</th>-->
                    <th>Type</th>
                    <th>Case Number/PM Number</th>
                    <th>Attachment</th>
                    <th>LastModifiedDate</th>
                    <th>CreatedBy</th>
                    <th>Description</th>
                </tr>
            </thead>
            <tbody>  
            
                    
            
                <apex:variable var="index" value="{!1}"/>
            
                <apex:repeat value="{!wrapAttachmentList}" var="N"> 
                
                    <!--<apex:form>
                
                    <apex:pageBlock>
                
                    <apex:pageBlockTable value="{!PMTyperesults}" var="dimension2">
                    
                    <apex:column value="{!dimension2.Type__c}"/>
                    
                    </apex:pageBlockTable>
                    
                    </apex:pageBlock>
                    
                    </apex:form>-->
                
                    
                    
                       <tr>
            
                        <td><apex:commandLink value="save" action="{!processSelected}">
                        
                        <apex:param name="Attid" value="{!N.At.id}" assignTo="{!Attid}"/>
                        
                        <apex:variable var="index" value="{!index+1}"/>
                                                
                        </apex:commandLink>
                        
                        </td>
                        
                        
                        
                        <td><apex:inputField value="{!N.Att.Type__c}">
                    
                    
                    
                    <!--<apex:param name="AttType" value="{!N.Att.Type__c}" assignTo="{!AttType1}"/>-->
                                                     
                        </apex:inputField> 
                         
                        </td>
                         

                    
                    <!--<td><apex:outputtext value="{!Attid}"/></td>-->
                 
                    
                    <td><apex:outputLink value="/{!N.At.ParentId}" target="_blank">{!N.At.Parent.Name}</apex:outputLink></td> 
                    
                       
                                         
                    <td><apex:outputLink value="/{!N.At.id}" target="_blank">{!N.At.Name}</apex:outputLink></td>
                   
                    <td>{!N.At.LastModifiedDate}</td>
                   
                    <td><apex:outputLink value="/{!N.At.CreatedById}" target="_blank">{!N.At.CreatedBy.Name}</apex:outputLink></td>
                   
                    <td>
                    <apex:outputField value="{!N.At.Description}"/></td>

                    </tr>    
                                                                       
                </apex:repeat>
            </tbody>
            </table>
            </body>
            </apex:form>
</apex:page>

Apex Class
 
/**
 *  ProgramMemberCaseAttachment
 *  Created By:     Varun 
 *  Created On:     11/07/2017
 *  Description:    This class is responsible for displaying Attachment Details
                     Under Each Program Member
 *                  
 **/
public with sharing class ProgramMemberCaseAttachment{

    //public List<Attachment_Type__c> Type{get;set;}

    public string AttType{get;set;}

    public Id Attid{get;set;}

    public List<wrapAttachment> wrapAttachmentList {get; set;}
    
    public List<Attachment> PMresults{get;set;}
    
    public List<Attachment_Type__c> PMTyperesults{get;set;}
    
    public Program_Member_MVN__c cs;
    
    public ProgramMemberCaseAttachment(ApexPages.StandardController controller)
    {
    
    wrapAttachmentList = new List<wrapAttachment>();
    
    cs=(Program_Member_MVN__c)controller.getRecord();
        
    List<case> Test = new List<case>([select id from case where Program_Member_MVN__c =: cs.id]);
    
    System.debug('Test:'+Test);
    
    PMresults = [select CreatedBy.Name,OwnerId,ParentId,Parent.Name,Id,Name,LastModifiedById,CreatedById,LastModifiedDate, Description from Attachment where parentid =: cs.id OR parentid IN:Test ];
    
    for(Attachment a : PMresults) {
            wrapAttachmentList.add(new wrapAttachment(a));
        }

    
    /*PMTyperesults = new List<Attachment_Type__c>();
    
    for(Attachment_Type__c b : PMTyperesults) {
            wrapAttachmentList.add(new wrapAttachment(b));
        }*/

    }
    
    
    
    public void processSelected(){
    
    List<Attachment_Type__c> PMType = new List<Attachment_Type__c>();
    
    Attachment_Type__c At1 = new Attachment_Type__c ();
    
    for(wrapAttachment Wp : wrapAttachmentList ){
    
    if(Wp.Att.Type__c != null){
    
    At1 = [select Type__c from Attachment_Type__c where Attachment_Id__c =: Attid];
    
    if(At1.Type__c  != null){
    
    At1.Type__c  = Wp.Att.Type__c;
    
    }
    
    }
    
    }
    
    PMType.add(At1);
 
          set<Attachment_Type__c> dedupSet = new set<Attachment_Type__c>();
          dedupSet.addAll(PMType);
          List<Attachment_Type__c> dedupList = new List<Attachment_Type__c>();
          dedupList.addAll(dedupSet);
          System.debug('dedupList'+dedupList);
          Update dedupList;
          
          At1 = new Attachment_Type__c();
          
    //update PMType;
    }
     public class wrapAttachment {
        public Attachment At {get; set;}
        public Attachment_Type__c Att{get; set;}
        public string AttType1{get;set;}
 
        public wrapAttachment(Attachment a) {
        
            At = a;
            
            Att = new Attachment_Type__c();
        }
    }
}
I am passing the input field value from vf page to a list in apex class.But the apex:repeat tag is making all the values on the all the rows to get passed into the List in Apex Controller.How can i make value on the row which i select to only get passed?


My Vf page

User-added image
Vf Page:
<apex:page standardcontroller="Program_Member_MVN__c" extensions="ProgramMemberCaseAttachment" showHeader="false" >
 <head>
        <apex:includescript value="//code.jquery.com/jquery-1.11.1.min.js" / >
        <apex:includescript value="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js" />
        <apex:stylesheet value="//cdn.datatables.net/1.10.4/css/jquery.dataTables.css" />
        <script>
            j$ = jQuery.noConflict();
            j$(document).ready( function () {
                var contactTable = j$('[id$="accounttable"]').DataTable({
                    
                });
            });
        </script>
 </head>
 
            
            
            <body>
            <table id="accounttable" class="display"  >
            <thead>
                <tr>
                    <th>Save</th>
                    <th>ID</th>
                    <th>Type</th>
                    <th>Case Number/PM Number</th>
                    <th>Attachment</th>
                    <th>LastModifiedDate</th>
                    <th>CreatedBy</th>
                    <th>Description</th>
                </tr>
            </thead>
            <tbody>  
            
                <apex:repeat value="{!wrapAttachmentList}" var="N"> 
                
                    <!--<apex:form>
                
                    <apex:pageBlock>
                
                    <apex:pageBlockTable value="{!PMTyperesults}" var="dimension2">
                    
                    <apex:column value="{!dimension2.Type__c}"/>
                    
                    </apex:pageBlockTable>
                    
                    </apex:pageBlock>
                    
                    </apex:form>-->
                
                    <tr>
                    
                    <apex:form >
   
            
                        <td><apex:commandButton value="save" action="{!processSelected}">
                        
                        <apex:param name="{!N.At.id}" value="{!N.At.id}" assignTo="{!Attid}"/>
                        
                        </apex:commandButton>
                        </td>
                         

                    </apex:form>
                    
                    <td><apex:outputtext value="{!Attid}"/></td>
                    
                    <apex:form >
                    
                    <td><apex:inputField value="{!N.Att.Type__c}" id="check"/></td>
                    
                    <apex:param name="{!N.Att.Type__c}" value="{!N.Att.Type__c}" assignTo="{!AttType}/>
                    
                    </apex:form>
                    
                    <td><apex:outputLink value="/{!N.At.ParentId}" target="_blank">{!N.At.Parent.Name}</apex:outputLink></td>    
                                         
                    <td><apex:outputLink value="/{!N.At.id}" target="_blank">{!N.At.Name}</apex:outputLink></td>
                   
                    <td>{!N.At.LastModifiedDate}</td>
                   
                    <td><apex:outputLink value="/{!N.At.CreatedById}" target="_blank">{!N.At.CreatedBy.Name}</apex:outputLink></td>
                   
                    <td>
                    <apex:outputField value="{!N.At.Description}"/></td>

                    </tr>    
                                                                       
                </apex:repeat>
            </tbody>
            </table>
            </body>
</apex:page>
Apex Class:
/**
 *  ProgramMemberCaseAttachment
 *  Created By:     Varun 
 *  Created On:     11/07/2017
 *  Description:    This class is responsible for displaying Attachment Details
                     Under Each Program Member
 *                  
 **/
public class ProgramMemberCaseAttachment{

    public String AttType{get;set;}

    public String act{get;set;}

    public Id Attid{get;set;}

    public List<wrapAttachment> wrapAttachmentList {get; set;}
    
    public List<Attachment> PMresults{get;set;}
    
    public List<Attachment_Type__c> PMTyperesults{get;set;}
    
    public Program_Member_MVN__c cs;
    
    public ProgramMemberCaseAttachment(ApexPages.StandardController controller)
    {
    
    wrapAttachmentList = new List<wrapAttachment>();
    
    cs=(Program_Member_MVN__c)controller.getRecord();
        
    List<case> Test = new List<case>([select id from case where Program_Member_MVN__c =: cs.id]);
    
    System.debug('Test:'+Test);
    
    PMresults = [select CreatedBy.Name,OwnerId,ParentId,Parent.Name,Id,Name,LastModifiedById,CreatedById,LastModifiedDate, Description from Attachment where parentid =: cs.id OR parentid IN:Test ];
    
    for(Attachment a : PMresults) {
            wrapAttachmentList.add(new wrapAttachment(a));
        }

    
    PMTyperesults = new List<Attachment_Type__c>();
    
    for(Attachment_Type__c b : PMTyperesults) {
            wrapAttachmentList.add(new wrapAttachment(b));
        }

    }
    
    public void processSelected(){
    
    act =System.currentPageReference().getParameters().get('Mahavir');
    
    System.debug('act:'+act);
    
    List<Attachment_Type__c> PMType = new List<Attachment_Type__c>();
    
    Attachment_Type__c At1 = new Attachment_Type__c ();
    
    At1 = [select Type__c from Attachment_Type__c where Attachment_Id__c =: Attid];
    
    At1.Type__c  = AttType;
    
    PMType.add(At1);
    
          set<Attachment_Type__c> dedupSet = new set<Attachment_Type__c>();
          dedupSet.addAll(PMType);
          List<Attachment_Type__c> dedupList = new List<Attachment_Type__c>();
          dedupList.addAll(dedupSet);
          Update dedupList;
    //update PMType;
    }
     public class wrapAttachment {
        public Attachment At {get; set;}
        public Attachment_Type__c Att{get; set;}
 
        public wrapAttachment(Attachment a) {
        
            At = a;
        }
        public wrapAttachment(Attachment_Type__c b){
        
            Att = b;
        
        }
    }
}
I am trying to pass Attachment Id from save and Attachment Type from inputfield but it is returning null in my apex class.

The functionality i am tryign is On click of save button whatever is saved in the type input field will be updated in another custom object record.

This is my vf page section in record detail page:

User-added image

What am i doing wrong why isnt the param tag not passing the value to apex class?

 
<apex:page standardcontroller="Program_Member_MVN__c" extensions="ProgramMemberCaseAttachment" showHeader="false" >
 <head>
        <apex:includescript value="//code.jquery.com/jquery-1.11.1.min.js" / >
        <apex:includescript value="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js" />
        <apex:stylesheet value="//cdn.datatables.net/1.10.4/css/jquery.dataTables.css" />
        <script>
            j$ = jQuery.noConflict();
            j$(document).ready( function () {
                var contactTable = j$('[id$="accounttable"]').DataTable({
                    
                });
            });
        </script>
 </head>
            <body>
            <table id="accounttable" class="display"  >
            <thead>
                <tr>
                    <th>Case Number/PM Number</th>
                    <th>Attachment</th>
                    <th>LastModifiedDate</th>
                    <th>CreatedBy</th>
                    <th>Description</th>
                </tr>
            </thead>
            <tbody>  
            
                <apex:repeat value="{!PMresults}" var="N"> 
                
                    <!--<apex:form>
                
                    <apex:pageBlock>
                
                    <apex:pageBlockTable value="{!PMTyperesults}" var="dimension2">
                    
                    <apex:column value="{!dimension2.Type__c}"/>
                    
                    </apex:pageBlockTable>
                    
                    </apex:pageBlock>
                    
                    </apex:form>-->
                
                    <tr>
                    
                    <td><apex:outputLink value="/{!N.ParentId}" target="_blank">{!N.Parent.Name}</apex:outputLink></td>     
                                         
                    <td><apex:outputLink value="{!URLFOR($Action.Attachment.Download,N.Id)}" target="_blank">{!N.Name}</apex:outputLink></td>
                    
                    <td>{!N.LastModifiedDate}</td>
                    
                    <td><apex:outputLink value="/{!N.CreatedById}" target="_blank">{!N.CreatedBy.Name}</apex:outputLink></td>
                    
                    <td>
                    <apex:outputField value="{!N.Description}"/></td>
                    
                    </tr>    
                                                                       
                </apex:repeat>
            </tbody>
            </table>
            </body>
</apex:page>
This is my visual force page.

My apex class:
public class ProgramMemberCaseAttachment{
    public List<Attachment> PMresults{get;set;}
    
    public List<Attachment_Type__c> PMTyperesults{get;set;}
    
    public Program_Member_MVN__c cs;
    
    public ProgramMemberCaseAttachment(ApexPages.StandardController controller)
    {
    cs=(Program_Member_MVN__c)controller.getRecord();
        
    List<case> Test = new List<case>([select id from case where Program_Member_MVN__c =: cs.id]);
    
    System.debug('Test:'+Test);
    
    PMresults = [select CreatedBy.Name,OwnerId,ParentId,Parent.Name,Id,Name,LastModifiedById,CreatedById,LastModifiedDate, Description from Attachment where parentid =: cs.id OR parentid IN:Test ];
    
    PMTyperesults = [select Type__c from Attachment_Type__c];

    }
}
I want to display the PMTyperesults also in my vfpage.How can i display two list in my repeat tag such that it displays as a single table?What is the best way to do this.PMTyperesults and PMresults are list of two different object.will wrapper class help?
What does Trigger.new list get when a trigger is fired?Does it get the records which caused the trigger to fire?
Will it capture the value in the record into the variable in flow of type text?
{!REQUIRESCRIPT("/xdomain/xdomain.js")}
{!REQUIRESCRIPT("/soap/ajax/39.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/39.0/apex.js")}
{!REQUIRESCRIPT("/support/console/39.0/integration.js")}

var Program='{!Program_Member_MVN__c.Program_Name__c}';
var Pname=sforce.connection.query("Select Program__c from Program_Names__c");
var rec16 = Pname.getArray('records');
var status='{!Program_Member_MVN__c.Status_MVN__c}';
var PmId='{!JSENCODE(Program_Member_MVN__c.Id)}'; 
var PName='{!Program_Member_MVN__c.Program_Name__c}'; 
var url;
if (sforce.console.isInConsole()) {
if(Program == rec16){
alert("You are on the wrong Program")
} 

else if(status == 'On Therapy')
{
url = "/apex/Milestone_skip?id="+PmId;
window.open(url,'_blank','toolbar=0,location=0,menubar=0,width=800,scrollbars'); 
}  
else
{
alert("Patient must be ‘On-Therapy’ before skipping to a milestone");
}
}

This is my java script on click button code.In this i am querying  custom setting here:var Pname=sforce.connection.query("Select Program__c from Program_Names__c");
And i want to compare to field to show a alert.So i have to multiple values in custom setting.So how can i access all the values given in the custom setting in the java script code?
My Vf Page:
<apex:page standardcontroller="Program_Member_MVN__c" extensions="ProgramMemberCaseAttachment" showHeader="false" >
<head>
        <apex:includescript value="//code.jquery.com/jquery-1.11.1.min.js" / >
        <apex:includescript value="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js" />
        <apex:stylesheet value="//cdn.datatables.net/1.10.4/css/jquery.dataTables.css" />
        <script>
            j$ = jQuery.noConflict();
            j$(document).ready( function () {
                var contactTable = j$('[id$="accounttable"]').DataTable({
                    
                });
            });
                         
            <!-- var Type = '{!AttType}';
             
            const selectEl = document.getElementById('{!$Component.newPageBlock.Section.DateRange}');-->
             
            function Callmefunc()
               {
                
                   alert('Select a Type');
                    
                }
          
        </script>
            
</head>


            <apex:form id="form">
            
            <apex:pageBlock id="newPageBlock">
            
            <apex:pageBlockSection columns="3" id="Section">
            
            <apex:outputLabel ></apex:outputLabel>
          
            <apex:outputLabel style="font-weight:bold"><p1>Select Input Type (then click save) =></p1>
                        
            <apex:selectList id="DateRange" value="{!AttType}" size="0"  style="background-color:{!(IF(AttType!=null,'red','white'))}">
                            <apex:actionSupport event="onchange" action="{!processSelected1}"/>
                            <apex:selectOption itemValue="None" itemLabel="None"/>
                            <apex:selectOption itemValue="Type1" itemLabel="Type1"/>
                            <apex:selectOption itemValue="Type2" itemLabel="Type2"/>
                            <apex:selectOption itemValue="Type3" itemLabel="Type3"/>
                        </apex:selectList>
                        
                        </apex:outputLabel>

            <apex:outputText value="{!callfunc}" escape="false"></apex:outputText>
            
            </apex:pageBlockSection>
          
            <apex:pageBlockTable id="accounttable" value="{!PMresults}" var="N" columnClasses="display">
                        
            <apex:column headerValue="Save">
            
            <apex:commandLink value="Save" action="{!processSelected}" oncomplete="window.location.href='/apex/ProgramMemberCaseAttachment?id={!Program_Member_MVN__c.id}'; return false">
                        
            <apex:param name="{!N.Attachment_Id__c}" value="{!N.Attachment_Id__c}" assignTo="{!Attid}"/>

            </apex:commandLink>
            
            </apex:column>
            
            <!--<apex:column headerValue="Attachment Name">
            
            <apex:outputField value="{!N.Attachment_Name__c}"/>     
                  
            </apex:column>-->
            
            <apex:column headerValue="Attachment">
            
            <apex:outputField value="{!N.Attachment__c}"/>      
                  
            </apex:column>
            
            <apex:column headerValue="Type">
            
            <apex:outputField value="{!N.Type__c}"/>      
                  
            </apex:column>
            
            <apex:column headerValue="PM Number">
            
            <apex:outputLink value="/{!N.Program_Member_Lookup__c}" target="_blank">{!N.Program_Member_Lookup__r.Name}</apex:outputLink>     
                  
            </apex:column>
            
            <apex:column headerValue="Case Number">
            
            <apex:outputLink value="/{!N.Case_Lookup__c}" target="_blank">{!N.Case_Lookup__r.Casenumber}</apex:outputLink>     
                  
            </apex:column>
            
            <!--<apex:column headerValue="Name">
            
            <apex:outputLink value="/{!N.Id}" target="_blank">{!N.Name}</apex:outputLink>
            
            </apex:column>-->
            
            <apex:column headerValue="Description">
            
            <apex:outputField value="{!N.Attachment_Description__c}"/>    
                  
            </apex:column>
                  
            </apex:pageBlockTable>
      
            </apex:pageBlock>
            
            </apex:form>
</apex:page>
My Apex Class:
/**
*  ProgramMemberCaseAttachment
*  Created By:     Varun 
 *  Created On:     11/07/2017
*  Description:    This class is responsible for displaying Attachment Details
                     Under Each Program Member
*                  
 **/
public with sharing class ProgramMemberCaseAttachment{

    public string callfunc{get;set;}

    public string AttType{get;set;}

    public Id Attid{get;set;}
    
    public List<Attachment_Type__c> PMresults{get;set;}
        
    public Program_Member_MVN__c cs;
    
    public ProgramMemberCaseAttachment(ApexPages.StandardController controller)
    {
    
    //AttType ='';
    
    cs=(Program_Member_MVN__c)controller.getRecord();
        
    List<case> Test = new List<case>([select id from case where Program_Member_MVN__c =: cs.id]);
    
    System.debug('Test:'+Test);
    
    List<String> Id = new List<String>();
    
    System.debug('AttType:'+AttType);
    
    for(case Cs1 : Test){
    
    Id.add(Cs1.id);
    
    }
    
    PMresults = [select Program_Member_Lookup__r.Name,Case_Lookup__r.Casenumber,Attachment__c,Case_Lookup__c,Program_Member_Lookup__c,Attachment_Id__c,Parent_Id__c,Id,Attachment_Name__c,Attachment_Description__c,Name,Type__c from Attachment_Type__c where Program_Member_Lookup__c =: cs.id OR Case_Lookup__c IN: Id];
    
    System.debug('PMresults '+PMresults );
    
    }
    
    public void processSelected1(){
    
    //AttType = System.currentPageReference().getParameters().get('Test');
    
    System.debug('AttType'+AttType);
    
    }
    
    public void processSelected(){
    
    System.debug('AttType 1'+AttType);
    
    List<Attachment_Type__c> PMType = new List<Attachment_Type__c>();
    
    Attachment_Type__c At1 = new Attachment_Type__c ();
    
    At1 = [select Type__c from Attachment_Type__c where Attachment_Id__c =: Attid];
    
    System.debug('At1 '+At1 );
    
    if(AttType == 'None'){
    
    callfunc = '<script> Callmefunc(); </script>';
    
    }
    
    else{
    
    At1.Type__c  = AttType ;
    
    
    PMType.add(At1);
    
    }

          set<Attachment_Type__c> dedupSet = new set<Attachment_Type__c>();
          dedupSet.addAll(PMType);
          List<Attachment_Type__c> dedupList = new List<Attachment_Type__c>();
          dedupList.addAll(dedupSet);
          System.debug('dedupList'+dedupList);
          Update dedupList;
       
    }
    
    }

I am trying to call a javascript function from apex class when a None Picklist vlaue is selected.I am not able to get a alert message on the vf page.Where am i doing wrong? 
 
Vf Page:
<apex:page standardcontroller="Program_Member_MVN__c" extensions="ProgramMemberCaseAttachment" showHeader="false" >
 <head>
        <apex:includescript value="//code.jquery.com/jquery-1.11.1.min.js" / >
        <apex:includescript value="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js" />
        <apex:stylesheet value="//cdn.datatables.net/1.10.4/css/jquery.dataTables.css" />
        <script>
            j$ = jQuery.noConflict();
            j$(document).ready( function () {
                var contactTable = j$('[id$="accounttable"]').DataTable({
                    
                });
            });
        </script>
 </head>
 
            
            
            <body>
            <table id="accounttable" class="display"  >
            <thead>
                <tr>
                    <th>Save</th>
                    <th>ID</th>
                    <th>Type</th>
                    <th>Case Number/PM Number</th>
                    <th>Attachment</th>
                    <th>LastModifiedDate</th>
                    <th>CreatedBy</th>
                    <th>Description</th>
                </tr>
            </thead>
            <tbody>  
            
                <apex:repeat value="{!wrapAttachmentList}" var="N"> 
                
                    <!--<apex:form>
                
                    <apex:pageBlock>
                
                    <apex:pageBlockTable value="{!PMTyperesults}" var="dimension2">
                    
                    <apex:column value="{!dimension2.Type__c}"/>
                    
                    </apex:pageBlockTable>
                    
                    </apex:pageBlock>
                    
                    </apex:form>-->
                
                    <tr>
                    
                    <apex:form >
   
            
                        <td><apex:commandButton value="save" action="{!processSelected}">
                        
                        <apex:param name="{!N.At.id}" value="{!N.At.id}" assignTo="{!Attid}"/>
                        
                        </apex:commandButton>
                        </td>
                         

                    </apex:form>
                    
                    <td><apex:outputtext value="{!Attid}"/></td>
                    
                    <apex:form >
                    
                    <td><apex:inputField value="{!N.Att.Type__c}" id="check"/></td>
                    
                    <apex:param name="{!N.Att.Type__c}" value="{!N.Att.Type__c}" assignTo="{!AttType}/>
                    
                    </apex:form>
                    
                    <td><apex:outputLink value="/{!N.At.ParentId}" target="_blank">{!N.At.Parent.Name}</apex:outputLink></td>    
                                         
                    <td><apex:outputLink value="/{!N.At.id}" target="_blank">{!N.At.Name}</apex:outputLink></td>
                   
                    <td>{!N.At.LastModifiedDate}</td>
                   
                    <td><apex:outputLink value="/{!N.At.CreatedById}" target="_blank">{!N.At.CreatedBy.Name}</apex:outputLink></td>
                   
                    <td>
                    <apex:outputField value="{!N.At.Description}"/></td>

                    </tr>    
                                                                       
                </apex:repeat>
            </tbody>
            </table>
            </body>
</apex:page>
Apex Class:
/**
 *  ProgramMemberCaseAttachment
 *  Created By:     Varun 
 *  Created On:     11/07/2017
 *  Description:    This class is responsible for displaying Attachment Details
                     Under Each Program Member
 *                  
 **/
public class ProgramMemberCaseAttachment{

    public String AttType{get;set;}

    public String act{get;set;}

    public Id Attid{get;set;}

    public List<wrapAttachment> wrapAttachmentList {get; set;}
    
    public List<Attachment> PMresults{get;set;}
    
    public List<Attachment_Type__c> PMTyperesults{get;set;}
    
    public Program_Member_MVN__c cs;
    
    public ProgramMemberCaseAttachment(ApexPages.StandardController controller)
    {
    
    wrapAttachmentList = new List<wrapAttachment>();
    
    cs=(Program_Member_MVN__c)controller.getRecord();
        
    List<case> Test = new List<case>([select id from case where Program_Member_MVN__c =: cs.id]);
    
    System.debug('Test:'+Test);
    
    PMresults = [select CreatedBy.Name,OwnerId,ParentId,Parent.Name,Id,Name,LastModifiedById,CreatedById,LastModifiedDate, Description from Attachment where parentid =: cs.id OR parentid IN:Test ];
    
    for(Attachment a : PMresults) {
            wrapAttachmentList.add(new wrapAttachment(a));
        }

    
    PMTyperesults = new List<Attachment_Type__c>();
    
    for(Attachment_Type__c b : PMTyperesults) {
            wrapAttachmentList.add(new wrapAttachment(b));
        }

    }
    
    public void processSelected(){
    
    act =System.currentPageReference().getParameters().get('Mahavir');
    
    System.debug('act:'+act);
    
    List<Attachment_Type__c> PMType = new List<Attachment_Type__c>();
    
    Attachment_Type__c At1 = new Attachment_Type__c ();
    
    At1 = [select Type__c from Attachment_Type__c where Attachment_Id__c =: Attid];
    
    At1.Type__c  = AttType;
    
    PMType.add(At1);
    
          set<Attachment_Type__c> dedupSet = new set<Attachment_Type__c>();
          dedupSet.addAll(PMType);
          List<Attachment_Type__c> dedupList = new List<Attachment_Type__c>();
          dedupList.addAll(dedupSet);
          Update dedupList;
    //update PMType;
    }
     public class wrapAttachment {
        public Attachment At {get; set;}
        public Attachment_Type__c Att{get; set;}
 
        public wrapAttachment(Attachment a) {
        
            At = a;
        }
        public wrapAttachment(Attachment_Type__c b){
        
            Att = b;
        
        }
    }
}
I am trying to pass Attachment Id from save and Attachment Type from inputfield but it is returning null in my apex class.

The functionality i am tryign is On click of save button whatever is saved in the type input field will be updated in another custom object record.

This is my vf page section in record detail page:

User-added image

What am i doing wrong why isnt the param tag not passing the value to apex class?

 
What does Trigger.new list get when a trigger is fired?Does it get the records which caused the trigger to fire?
I am using following code of Attachment object in vf page
<td><apex:outputLink value="/{!N.OwnerId}" target="_blank">{!N.OwnerId}</apex:outputLink></td>

when displaying {!N.OwnerId} on actual page id is displayed.How can i display name instead

I can use apex:outputField but i am not able to give target="_blank" so the page is being refreshed in vf page section without being displayed in new window.Any suggestion for solving the problem?
I am inserting data in test class.It is giving error in main class at a line where it is querying data the using a soql.So what is causing the too many soql query 101 error?
{!REQUIRESCRIPT("/xdomain/xdomain.js")}
{!REQUIRESCRIPT("/soap/ajax/39.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/39.0/apex.js")}
{!REQUIRESCRIPT("/support/console/39.0/integration.js")}

var Program='{!Program_Member_MVN__c.Program_Name__c}';
var Pname=sforce.connection.query("Select Program__c from Program_Names__c");
var rec16 = Pname.getArray('records');
var status='{!Program_Member_MVN__c.Status_MVN__c}';
var PmId='{!JSENCODE(Program_Member_MVN__c.Id)}'; 
var PName='{!Program_Member_MVN__c.Program_Name__c}'; 
var url;
if (sforce.console.isInConsole()) {
if(Program == rec16){
alert("You are on the wrong Program")
} 

else if(status == 'On Therapy')
{
url = "/apex/Milestone_skip?id="+PmId;
window.open(url,'_blank','toolbar=0,location=0,menubar=0,width=800,scrollbars'); 
}  
else
{
alert("Patient must be ‘On-Therapy’ before skipping to a milestone");
}
}

This is my java script on click button code.In this i am querying  custom setting here:var Pname=sforce.connection.query("Select Program__c from Program_Names__c");
And i want to compare to field to show a alert.So i have to multiple values in custom setting.So how can i access all the values given in the custom setting in the java script code?
<apex:page standardcontroller="Program_Member_MVN__c" extensions="CaseCounter" showHeader="false" >
    <apex:form >
        <apex:pageBlock title="Attachments" >
            <apex:pageblockSection >
           <!-- <apex:outputPanel layout="block" style="overflow:auto;width:200px;height:500px" >-->
                <apex:repeat value="{!results}" var="M" >  
                <apex:repeat value="{!M.Attachments}" var="temp"> 
                           
                     <apex:outputText label="Case Number"  >
                     <apex:outputLink value="{!URLFOR($Action.Case.View,M.Id)}" target="_blank">
                         {!M.CaseNumber}
                     </apex:outputLink>
                     </apex:outputText> 
                                            
                    <apex:outputText label="Attachment" >
                    <apex:outputLink value="{!URLFOR($Action.Attachment.Download,temp.Id)}" target="_blank">{!temp.Name}</apex:outputLink>
                    </apex:outputText>
                    
                    <apex:outputField value="{!temp.LastModifiedDate}"/>
                    
                    <apex:outputField value="{!temp.CreatedById}"/>
                </apex:repeat>
                </apex:repeat>
                <!-- </apex:OutputPanel>-->
             </apex:pageblockSection>
         </apex:pageBlock>
    </apex:form>
</apex:page>

User-added image

My visual force page is looks like above.I want to give some space after the four fields are displayed for a particular record.How can i do that with apex:repeat tag?
<apex:page standardcontroller="Program_Member_MVN__c" extensions="CaseCounter">
    <apex:pageBlock title="Attachments">
         <apex:pageblockSection >
             <apex:repeat value="{!results}" var="M">  
                <apex:repeat value="{!M.Attachments}" var="temp">
            <!--<apex:pageBlockTable value="{!M.Attachments}" var="temp" >  -->
            <!--<apex:pageBlockTable value="{!temp}" var="a">-->
           <!-- <apex:column value="{!temp}" title="Test"/>-->
                    <apex:outputField value="{!M.CaseNumber}"/>
                    <apex:outputField value="{!temp.Name}"/>
                    <apex:outputField value="{!temp.LastModifiedDate}"/>
                    <apex:outputField value="{!temp.CreatedById}"/>
                  <!--  </apex:pageBlockTable>-->
                 <!-- </apex:pageBlockTable>-->
              </apex:repeat>
             </apex:repeat>
             </apex:pageblockSection>
            </apex:pageBlock>
</apex:page>
Apex class:
public class CaseCounter{
    //public List<AggregateResult> lstagr {get;set;}
    public Program_Member_MVN__c cs;
    public CaseCounter(ApexPages.StandardController controller)
    {
    cs=(Program_Member_MVN__c)controller.getRecord();
    //List<AggregateResult> lstagr =[select sum(CountAttachment__c) tot from case where Program_Member_MVN__c =: cs.id];
    //List<AggregateResult> lstagr = [SELECT id,(select sum(CountAttachment__c)tot from cases__r)FROM Program_Member_MVN__c WHERE id = :cs];
    //List<Program_Member_Stage_MVN__c>Pms = [select id,(select CountAttachment__c from cases__r) from Program_Member_MVN__c where id = :cs];
    //return lstagr;
     //List<Case> lstagr =[select id,(select Name,LastModifiedById,CreatedById from Attachments) from case where Program_Member_MVN__c =:cs.id];
       // for(Case A:lstagr){}
    }
    /*public AggregateResult[] results {
        get {
            return [select sum(CountAttachment__c) tot from case where Program_Member_MVN__c =: cs.id];
        }
    }*/
        
    public List<Case> results{
    get{
    return [select id,CaseNumber,(select Name,LastModifiedById,CreatedById,LastModifiedDate from Attachments) from case where Program_Member_MVN__c =:cs.id];
    }
    }
}
I should display outputlink for  <apex:outputField value="{!temp.Name}"/> but it is not working if i give output link,visualforce is not displaying anything.Why is this happening?

 
But the compiler is not recognizing the relationship name.Why is the inline query not able to recognize the relationship name.What may be possible problem?
User-added image

This is my detail page and when i click on skip to milestone it will open a visual force page which looks like below

User-added image

How can i remove the extra portions like setup in the head part?

the button code for skip to milestone is

{!REQUIRESCRIPT("/xdomain/xdomain.js")}
{!REQUIRESCRIPT("/soap/ajax/39.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/39.0/apex.js")}
{!REQUIRESCRIPT("/support/console/39.0/integration.js")}

var status='{!Program_Member_MVN__c.Status_MVN__c}';
var PmId='{!JSENCODE(Program_Member_MVN__c.Id)}'; 
var url;
if (sforce.console.isInConsole()) {
if(status == 'On Therapy')
{
url = "/apex/Milestone_skip?id="+PmId;
window.open(url,'_blank','toolbar=0,location=0,menubar=0'); 
}  
else
{
alert("Patient must be ‘On-Therapy’ before skipping to a milestone");
}
}

var showTabId = function showTabId(thisVal) {
  sforce.console.refreshPrimaryTabById(thisVal.id, true, '');
};
if (sforce.console != null && sforce.console.isInConsole()) {
    setTimeout(function(){ 
  sforce.console.getFocusedPrimaryTabId(showTabId);
},9500);
}

i am just referring the visual force page link in the button how can modify it show only my visual force part?
{!REQUIRESCRIPT("/xdomain/xdomain.js")} 
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/34/apex.js")} 
{!REQUIRESCRIPT("/support/console/31.0/integration.js")} 
var status='{!Program_Member_MVN__c.Status_MVN__c}'; 
var PmId='{!JSENCODE(Program_Member_MVN__c.Id)}'; 
var url; 
if (sforce.console.isInConsole()) { 
if(status == 'On Therapy') 

url = "/apex/Milestone_skip?id="+PmId; 
window.open(url,'_blank','toolbar=0,location=0,menubar=0'); 

else 

alert("Please Check The Patient Status"); 

}


This is my Javascript code but the functionality is working only if i click the button twice?Why is this happening?
Program_Member_Stage_MVN__c stagesequence = [select Stage_Number__c from Program_Member_Stage_MVN__c where id=:PId];

how to i get Stage_Number__c from the above list to assign it to where clause in the below soql query ==here(Stage_Number__c<????)

        List<Program_Member_Stage_MVN__c> Pstages=new List<Program_Member_Stage_MVN__c>([select id,Stage_Number__c,Parent_Stage__c,Status_MVN__c,Parent_Program_Member_Stage_MVN__c from Program_Member_Stage_MVN__c where Program_Member_MVN__c=:Pm.id and Parent_Stage__c='Parent_Stage_MVN' and Parent_Program_Member_Stage_MVN__c!=:PId and Stage_Number__c<????]);
 
I am getting Id value from visual force page into apex class.How do pass the id value from getter into another method for doing a soql query?

Hi,

I need to put a custom related list on the account detail page and put the Hover link on the top of the page for the custom related list.

 

I was able to do the custom related list displayed on the bottom of the Account detail page wiring a standard controller extension and visula force page.

 

Now the problem is How do I place the Hover link on the top of the page for the custom list? I saw couple of threads for the above, but the hover links issue was never discussed?.

 

Can any one please guide me how can I do this.

 

Thank you.