• SamCousins
  • NEWBIE
  • 60 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 4
    Replies
Hi all,

I'm using an apex repeat to build a modal using a fieldset.
The following works fine:
<apex:repeat value="{!currentFieldSet}" var="C"> 
    <apex:outputLabel >{!C.Label}</apex:outputLabel> 
    <apex:inputText html-placeholder="{!currentCase[C.fieldPath]}"></apex:inputText> 
</apex:repeat>


I see the field values as placeholder text in my fields.
However, due to the fieldset containing a lookup field, I would like to bind the values to input fields like so:
 
<apex:repeat value="{!currentFieldSet}" var="C"> 
    <apex:outputLabel >{!C.Label}</apex:outputLabel> 
    <apex:inputField styleClass="form-control" value="{!currentCase[C.fieldPath]}"/> 
</apex:repeat>

However, this gives the following error:
Variable is not visible: [ITSSCnC].currentCase which is [Controller].PropertyName

currentCase is a property defined as so:
public static Case currentCase {get;set;} {currentCase = new Case();}


However I do not think this is the issue, due to the first piece of code working. Does anybody have any insight into what is going on?

Additional Info:
This is how I'm populating currentCase (which is working):
currentCase = [SELECT Subject, Status, Priority, Contact.Name FROM Case WHERE Id =: caseId LIMIT 1];
This is how I'm populating the fieldset:
 
public static List<Schema.FieldSetMember> readFieldSet() { 
    Map<String, Schema.SObjectType> GlobalDescribeMap = Schema.getGlobalDescribe(); 
    Schema.SObjectType SObjectTypeObj = GlobalDescribeMap.get('Case'); 
    Schema.DescribeSObjectResult DescribeSObjectResultObj = 
    SObjectTypeObj.getDescribe(); Schema.FieldSet fieldSetObj =              DescribeSObjectResultObj.FieldSets.getMap().get(fieldSetName); 
    return fieldSetObj.getFields(); 
}

 
I have an VisualForce page set up like this:
<apex:actionPoller interval="5" reRender="panel" action="{!getPanelRecords}"/>

<apex:outputPanel id="panel">
    <button onClick = "btnClick(this,'blue');" value="Change me blue"/>
    <button onClick = "btnClick(this,'red');" value="Change me red"/>
</apex:outputPanel>

<script>
    function btnClick(element, color) {
        this.attr('color', color);
    }
</script>

When I click the button, it will change color, But due to the panel getting rerendered, it will not persist between refreshes.

I was thinking of using the actionPoller onComplete event to get a list of id's and set the colors accordingly, but I'm not sure if there's an easier/better way to achieve this.

Can anybody recommend how to store the changed CSS on multiple elements between refreshes?
Hi all,

I have the following code
 
public static void submitSplitApprovalStepOne(Id recordId, String firstApprover){

  		approval.ProcessSubmitRequest step1 = new Approval.ProcessSubmitRequest();
		
        step1.setComments('The approver passed is: ' + firstApprover);
        
        step1.setObjectId(recordId); 
        
        step1.setNextApproverIds(new Id[] {firstApprover});
        
        approval.ProcessResult result = Approval.process(step1);

    }


When this method is called and passed a record for an object with a pre redfined approval process activated on it, it successfully creates a step and submits it to the first Approver ID.

How can I extend this code so that I can add another step and set the approver via apex? I know I'll probably have to query the ProcessInstance table to track my job, but I'm not sure how to add a step with an approver via code.

You know the way when creating reports, after adding filters, you can add logic to the filters such as OR, AND etc..

How do I change this logic within Visualforce inside the <apex:reportChart> element? I can define filters, but there's no property to define filter logic. At the moment every time I add a filter it's an 'AND', when really I want an 'OR' for my filters. Can anybody help, thanks!
I have the following:
<analytics:reportChart reportId="00Oa0000008ksHq" />
I would like to change the reportId attribute value to something else via jQuery.

I have tried putting an id tag as an attribute but it is not supported and won't let me save the page.

I have tried getting the tag like so:
j$("analytics:reportChart").attr("reportId");
but it doesn't find the element on the page.

Does anybody have any ideas how I can change the analytics report chart "reportId" attribute via jQuery?
Hi all, I have this :

 <apex:pageBlockTable value="{!projectList}" var="c" >
                                             
                                             <div class="rows">
                                             <apex:column headerValue="Title" headerClass="ct">
                                                 <apex:outputLink value="/{!c.id}"><apex:outputText value="{!c.Project_Title__c}" /></apex:outputLink>  
                                             </apex:column>
                                             
                                                <apex:column headerValue="End Date" value="{!c.Project_End_Date__c}" headerClass="ct"/>
                                            
                                             <apex:column headerValue="Open Cases" value="{!c.Open_Cases_TEXT__c}" headerClass="ct"/>
                                             <div id="casesRelated">
                                                 <apex:column headerValue="Cases" headerClass="ct" id="caseCol" rendered="true">
                                                     <apex:relatedList subject="{!c.id}" list="Cases__r"  />
                                                 </apex:column> 
                                             </div>
                                                 
                                             </div>

                                         </apex:pageBlockTable>

However the related list for each row only displays the cases from the very first c.Id! How do I make it iterate with the rows of the pageblocktable? Thanks, Sam!
I have the following:
<apex:column headerValue="Contact" headerClass="ct" >

    <apex:inputField value="{!c.Contactid}" id="inputField"/>
    <apex:inputHidden id="hdnField" value="{!contactId}" />

    <apex:commandLink value="+" styleClass="btn" style="color:red;font-size:15px;"  onclick="setVar();" action="{!updateCase}" >

        <apex:param name="caseId"
                    value="{!c.Id}"
                    assignTo="{!caseId}" />

        <apex:param name="contactId"
                    value="{!contactId}"
                    assignTo="{!contactId}" />                            

    </apex:commandLink>       

</apex:column>
I'm trying to set the apex:param with the name contactId to the value of my apex:inputHiddenfield so I can pass that value to my controller when I click the command button. inputHidden is set correctly, but I can't work out how to link the param to the inputHidden value attribute?

Does anybody have any ideas?
 
I can center pageBlockTable headers no problem, but I can't get pageBlock headers to center. 

Can anybody help me with this? Thanks.
Hi all,

I'm currently trying to create a list view filter for a visual force page working on a custom controller.

Does anybody have any experience with this? What should I use to achieve this? I've read about custom list controllers but I don't know the best way to use it.
I have an VisualForce page set up like this:
<apex:actionPoller interval="5" reRender="panel" action="{!getPanelRecords}"/>

<apex:outputPanel id="panel">
    <button onClick = "btnClick(this,'blue');" value="Change me blue"/>
    <button onClick = "btnClick(this,'red');" value="Change me red"/>
</apex:outputPanel>

<script>
    function btnClick(element, color) {
        this.attr('color', color);
    }
</script>

When I click the button, it will change color, But due to the panel getting rerendered, it will not persist between refreshes.

I was thinking of using the actionPoller onComplete event to get a list of id's and set the colors accordingly, but I'm not sure if there's an easier/better way to achieve this.

Can anybody recommend how to store the changed CSS on multiple elements between refreshes?
I have an VisualForce page set up like this:
<apex:actionPoller interval="5" reRender="panel" action="{!getPanelRecords}"/>

<apex:outputPanel id="panel">
    <button onClick = "btnClick(this,'blue');" value="Change me blue"/>
    <button onClick = "btnClick(this,'red');" value="Change me red"/>
</apex:outputPanel>

<script>
    function btnClick(element, color) {
        this.attr('color', color);
    }
</script>

When I click the button, it will change color, But due to the panel getting rerendered, it will not persist between refreshes.

I was thinking of using the actionPoller onComplete event to get a list of id's and set the colors accordingly, but I'm not sure if there's an easier/better way to achieve this.

Can anybody recommend how to store the changed CSS on multiple elements between refreshes?
Hi all,

I have the following code
 
public static void submitSplitApprovalStepOne(Id recordId, String firstApprover){

  		approval.ProcessSubmitRequest step1 = new Approval.ProcessSubmitRequest();
		
        step1.setComments('The approver passed is: ' + firstApprover);
        
        step1.setObjectId(recordId); 
        
        step1.setNextApproverIds(new Id[] {firstApprover});
        
        approval.ProcessResult result = Approval.process(step1);

    }


When this method is called and passed a record for an object with a pre redfined approval process activated on it, it successfully creates a step and submits it to the first Approver ID.

How can I extend this code so that I can add another step and set the approver via apex? I know I'll probably have to query the ProcessInstance table to track my job, but I'm not sure how to add a step with an approver via code.

Hi all, I have this :

 <apex:pageBlockTable value="{!projectList}" var="c" >
                                             
                                             <div class="rows">
                                             <apex:column headerValue="Title" headerClass="ct">
                                                 <apex:outputLink value="/{!c.id}"><apex:outputText value="{!c.Project_Title__c}" /></apex:outputLink>  
                                             </apex:column>
                                             
                                                <apex:column headerValue="End Date" value="{!c.Project_End_Date__c}" headerClass="ct"/>
                                            
                                             <apex:column headerValue="Open Cases" value="{!c.Open_Cases_TEXT__c}" headerClass="ct"/>
                                             <div id="casesRelated">
                                                 <apex:column headerValue="Cases" headerClass="ct" id="caseCol" rendered="true">
                                                     <apex:relatedList subject="{!c.id}" list="Cases__r"  />
                                                 </apex:column> 
                                             </div>
                                                 
                                             </div>

                                         </apex:pageBlockTable>

However the related list for each row only displays the cases from the very first c.Id! How do I make it iterate with the rows of the pageblocktable? Thanks, Sam!
I can center pageBlockTable headers no problem, but I can't get pageBlock headers to center. 

Can anybody help me with this? Thanks.