• Boman@imt
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 31
    Replies

I've overridden the tab for a custom object and am trying to use jquery to hide() the ACTION_COLUMN since I do not want those operations available to CP users, but it's not working! Easily done when I use the traditional apex:listViews.

 

<script>
  var j$ = jQuery.noConflict();
  j$(document).ready(function() { 
    console.log("Trying to hide!!!")
    j$(".x-grid3-hd-btn").hide();
    j$(".x-grid3-hd-inner").hide();
    j$(".x-grid3-hd-ACTION_COLUMN").hide();    
  });  
</script>

 

Any suggestions?

I'm experiencing what seems like unpredictable behavior when using the Streaming API. Some of my PushTopic criteria WHERE clause conditions are met via after insert triggers, and I notice that sometimes I receive the expected events and sometimes I don't! Can someone help explain where in the following http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_triggers_order_of_execution.htm order of execution would event generation occur? Thanks.

I have Sites enabled to serve as the login for our Customer Portal, and have used CNAME to re-direct traffic from
http://<customdomain>.com to the Site, where the customer then logs in using their credentials. At the site level I have the "Custom Address" field configured to <customdomain>.com.

 

All works great, EXCEPT, once the customer logs in they, unfortunately see the https URL with "...force.com" in it e.g. https://na1.salesforce.com/a02/o This is not good, since I would like to mask the fact from the customer that they are in fact running on a SFDC instance!

Would really appreciate any expert help and precise guidance on how to overcome this. Do I need to roll my own URLRewriter class or what?

 

Thanks.


--Boman.
Hi All

I have two remote action method on controller side say method1 and method2. I am creating a list in method1 and the return type  is void now form other action I am calling method2 where I need to return the list which I have created in method1. On the nutshell I need to that list which is created in method1 in method two. And method1 is not having retrun type.  If it is not possible then any alternate for this scenario. Please suggest If anyone have any idea, it will be very usefull.

I've overridden the tab for a custom object and am trying to use jquery to hide() the ACTION_COLUMN since I do not want those operations available to CP users, but it's not working! Easily done when I use the traditional apex:listViews.

 

<script>
  var j$ = jQuery.noConflict();
  j$(document).ready(function() { 
    console.log("Trying to hide!!!")
    j$(".x-grid3-hd-btn").hide();
    j$(".x-grid3-hd-inner").hide();
    j$(".x-grid3-hd-ACTION_COLUMN").hide();    
  });  
</script>

 

Any suggestions?

Hi,

 

I have developed a VF for Streaming API which is working fine in developer edition. When I am running same code in another developer edition it is not running. I think there is some setting missing. Please help me.

 

<apex:page >
    <apex:includeScript value="{!$Resource.cometd}"/>
    <apex:includeScript value="{!$Resource.jquery1}"/>
    <apex:includeScript value="{!$Resource.json2}"/>
    <apex:includeScript value="{!$Resource.jquery_cometd}"/>
    <script type="text/javascript">
        (function($){
            $(document).ready(function() {
                // Connect to the CometD endpoint
                $.cometd.init({
                url: window.location.protocol+'//'+window.location.hostname+'/cometd/24.0/',
                requestHeaders: { Authorization: 'OAuth {!$Api.Session_ID}'}
                });
                // Subscribe to a topic. JSON-encoded update will be returned
                // in the callback
                $.cometd.subscribe('/topic/Push', function(message) {
                $('#content').append('<p>Notification: ' +
                'Channel: ' + JSON.stringify(message.channel) + '<br>' +
                'Record name: ' + JSON.stringify(message.data.sobject.Name) +
                '<br>' + 'ID: ' + JSON.stringify(message.data.sobject.Id) +
                '<br>' + 'Event type: ' + JSON.stringify(message.data.event.type)+
                '<br>' + 'Created: ' + JSON.stringify(message.data.event.createdDate)
                +
                '</p>');
                });

            });
        })(jQuery)
    </script>
    
    <body>
        <div id="content">
            <h1>Streaming API Test Page</h1>
            <p>This is a demonstration page for Streaming API. Notifications from the
            InvoiceStatementUpdates channel will appear here...</p>
        </div>
    </body>
</apex:page>

 

 

 

thanks in advance,. am new to sfdc dev.. please help me asap. my current code coverage is 34%

 

global class ShippedDailyEmail implements Schedulable {

List<OrderLine__c> olList = new List<OrderLine__c>();
list<order__c>orderlist=new list<order__c>();
set<id>orderid= new set<id>();
set<id> orderset=new set<id>();
global void execute (SchedulableContext SC) {
    sendEmail();
}

public void sendEmail() {
    List<Messaging.SingleEmailMessage>  myEmails = new List<Messaging.SingleEmailMessage>();
    dateTime todaysDate = system.now();   
    dateTime yesterdaysDate = todaysDate.addDays(-1);
    //system.debug('yesterday*****'+yesterdaysDate );
    system.debug('today*********'+todaysDate);
    //datetime yesterdaysDate = todaysDate.addMinutes(-5);
    system.debug('yesterday*****'+yesterdaysDate );  
   
     for (orderline__c ol: [select Name, SerialNo__c, order__r.id , order__r.requestor_email__c, order__r.requestor__c from orderline__c
                                where Shipped_Email_Sent__c = False and Actual_Ship_DateTime__c > :yesterdaysDate
                                and Actual_Ship_DateTime__c <:todaysDate])
        { 
            //add the orderline to the List
            olList.add(ol);
            orderid.add(ol.order__c);
            System.debug('Order with Shipment: ' + olList);
        }  
    
    System.debug('Order List: ' + olList.size());
    //query the list of orders and related details given the orderline list
   
   // List<orderline__c> orderList = new List<orderline__c>();
   /*
     if (olList.size()>0) {
        System.debug('Order List has records: ' + olList.size());
        orderList = [select order__r.id , order__r.requestor_email__c, order__r.requestor__c 
                     from orderline__c  
                     where Name in :olList];
    } else {
        System.debug('Order List is null');
        orderList = null;
    }  
    */
    orderlist=[select id,requestor__c from order__c where id in :orderid];                                    
    if (orderlist!= null) {
        for (order__c o: orderlist) {
        myEmails.clear();
        system.debug('count***********'+o.id);
                //build the email for each Order
               
                Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
                // select the template
                mail.setTemplateId(System.label.DailyShippedEmailTemplate);
               
                // set the object ID the email is about
                mail.setwhatid(o.id);
                System.debug('Order id =' + o.id);
               
                // set the receipient to the correct contact
                mail.setTargetObjectId(o.requestor__c);
                //mail.setTargetObjectId('003V000000B0XIh');
               
                // set the reply-to address
                //mail.setReplyTo(System.label.ReplyToAddress);
                mail.setOrgWideEmailAddressId(System.label.ReplyToAddressID);
                //mail.setSenderDisplayName(System.label.SenderDisplayName);
                           
                // populate the CCList from the custom label
                    
                String CCList = System.label.EmailCCList;
                String[] toCC = new String[] {};
                toCC = CCList.split(',');
                mail.setCCAddresses(toCC);
              
                mail.SaveAsActivity = false;
                myEmails.add(mail);        
     
           
            try {      
                // send the emails
                Messaging.sendEmail(myEmails);
                orderset.add(o.id);
                      } catch (DMLException e) {
                System.debug('Error sending email - Error: ' + e.getDMLMessage(0));
                return;
            } catch (exception e1) {
                System.debug('Error sending email - Error: ' + e1.getMessage());
                return;
            }  
        }
       for(orderline__c o :[select id from orderline__c where order__c in:orderset and Shipped_Email_Sent__c = False and Actual_Ship_DateTime__c > :yesterdaysDate
                                and Actual_Ship_DateTime__c <:todaysDate]) 
       {
             o.Shipped_Email_Sent__c = True;
             update o;          
       }
    }
    }

  @IsTest(SeeAllData=true) public static void testShippedDailyEmail() {
           
    ShippedDailyEmail controller = new ShippedDailyEmail();
    controller.sendEmail();
   
  }
}

 

 

Hi All,

 

I have few test class in my sandbox .I am trying to deploy the code in production by using the

changeset .

 

I am getting the below error only in one  class

 

Failure Message: "System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATE_USERNAME, Duplicate Username.<br>Another user has already selected this username.<br>Please select another.: [Username]", Failure Stack Trace

 

I have checked the user name in all the test class all are unique only.I have used follow things in this test class.

 

1.@isTest(SeeAllData=false)

 

2. Profile p=[select Id from profile where name='HRMS Employee Manager'];
            User Mngr = new User(alias='Con2', email='arishRev2@gmail.com',emailencodingkey='UTF-8',lastname='Manager',languagelocalekey='en_US',localesidkey='en_US',profileid=p.id,timezonesidkey='America/Los_Angeles',username='consleaguerevcon2@consleague.com');
            insert Mngr;

 

 

Please help me how to resolve this error.

 

 

 

 

I can't figure out why this trigger does not work sometimes.

 

It doesn't do anything at all, sometimes.  Other times it adds the wrong Record Id into the Lookup field.  Other times it works just fine.

 

It seems to freak out during data loads.  It seems to work (most of the time, but not always) during the normal UI/UX.

 

I'm trying to pull a Record Id from a formula field (Contract_Header__c).  That Record Id should fill in the Contract_Header_LOOKUP__c field.  That's it.  This should happen within the Object (Contract_Line__c) whenever it is created by another object (Asset) which fires a trigger when Asset.Status = 'Active'.

 

Existing Code:

 

trigger ContractLine on Contract_Line__c (before insert, before update)  {
    
    List <Contract_Line__c> clsToUpdate = new List <Contract_Line__c>();
    String headerName, accountName;
    Id chId;

    for(Contract_Line__c c: Trigger.new)
    {
        System.debug('++++ looping through Contract_Line__c trigger context ');
        
        if(c.Contract_Header_LOOKUP__c == null && c.Contract_Header_Name__c != null ){
            System.debug('++++ Contract_Header_LOOKUP__c not null && Contract_Header_Name__c not null  ');
            System.debug('++++ assigning account name and header name ');
            accountName = c.Account__c;
            headerName = c.Contract_Header_Name__c;
        }
    }

    for(Contract_Header__c ch : [SELECT Id FROM Contract_Header__c WHERE Name =: headerName AND Account__c =: accountName ])
    {
        System.debug('++++ query for loop to find Contract_Header__c with matching headername and account ');
        chId = ch.Id;
        System.debug('++++ assigned chId  = ' + chId);
    }

    for(Contract_Line__c cl: Trigger.new)
    {
        System.debug('++++ back in trigger context to udpate contract header');
        if(chId != null)
            cl.Contract_Header_LOOKUP__c = chId;
        System.debug('++++ udpated Contract_Header_LOOKUP__c on contractline ');    
        System.debug('++++ cl.Contract_Header_LOOKUP__c = ' + cl.Contract_Header_LOOKUP__c);
    }
    
}

 

Old Code - which worked - but threw too many exceptions (on SOQL queries when doing data loads or lots of changes - b/c there weren't enough filters in place:

trigger ContractLine on Contract_Line__c (after insert, after update){
   List <Contract_Line__c> cList = new List <Contract_Line__c>();
   List <Contract_Header__c> cHeaderList = new List <Contract_Header__c>();
   for(Contract_Line__c c: [Select Contract_Header__c, Contract_Header_LOOKUP__r.Most_Recent_Update__c from Contract_Line__c where Id IN :Trigger.newMap.keySet()])
   {
   c.Contract_Header_LOOKUP__r.Most_Recent_Update__c = System.now();
       cList.add(c);
       
cHeaderList.add(c.Contract_Header_LOOKUP__r);       }
           
   if(cHeaderList.size()>0)
   {
    try{
     update cHeaderList;
    }catch(DMLException e)
    {
     system.debug (e); 
    }
   }
}

 

Can anyone help me to make this work?

 

  • July 09, 2013
  • Like
  • 0

hi everyone,

 

I want to display username dynamically (something like "Welcome xxxxx") in the customer portal header, when a customer logged in. Please help me regarding this.

 

Note: I've gone through that and observed that header cannot be changed with VF and CSS, HTML doesnot support dynamic displaying of this username.

 

  • October 25, 2012
  • Like
  • 0

I'm thinking I have an issue with caching but can't work out what it is...I have a Sites page (key code below) that works now, but I know that when I try and access it tomorrow morning, it will throw an 'Authorized Only' error to the person trying to access it via the Sites page.

 

Then, if I sign into SF, I can access the page via the internal /apex/pagename link, and from then on the Sites page also works fine until the next morning, when the problem occurs again. What I am missing?

 

<apex:page standardController="Nomination2__c" extensions="NominationAcceptanceExtension" standardStylesheets="false" showHeader="false" sidebar="false">

  <apex:stylesheet value="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css"/>
  <apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" />
  <apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" />
  
<!--Multi Select Functionality based on this post:
http://www.tgerm.com/2012/01/ipad-multiselect-picklist-jquery-plugin.html
-->
   
  <apex:includeScript value="{!URLFOR($Resource.twinBoxMultiSelectList, 'uiPickList.js')}"/>
  <apex:stylesheet value="{!URLFOR($Resource.twinBoxMultiSelectList, 'uiPickList.css')}"/>


<!--    Additional style sheets stored in VF Components -->
    <c:ACYPlWebCSS />
    <c:NominationACSS />
    
<script type="text/javascript">
       var j$ = jQuery.noConflict();
 
       j$(document).ready(function(){
           j$("#accordion").accordion({ autoHeight: false, collapsible: true });
           
           j$('[id$=travelavail]').twinBoxMultiSelectList({
                            availableList : 'span[id$=availabletravelContactsContainer]',
                            selectedList : 'span[id$=selectedtravelContactsContainer]',
                            styles: {
                                width: '220px'
                            }
                        });
           
              
             j$().css('font-family', 'Verdana,Arial,sans-serif');
             j$('#dialog').hide();
                              
        });
        
        function openlanguages () {
     
                   j$("#dialog").dialog({
                   modal:false,
                   closeable:false,
                   resizeable:false,
                   width:440,
                   overlay: {opacity:0.5, background:"black" },
                   title: 'Language Proficiency'       
                   });
                   
                   }
       
        function closelanguages () {
     
                   j$("#dialog").dialog('close');
                   
                   } 
     </script>    

<title>Nomination Acceptance</title>

    <header id="header" role="banner">
        <div class="upPanel">

=====The rest is just standard VF/HTML====

 

 

In a visualforce barchart, we need to be able to put a label on top of each bar which reads the peakvalue of that particular bar

  • October 03, 2012
  • Like
  • 0

Hi,

 

 

How to develop google map location based in vf page? in my page has location input text box

and when i serch with location in my object having that location records how to plot these

records in google map.

 

 

 

Thank you

 <apex:commandLink action="http://www.apple.com/privacy/" value="Insulet Corporation HIPAA  Privacy Notice " styleClass="normalColor" target="_blank"/> 

when I click on button it is taking to Relative URL:

http://insulet.test.cs13.force.com/vfpage/%E2%80%8B/%E2%80%8B/%E2%80%8Bwww.apple.com/%E2%80%8Bprivacy/

is there any salesforce expert who can help me in javascript remoting and apex controller with google charting

  • September 26, 2012
  • Like
  • 0

 

I want to display my company logo on the customer portal LOGIN PAGE. How to do it?


In the Customer Portal's LOGIN PAGE there two sections:

 

1. To enter username and password

2. To register new customers.

 

I want an image on the top right position of this page....

How can I get this?

 

 

 

Alright I have wound up in a situation where I am using a Text(255) field to field in the value parameter of a SelectList in Visualforce.  When the selectList has multiSelect set to false this works perfectly.  When multiSelect is set to true, it writes the value back to the field exactly as expected.  However if there is already a value in the field, it will not show up preselected.  The value is stored as val1;val2;val3 etc... and is in the same format that the selectList wrote it there as.  Can anyone think of a way to get the selectList to preselect the correct values?  Please do not tell me to use inputField along with the correct field type, trust me that is not an option here. 

Hi,

 

I had quite a harrowing weekend trying to deploy a lot of code from a full sandbox to production.  One of the problems I had was slowness.  Using Eclipse and deploying to live took as much as 45 minutes, only to come back with a failure.  I found this particularly frustrating because when everything works in a full copy sandbox, you expect it to work in production.

 

A deployment whose steps took 20 minutes against a full sandbox took 9 hours against production because of errors.  So I'd take four or five minutes to try something to resolve the error and then I'd have to wait another 40 for the deployment to fail.  Even when I was loading only one small class with one small unit test, it still took a long time.

 

I was wondering if I'm the only one experiencing this, and if it's an Eclipse thing or a Salesforce thing.

 

Any tips would be most appreciated.

Similar to the Dashboard button "Refresh" which has two options "Refresh Now" and "Schedule Refresh"

 

Does anyone have any pointers?