• salesforceapex
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 13
    Replies
Hi I created a VF page using SLDS, and created an table using slds-Data-Table. My datatable volume is large and I need to have the header fixed. I tried searching for solution and not able to get succeeded. Could anyone please help if you come across this scenario.
Hi - window.onbeforeunload function is not working for me in the salesforce lightning environment. I have a visualforce page styled using Lightning design system, we I view the page in classic the window.onbeforeunload works fine and pops out the standard not saved messagebox when I switch the tab. However, when I switch back to lightning and try the same(change the tab) then its not working.

window.onbeforeunload = function(e) {
  return 'changes not saves';

Anyone ever come across this scenario.? Please suggest on what I'm doing wrong here,
Hi I created a VF page using SLDS, and created an table using slds-Data-Table. My datatable volume is large and I need to have the header fixed. I tried searching for solution and not able to get succeeded. Could anyone please help if you come across this scenario.
Hi - window.onbeforeunload function is not working for me in the salesforce lightning environment. I have a visualforce page styled using Lightning design system, we I view the page in classic the window.onbeforeunload works fine and pops out the standard not saved messagebox when I switch the tab. However, when I switch back to lightning and try the same(change the tab) then its not working.

window.onbeforeunload = function(e) {
  return 'changes not saves';

Anyone ever come across this scenario.? Please suggest on what I'm doing wrong here,
Hi,
In Visualforce I have two select fields, first select is enabled and second is disabled (="true"), based on the selection from first select the 2nd will be enabled using javascript. After I click on submit I'm not getting value for 2nd though its enabled. So how can I send 2nd select value to controller?
 
<apex:page controller="PhotoApprovalController" showHeader="false" standardStyleSheets="true" sidebar="false">
    <script type="text/javascript">
        function enableRejectReason(status,optionReject){
            var selectiontStatus = document.getElementById(status).value;
            if (selectiontStatus=="Reject")
                document.getElementById(optionReject).disabled=false;   
            else
                document.getElementById(optionReject).disabled=true;   
        }
    </script>
    
    <apex:define name="body">  
        <center>
            <apex:pageMessages />
            <apex:panelGrid bgcolor="white" columns="2"> 
                <apex:image url="{!photoURL}" height="150" width="150"/>
                <apex:panelGrid >
                    <apex:form id="theForm">
                        <apex:panelGrid columns="1" style="margin-top:1em;">
                            <apex:panelGrid columns="2"> 
                                <apex:outputLabel value="Select Status:" for="Name"/> 
                                <apex:selectList value="{!pas}" multiselect="false" size="1" id="pas" 
                                                 onchange="enableRejectReason('{!$Component.pas}','{!$Component.prs}')">
                                    <apex:selectOptions value="{!pasOptions}"/>
                                </apex:selectList>
                                <apex:outputLabel value="Select Reason:" for="Rason" />
                                <apex:selectList value="{!prs}" id="prs" 
                                                 multiselect="false" size="1"  style="width:250px;" disabled="true">
                                    <apex:selectOptions value="{!prsOptions}" />
                                </apex:selectList>
                            </apex:panelGrid>
                            <apex:panelGroup >
                                <apex:commandButton action="{!submit}" value="Submit" id="submit" disabled="{!isSubmitButtonDisabled}" />
                            </apex:panelGroup>
                        </apex:panelGrid> 
                    </apex:form>                  
                    <br/>
                </apex:panelGrid>
            </apex:panelGrid> 
        </center>
        <br/>
    </apex:define>
</apex:page>

Please advice...

Thanks.
I am trying to set our application session time out to exactly one hour. I have already set the Session Timeout value to 1 hour in Session Settings. Is there a way to enforce exactly 1 hour timeout instead of the the way SF calculates session timeout (as below) ?

"The last active session time value isn’t updated until halfway through the timeout period. That is, if you have a 30 minute timeout, the system won’t check for activity until 15 minutes have passed. For example, assume you have a 30 minute timeout value. If you update a record after 10 minutes, the last active session time value won’t be updated because there was no activity after 15 minutes. You’ll be logged out in 20 more minutes (30 minutes total) because the last active session time wasn’t updated. Suppose you update a record after 20 minutes. That’s five minutes after the last active session time is checked, so your timeout resets and you have another 30 minutes before being logged out, for a total of 50 minutes."

I have a simple trigger that works in the sandbox, does exactly what I want it to do. Cannot get code coverage above 40%.

I also do not know how to see what code is not covered. The test class below was pieced together from samples I found.

Any help would be appreciated!

 

Trigger:

 

trigger Pharmacy_Demo_Completed on Task (before insert){
   for (Task T : trigger.new){
      string TaskProfile = 'Implementation Director';
      string TaskSubject = t.subject;
      string TaskType = 'Send Contracts';
      if (TaskSubject == 'Pharmacy Demo Completed'){
          List <User> usr = [select Id from User where Profile.Name =:TaskProfile limit 1];
          system.debug (Usr.size());

          If (Usr.size() < 1){
             system.debug ('No entries found for ');}
                                       
          if (usr.size() > 0){
                User u = [select Id ,name from User where Profile.Name =:TaskProfile limit 1];
                t.ownerid = u.id;
                t.type = TaskType;}
      
}
}
}
Test Class: (Saves without error)

 

@isTest
public class Taskusertest2 {
    List<Task> insertedTasks = new List<Task>{};
    static testMethod void myUnitTest() {
    for(Integer i = 0; i < 100; i++)    
        {Task t = new Task();
            t.IsRecurrence = FALSE;
            t.sma__CreatedLocationVerified__c = FALSE;
            t.IsReminderSet = FALSE;
            t.MA_Clean_State__c = 'tx';
            t.Subject = 'Testing';
            t.Type = 'Research';
            t.Priority = 'Normal';
            t.Description = 'Task Class Test';
            t.Status__c = 'Demo Scheduled';
            t.Status = 'Completed';
        insert t;}
        
         List<Task> insertedTasks = [SELECT Description
                                                FROM Task
                                                WHERE Status = 'Demo Scheduled'];
         {for(Task t : insertedTasks)
          System.assertEquals(
          'This Task is probably left over from testing. It should probably be deleted.',
          t.Description);}
        
    }}

 

I'm having issue in escaping a single quote in VisualForce page.

In my output label, I used

{!IF($Profile.Name=="Customer Portal User","My Open Service Requests","Company\'s Open Service Requests")}

 

The output on my VF page is Company\'s Open Service Requests. Its not escaping the single quote. 

 

I also tried "Company\'\'s Open Service Requests".

 

Thanks in advance for the help.

  • October 04, 2012
  • Like
  • 0

I am using Force.com IDE with Eclise 3.6.  How to Run Visual force Page coding in the Eclipse. Where can I see my Page Output.

 

Consider I developed an Visual force Page for my organisation. I want that same Visual force page for other Organisation. How to port that Application to that organisation.(It is like changing .exe files from system to system).

 

Then How to deploy that Application in AppExchange........

 

Plz clear my Basic doubts....Then only I can go to developement......In Force.com Tutorials they give Codings for Visual force page....but didn't say How to  Edit coding, Run that coding in Eclipse IDE....Plz Help...............

 

HI,

 

I have test method  and it's getting failing with this error : "System.Exception: No more than one executeBatch can be called from within a testmethod.  Please make sure the iterable returned from your start method matches the batch size, resulting in one executeBatch invocation."

 

this is the case when I run test case in Full sandbox. I am not getting problems in Development Sandbox.

 

Any help on this would be appreciated.

 

Thanks