• JAW99
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 46
    Questions
  • 146
    Replies

Can someone assist? I must be missing something.

I have 2 triggers in production and sandbox (same in both):

They have 0% coverage in production, 100% and 90+% coverage in sandbox - b/c I have the test classes in the sandbox only. 

I want to deploy these test classed to production. I cannot.

 

The Deploy Error is "Average test coverage across all Apex Classes and Triggers is 69%, at least 75% test coverage is required.

 

This low coverage is what I am trying to fix by deploying test coverage. How can I increase coverage? 

Thanks. 

  • December 28, 2011
  • Like
  • 0

I am trying to pull a filted list on a VF page but am thinking that the VF pageBlockTable cannot filter properly. Is there an Apex alternative to the following code with an option that would only return records with a specified value in a specified field? Thanks

 

<apex:page standardController="Account" >
<apex:pageBlock >

<apex:form >

<apex:pageBlockTable value="{!account.Contracts}" var="Contract">

<apex:column headervalue="Contract Number">
<apex:outputLink value="https://na2.salesforce.com/{!Contract.id}"  target="_top" id="theLink">{!Contract.contractNumber}</apex:outputLink>
</apex:column>

<apex:column value="{!Contract.Contract_Type__c}"/>

<apex:column value="{!Contract.status}"/>
<apex:column value="{!Contract.ownerid}"/>    
  
<apex:column value="{!Contract.ActivatedDate}"/>

</apex:pageBlockTable>
</apex:form>
</apex:pageBlock>


</apex:page>

 

  • October 04, 2011
  • Like
  • 0

Have the sample code, but I am having issues in modifying it in 2 ways -

- I want to display a custom object, but am having trouble replacing the contacts

- I want to only display records with a certain field value (Product = United)

any help with ficing the output and filtering based on field value much appreciated

 

<apex:page standardController="Account" >
<apex:pageBlock >

<apex:form >

<apex:pageBlockTable value="{!account.Contracts}" var="Contract">

<apex:column headervalue="Contract Number">
<apex:outputLink value="https://na2.salesforce.com/{!Contract.id}"  target="_top" id="theLink">{!Contract.contractNumber}</apex:outputLink>
</apex:column>

<apex:column value="{!Contract.Contract_Type__c}"/>

<apex:column value="{!Contract.status}"/>
<apex:column value="{!Contract.ownerid}"/>    
  
<apex:column value="{!Contract.ActivatedDate}"/>

</apex:pageBlockTable>
</apex:form>
</apex:pageBlock>


</apex:page>
              

 

 

 

 

 

 

  • September 26, 2011
  • Like
  • 0

 

I am struggling with an issue regarding the sharing needs of oncoming groups of users.

They are looking for a system in which all companies would be shared, with each group having its own private sections on the page layout. Easy enough.

But the complication comes with contacts and opportunities - they want the existence of all records to be shared, but the details to only be shared across groups when allowed. Thus, user from group A would search, find a contact has previous relationship with someone from group B, and have to go through the person in B to get the contact's info.

I had devised a system using record types and page layouts - one for group A, one for group B, and one for "shared" objects that works, but seems clunky.
However, it is not going to be only 2 groups. It will be an expanding number of groups, so managing via record type / layout relationships is impracticable.

Am now considering VF page - where the record owner could check boxes (or something) to allow other users acces to the contact details.

Please- does this sound like an practical path to be heading down? Any tips or leads would be appreciated. thanks



  • September 21, 2011
  • Like
  • 0

I am struggling with an issue regarding the sharing needs of oncoming groups of users.

 

They are looking for a system in which all companies would be shared, with each group having its own private sections on the page layout. Easy enough.

 

But the complication comes with contacts and opportunities - they want the existence of all records to be shared, but the details to only be shared across groups when allowed. Thus, user from group A would search, find a contact has previous relationship with someone from group B, and have to go through the person in B to get the contact's info. 

 

I had devised a system using record types and page layouts - one for group A, one for group B, and one for "shared" objects that works, but seems clunky.

However, it is not going to be only 2 groups. It will be an expanding number of groups, so managing via record type / layout relationships is impracticable. 

 

If I could sum it up in a simple wish, it would be to change the function of sharing = Private from "completely hidden" to "can only see the name and selected details."

 

Please, any suggestions, pointers to working examples, etc would be much appreciated. 

  • September 16, 2011
  • Like
  • 0

Someone was kind enough to help me work through to get the following trigger, now I need some help building test coverage so I can deploy. thanks.

 

 

trigger NextTaskInfo on Task (after insert, after update) {
          

  if(Trigger.new.size() == 1 ) {

    Task tk = Trigger.New[0];
    String str = tk.whatid;
    if(str != null && str.substring(0,3)== '006')
    {

         Opportunity opp = [select OwnerId,NextTaskSubject__c,Next_Task_Date__c from Opportunity where Id = :tk.WhatId ];

        List<Task> tskMin = [Select ActivityDate,Subject From Task where whatid=:tk.whatid and  what.type = 'Opportunity' and isClosed  = false order By ActivityDate limit 1];  

        if (tskMin.size()>0) {
                opp.Next_Step_Date__c=tskMin[0].ActivityDate;
                opp.NextTaskSubject__c=tskMin[0].Subject;
        }
        else {
                opp.Next_Step_Date__c=null;        
                opp.NextTaskSubject__c='';
        }
        update opp;
    }
}
}

                          

 

 

  • May 02, 2011
  • Like
  • 0

Hello, I am considering using the JIRA - Salesforce connector but one limitation of that product is that updates/comments in SF cases are not automatically pushed to JIRA. They offer a sample Apex Class and trigger here

http://www.customware.net/repository/display/AtlassianPlugins/4.2+Synchronizing+linked+JIRA+issues+from+Salesforce.com+%28Deprecated%29

but it is not valid and I'd like some help getting this working.

Any assistance would be appreciated.

  • May 02, 2011
  • Like
  • 0

Researching anupcoming issue:

Our support team will be doing work for an affiliate that has its own Salesforce instance. We're looking at ways to get the people into the separate orgs with minimal trouble and no login/log out loops.

 

Looking for suggestions or known examples of this in practice, etc.  Thanks.

  • November 19, 2010
  • Like
  • 0

I think the title explains it - i am looking for some help writing a trigger that updates a specified field on the account record when we have a Contact Role that of a specific role and is primary. thanks.

  • November 12, 2010
  • Like
  • 0

Has anyone seen this? different ui displays on different computers - one user, on a different continent so it's hard to get the full feel for the situation unfortunately, shows the old UI when she logs in on a different computer.

We've been in the new Chatter UI for months now.

Did a cache clear of here browser. Anyone seen this? ideas?

  • November 05, 2010
  • Like
  • 0

WE have an external machine that generates some codes for our SF org.  it has a messy history but it's recent break is particularly bad.

what we need to see now is if the external machine's call backs into our org are even getting there. Where can i monitor API calls?

 

thanks ahead of time.

  • October 14, 2010
  • Like
  • 0

WE have an external machine that generates some codes for our SF org.  it has a messy history but it's recent break is particularly bad.

what we need to see now is if the external machine's call backs into our org are even getting there. Where can i monitor API calls?

I need something more specific than setup -> company profile -> company information API Requests, Last 24 Hours .

 

thanks ahead of time.

  • October 14, 2010
  • Like
  • 0

Am trying to track when certain account team types log activities on accounts by tagging a last updated type field when they log that call. and need some help. having toruble with the filtering to certain uses by profile. thanks for any help!

  • September 07, 2010
  • Like
  • 0

Can anyone offer assistance on this? I am trying overwrite standard tab buttons, in this case let's say New for contacts tab, to a VF page.

I get it either appearing in a subframe with sidebar, or if i try to java it I get 

Cross-site Scripting Possible cross site scripting attempt detected. 

I am guessing the server difference from salesforce.com to  visual.force.com triggers this?

Can anyone help? thanks!

  • March 25, 2010
  • Like
  • 0

 Does anyone have any neat ways to improve the native chart display for dashboards? The cut-off X axis label gets an ugly response from management. The problem is described graphically below and  here:

Chart Display Idea: https://sites.secure.force.com/ideaexchange/ideaView?id=087300000007MtvAAE

I am just wondering if anyone on this site has workaround for this or knows of an APP vendor who has a good solution. 

 This image is not available because: You don’t have the privileges to see it, or it has been removed from the system

Truly it's an issue of clarity and making those management types happy with eay to read info.

Message Edited by JAW99 on 02-19-2010 11:54 AM
  • February 19, 2010
  • Like
  • 0

How does one get it to look under a field other than name?

 

=sflookup(B12,C12)
accounttestaccount name

 works to give them test account's ID, but i need to use a field other than name.

 

Documentation claims:

sflookup(tablename, name): returns the ID for the table based on a search value; it matches most fields

 

 using an unique number in the "name"cell gives the NF

  • December 18, 2009
  • Like
  • 0

Hi I'd like to build a custom button to replace the "Log a Call" button so I can rename it something clearer to some users but upon save it does not return to the custom object it originates from.

 

 first is the SF url when using std Log a Call:

 

https://na2.salesforce.com/00T/e?title=Call&what_id=a19xxxxxxxxxHH&followup=1&tsk5=Call&retURL=%2Fa19xxxxxxxWHH

 

Next is my custom URL:

 

https://na2.salesforce.com/00T/e?title=Call&what_id={!Customoject__c.Id}&followup=1&tsk5=Call&retURL=%{!Customoject__c.Id}

 

Any suggestions on whyret url is always useless home?

  • October 26, 2009
  • Like
  • 0

Please help fix my code for

 

<apex:inputfield value="{!Task.Description}" size="50" />

how do i control the size of the comments box input field or any text area in a visual force page

 

i have searched and searched...

Message Edited by JAW99 on 10-23-2009 08:50 AM
  • October 23, 2009
  • Like
  • 0

Hi, i am having trouble building a list button that creates a new task that skips the record type selection stage and chooses the task RT I want. Button link is:

 

https://cs1.salesforce.com/00T/e?what_id={!CustomObject__c.Id}&retURL=%{!CustomObject__c.Id}&RecordType=012S0000000Ct8E&

 

But the new task always goes to the default. Some help much appreciated! thanks.

Message Edited by JAW99 on 10-21-2009 09:06 AM
  • October 21, 2009
  • Like
  • 0

Hi. SF lets us create and assign a new task via workflow but not an event. Can someone point me in the direction of how i'd build a workaround this oversight from SF?Thanks!

 

http://ideas.salesforce.com/article/show/10098420/Allow_workflow_to_create_EVENT_as_well_as_task

  • October 20, 2009
  • Like
  • 0

Can someone assist? I must be missing something.

I have 2 triggers in production and sandbox (same in both):

They have 0% coverage in production, 100% and 90+% coverage in sandbox - b/c I have the test classes in the sandbox only. 

I want to deploy these test classed to production. I cannot.

 

The Deploy Error is "Average test coverage across all Apex Classes and Triggers is 69%, at least 75% test coverage is required.

 

This low coverage is what I am trying to fix by deploying test coverage. How can I increase coverage? 

Thanks. 

  • December 28, 2011
  • Like
  • 0

Have the sample code, but I am having issues in modifying it in 2 ways -

- I want to display a custom object, but am having trouble replacing the contacts

- I want to only display records with a certain field value (Product = United)

any help with ficing the output and filtering based on field value much appreciated

 

<apex:page standardController="Account" >
<apex:pageBlock >

<apex:form >

<apex:pageBlockTable value="{!account.Contracts}" var="Contract">

<apex:column headervalue="Contract Number">
<apex:outputLink value="https://na2.salesforce.com/{!Contract.id}"  target="_top" id="theLink">{!Contract.contractNumber}</apex:outputLink>
</apex:column>

<apex:column value="{!Contract.Contract_Type__c}"/>

<apex:column value="{!Contract.status}"/>
<apex:column value="{!Contract.ownerid}"/>    
  
<apex:column value="{!Contract.ActivatedDate}"/>

</apex:pageBlockTable>
</apex:form>
</apex:pageBlock>


</apex:page>
              

 

 

 

 

 

 

  • September 26, 2011
  • Like
  • 0

Someone was kind enough to help me work through to get the following trigger, now I need some help building test coverage so I can deploy. thanks.

 

 

trigger NextTaskInfo on Task (after insert, after update) {
          

  if(Trigger.new.size() == 1 ) {

    Task tk = Trigger.New[0];
    String str = tk.whatid;
    if(str != null && str.substring(0,3)== '006')
    {

         Opportunity opp = [select OwnerId,NextTaskSubject__c,Next_Task_Date__c from Opportunity where Id = :tk.WhatId ];

        List<Task> tskMin = [Select ActivityDate,Subject From Task where whatid=:tk.whatid and  what.type = 'Opportunity' and isClosed  = false order By ActivityDate limit 1];  

        if (tskMin.size()>0) {
                opp.Next_Step_Date__c=tskMin[0].ActivityDate;
                opp.NextTaskSubject__c=tskMin[0].Subject;
        }
        else {
                opp.Next_Step_Date__c=null;        
                opp.NextTaskSubject__c='';
        }
        update opp;
    }
}
}

                          

 

 

  • May 02, 2011
  • Like
  • 0

Hello, I am considering using the JIRA - Salesforce connector but one limitation of that product is that updates/comments in SF cases are not automatically pushed to JIRA. They offer a sample Apex Class and trigger here

http://www.customware.net/repository/display/AtlassianPlugins/4.2+Synchronizing+linked+JIRA+issues+from+Salesforce.com+%28Deprecated%29

but it is not valid and I'd like some help getting this working.

Any assistance would be appreciated.

  • May 02, 2011
  • Like
  • 0

Hi,

 

We are JIRA users and need to integrate it with SFDC. Does anyone have a recommendation for the connector to use? Paid versus free?

 

Thanks,

 

Scott

  • March 22, 2011
  • Like
  • 0

Hi there.

 

I have a trigger that works almost perfectly but I need to change the behavior and I'm at a loss how to.

 

Behavior

Updates Opportunity field "Next Task Date" with the task due date

Updates Opportunity field "Next Task Subject" with the task subject

Triggered when

A new task is created or an existing open task is updated

ex. if there are 2 tasks , one due 1/1/2013 and another due 1/1/2014

if either one of these is updated or a new task is created, the opportunity fields are updated

Challenge

I need to limit the update so that it only pulls info from the next closest task due date

 

How do I change the trigger so that it achieves this? I would really appreciate some coding help.

 

Thanks  in advance. Please see code below.

 

trigger NextTaskInfo on Task (after insert, after update) {
//this is the trigger that updates next step and next step date on opportunity
  if(Trigger.new.size() == 1 ) {
    Task tk = Trigger.new.get(0);
      if (tk.WhatId != null && String.valueOf(tk.WhatId).startsWith('006')) { 
        Opportunity opp = [select OwnerId,NextTaskSubject__c,Next_Task_Date__c from Opportunity where Id = :tk.WhatId ];
          if( tk.OwnerId == opp.OwnerId && tk.ActivityDate != null) {                   
            if (tk.isClosed == false) {
              opp.Next_Step_Date__c = tk.ActivityDate;
              opp.NextStep = tk.Type;
              update opp;
}
}
}
}
}

 

 

  • December 31, 2011
  • Like
  • 0

Hi everyone,
I actually built a "simplified search" option for our sidebar, and our teams love it!  It is a combination of a visualforce page and javascript. Follow the 4 steps below to do the same.  Hope this helps!

1) Create a Visualforce page called "advancedsearch"
2) Use the following code as your page (Hint: for the "&sen=" portions in bold, these identify the objects you want to search.  For example, &sen=001 is an Account (click on the Accounts tab, and you will see those three numbers in the hyperlink).  My code below searches: Accounts, Opps, Contacts, Leads, and Campaigns

<apex:page showHeader="false" sidebar="false">
<apex:pageBlock >
<b>Enter search term: </b>
<apex:form >
<script>
function doSearch()
{
    var searchStr = document.getElementById('txtSearch').value;
    window.open('/_ui/common/search/client/ui/UnifiedSearchResults?sen=001&sen=003&sen=00Q&sen=006&sen=701&str=' + encodeURIComponent(searchStr), "_parent" );
}
</script>
<input type="text" id="txtSearch"/>
<input type="button" value="Go!" id="btnSearch" onclick="doSearch()"/>
</apex:form>
(<strong>NOTE:</strong> Only searches Accounts, Opps, Contacts, Leads, and Campaigns)
 </apex:pageBlock>
</apex:page>

3) Finally, go to setup > customize > home > home page components.  Create a new HTML area left sidebar component.  On the screen where you can enter in the HTML, make sure you select the checkbox "Show HTML" and then paste the following (this references your visualforce page and displays it in the sidebar):

<IFRAME height=150 src="/apex/advancedsearch?core.apexpages.devmode.url=1" frameBorder=0 width="100%"></IFRAME>

4) Add the custom component to your pagelayouts and test it out! 

I have bee trying to use the Outlook Connector with Outlook 2007. In all honesty, I have been completely frustrated. There are several users who have given me read/write sharing privileges on their contacts. However, I can't get the Outlook Connector to pull those contacts into Outlook. I thought I was supposed to be able to add shared contacts into my Outlook with the connector.