• john8407
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 32
    Questions
  • 24
    Replies

Hello,

 

I just started testing this plug-in last week and loved the flexibility. I just created 2 custom fields in the Account Object, but was unable to pull the 2 fields with a query. Any idea why custom fields are not brought into the query? I am using Office 2007 and everything else seems to work fine.

 

Thanks!!

In a scenario where I have a field that is required if another is a certain value, is there any way to have the record save in the background without reloading and the user noticing anything? I'm asking cause I want to include the required with an if statement on the other field.

I have a visualforce page that shows fields from multiple objects.  I noticed that when I try to save, it is not saving to the other child objects.  Anyone know how to make this happen?

Does anyone know if it's possible to null a related lookup field with the data loader? I've tried several times but it's not taking.

I have the link working to get to the mail merge page, but does anyone know how to add something in the link so the document is already selected? Or is it possible to create a link that will generate the mail merge and automatically take me to the task page after the merge page?

 

/mail/mmchoose.jsp?id={!Opportunity.Id}&1={!Opportunity.Name}&retURL=%2F{!Opportunity.Id}

Anyone see what's wrong with this? I can't figure out why it's not working.

 

OR(

AND( 
Opportunity.MagnysResubmitDeadline__c - NOW()<0, 
Sent_to_Magnys__c=TRUE, 
Resent_to_Magnys__c=FALSE, 
$Profile.Id<>"00e40000000wl5p" 
),

AND( 
Initial_Unit_Price__c <> 0.00, 
Sent_to_Magnys__c=TRUE, 
Resent_to_Magnys__c=FALSE, 
$Profile.Id<>"00e40000000wl5p" 
)

I keep getting Error:Apex trigger UpdateOpportunityCode96Box caused an unexpected exception, contact your administrator: UpdateOpportunityCode96Box: execution of AfterUpdate caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.UpdateOpportunityCode96Box: line 18, column 8

 

Anyone have any ideas? Appreciate any help.

 

Here is my code: 

 

trigger UpdateOpportunityCode96Box on OpportunityLineItem (after update)
{
List<id> oppIds=new List<id>();
for (OpportunityLineItem oli : trigger.new)
{
   if (oli.Magnys_Service_Code_Copy__c == '96')
   oppIds.add(oli.opportunityid);
}
Map<Id, Opportunity> oppsById=new Map<Id, Opportunity>();
List<Opportunity> opps= [select id, Contains_Code_96__c from Opportunity WHERE id in :oppIds];
oppsById.putAll(opps);
List<Opportunity> oppsToUpdate=new List<Opportunity>();
for (OpportunityLineItem oli : trigger.new)
   {   
       Opportunity opp=oppsById.get(oli.opportunityid);
       opp.Contains_Code_96__c = true;
       oppsToUpdate.add(opp);
   }
update oppsToUpdate;
}

trigger UpdateOpportunityCode96Box on OpportunityLineItem (after update){List<id> oppIds=new List<id>();for (OpportunityLineItem oli : trigger.new){   if (oli.Magnys_Service_Code_Copy__c == '96')   oppIds.add(oli.opportunityid);}Map<Id, Opportunity> oppsById=new Map<Id, Opportunity>();List<Opportunity> opps= [select id, Contains_Code_96__c from Opportunity WHERE id in :oppIds];oppsById.putAll(opps);
List<Opportunity> oppsToUpdate=new List<Opportunity>();for (OpportunityLineItem oli : trigger.new)
   {          Opportunity opp=oppsById.get(oli.opportunityid);       opp.Contains_Code_96__c = true;       oppsToUpdate.add(opp);   }
update oppsToUpdate;}

 

How can I have this open in a new window?

 

 <apex:outputLink value="../{!p.Id}" > {!p.Name} </apex:outputLink>

I have a visualforce page to input criteria to search for a product.  It returns the results in the section below the search button.  I want to have a component in the sidebar that I can input the criteria, and it carry the criteria over to the full size visualforce page and run the search.  Is this possible?

I have a trigger that populates an error message if criteria is met on a VF page.  Is it possible to include a link to the account from that error message?  This is my error.

 

opp.addError(''+contactname1.Name+' must have a contact type'); 

Our products can be different prices depending on the location of the customer.  The way we do this now is for one product available in 40 places, we load that product 40 times with a field on the product showing where its for.  I want to cut down on the products if possible.  Our pricing tool is customized visualforce and filters off the field on the product that says where its for.  Is it possible to have a class call all products in a price book? Im thinking of creating 40 price books for 1 product. 

I heard that there is a limit of 20 call outs per user per day.  Is this true?

I have a VF Page and Controller to run a search for products based on the product name and a custom field.  If I enter the product name and value for custom field in the controller query, it works.  I can't get it to reference what I enter in the fields on the VF page for the query.  Any help would be greatly appreciated.

 

Controller:

public with sharing class ProductSearchController2 {
   
    String strname = Apexpages.currentPage().getParameters().get('Name');
    String strcustom1= Apexpages.currentPage().getParameters().get('customfield');

 public ApexPages.StandardSetController setProduct {

        get {
            if(setProduct == null) {
                setProduct = new ApexPages.StandardSetController(Database.getQueryLocator([select Name, Customfield, MasterProduct__c, Rate__c from Product2 where Name = 'strname' AND customfield = 'strcustom1']));
            }
            return setProduct;
        }
        set;
    }
    public List<Product2> getProducts() {
         return (List<Product2>) setProduct.getRecords();
    }
}

 

VF Page:

<apex:page controller="ProductSearchController">
<script>
function runSearch()
{
   var Name = document.getElementById('txt1').value;
   var Customfield1 = document.getElementById('txt2').value;
}
       
function pressedKey()
{
if(event.keyCode==13)
{
document.getElementById("btnSearch").focus();
}
}
</script>
<apex:form id="generalsearch" onsubmit="runSearch();" onkeypress="pressedKey();">
<apex:pageBlock >
<b>Product Search: </b>
<input type="text" id="txt1" maxlength = "10" size = "5"/>
<input type="text" id="txt2" maxlength = "7" size = "7"/>
<input type="submit" value="Search" id="btnSearch" name="btnSearch"/>
</apex:pageBlock>
</apex:form>

    <apex:pageBlock >
        <apex:pageBlockTable value="{!Products}" var="p">
            <apex:column value="{!p.Name}"/>
            <apex:column value="{!p.Customfield1}"/>
            <apex:column value="{!p.MasterProduct__c}"/>
            <apex:column value="{!p.Rate__c}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

Anyone know of a way to add the search criteria of two fields in the url? IWhat I have so far is below from my VF page

 

function search()
{
   var searchStr = document.getElementById('txt1').value + '*';
   window.open('/ui/product/Search?search=' + encodeURIComponent(searchStr), "_parent" );
}

 

I want to add another field to search on which is a custom field.  How can I designate the existing to search the name field of the product object and add another criteria to search another field? For example the name is the Product Name.  I have a custom field called Site.  I will add another entry field on my VF page to seperate the two and I want to search on the two like I can from the product object with two filters.

Trying to keep a trigger from running for certain users.  Anyone know what I'm doing wrong?

 

String userName = UserInfo.getUserName();

User activeUser = [Select Username From User where Username = : userName limit 1];

String Uname = activeUser.Username ;

for(Opportunity masterOppty:Trigger.new){

if(masterOppty.Related_Opportunity__c!=null && Uname!='a user name')

Anyone know why this works with firefox but the case is never created in Salesforce if using IE?

I know this sounds crazy, but I wasnt part of the setup of this org.  If the org wide rules are Private on Account and Contact, but you have a rule that extends it to some users.  Is there a way to write code that will make it private to some users?

 

Another scenario is if the account is shared as read only but contact is private, the user can still create a contact on that account.  Is there some type of coding that can disable or remove the New button on the contact related list of the account if the user is not the owner of the account? Basically allow read access to the account, but dont let them create contacts or anything on it but still let them have the ability to create based on their profile so they can on their accounts.

 

Im being told that it use to function like this but I dont see any code, the rule has been in place since the start and hasnt been modified but they say there was some coding that did this before? I dont beleive this is possible so I need everyones help here.

We have a custom object called order that is generated from an opportunity.  If users attach an attachment to an opportunity, is there any way to have that attachment flow over to the order?

Here is my code:

 

trigger UpdateAccount on Contact (before insert, before update)
{
List<Account> accs= [select id,Finance_Contact_1__c from Account];
for(Contact c : Trigger.new)
{
if(c.Contact_Type__c=='Finance')
{
for(Account acc : accs)
{
acc.Finance_Contact_1__c = c.id;
}
}
}
update accs;
}

 

 

How can I modify it to resolve this error?

Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger UpdateAccount caused an unexpected exception, contact your administrator: UpdateAccount: execution of BeforeUpdate caused by: System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing. Even if a field is indexed a filter might still not be selective when: 1. The filter value includes null (for instance binding with a list that contains null) 2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times): Trigger.UpdateAccount: line 3, column 1

We have two contact lookup fields on the account, one is called finance contact 1 and other is finance contact 2.  When a user creates an account, they have to create 2 contacts.  After creating the contacts, they have to edit the account and do a lookup to put one of the contacts in finance contact 1 and the other in finance contact 2.  I added a contact type field on the contact object with values of finance contact 1 and finance contact 2.  Is there a way that when a user creates a contact and selects the type of finance contact 1, it will automatically insert that contact name into the Finance Contact 1 lookup field on the account.  And same for the 2nd finance contact?

Can someone help me out here.  What am I missing?

 

<a href="{!Case.Link}">Click here</a>

 

Anyone see what's wrong with this? I can't figure out why it's not working.

 

OR(

AND( 
Opportunity.MagnysResubmitDeadline__c - NOW()<0, 
Sent_to_Magnys__c=TRUE, 
Resent_to_Magnys__c=FALSE, 
$Profile.Id<>"00e40000000wl5p" 
),

AND( 
Initial_Unit_Price__c <> 0.00, 
Sent_to_Magnys__c=TRUE, 
Resent_to_Magnys__c=FALSE, 
$Profile.Id<>"00e40000000wl5p" 
)

How can I have this open in a new window?

 

 <apex:outputLink value="../{!p.Id}" > {!p.Name} </apex:outputLink>

Our products can be different prices depending on the location of the customer.  The way we do this now is for one product available in 40 places, we load that product 40 times with a field on the product showing where its for.  I want to cut down on the products if possible.  Our pricing tool is customized visualforce and filters off the field on the product that says where its for.  Is it possible to have a class call all products in a price book? Im thinking of creating 40 price books for 1 product. 

I know this sounds crazy, but I wasnt part of the setup of this org.  If the org wide rules are Private on Account and Contact, but you have a rule that extends it to some users.  Is there a way to write code that will make it private to some users?

 

Another scenario is if the account is shared as read only but contact is private, the user can still create a contact on that account.  Is there some type of coding that can disable or remove the New button on the contact related list of the account if the user is not the owner of the account? Basically allow read access to the account, but dont let them create contacts or anything on it but still let them have the ability to create based on their profile so they can on their accounts.

 

Im being told that it use to function like this but I dont see any code, the rule has been in place since the start and hasnt been modified but they say there was some coding that did this before? I dont beleive this is possible so I need everyones help here.

Here is my code:

 

trigger UpdateAccount on Contact (before insert, before update)
{
List<Account> accs= [select id,Finance_Contact_1__c from Account];
for(Contact c : Trigger.new)
{
if(c.Contact_Type__c=='Finance')
{
for(Account acc : accs)
{
acc.Finance_Contact_1__c = c.id;
}
}
}
update accs;
}

 

 

How can I modify it to resolve this error?

Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger UpdateAccount caused an unexpected exception, contact your administrator: UpdateAccount: execution of BeforeUpdate caused by: System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing. Even if a field is indexed a filter might still not be selective when: 1. The filter value includes null (for instance binding with a list that contains null) 2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times): Trigger.UpdateAccount: line 3, column 1

We have two contact lookup fields on the account, one is called finance contact 1 and other is finance contact 2.  When a user creates an account, they have to create 2 contacts.  After creating the contacts, they have to edit the account and do a lookup to put one of the contacts in finance contact 1 and the other in finance contact 2.  I added a contact type field on the contact object with values of finance contact 1 and finance contact 2.  Is there a way that when a user creates a contact and selects the type of finance contact 1, it will automatically insert that contact name into the Finance Contact 1 lookup field on the account.  And same for the 2nd finance contact?

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! 

Can someone help me out here.  What am I missing?

 

<a href="{!Case.Link}">Click here</a>

 

We have a product config where users can select products from product table but can also manually enter a product and it creates a line item in another object.  Anyone know of a way to open an excel file from the opportunity and allow the user to imput info on the excel file and import it to the object? This would be sales users so couldnt be using the data loader or excel connector.

If you're looking for help with Salesforce.com, I'm available.  Below are just a few of the things I can help with.

 

  • Customization and personalize Salesforce.com to your specific needs
  • User, Profile and Role Management
  • Customization of Standard Objects
  • Creation and customization of Custom Objects and Custom Apps
  • Workflow Rules, Validation Rules, Templates
  • Lead, Account, Opportunity and other object management
  • Create and modify Custom Reports and Dashboards
  • Data Import and manipulation

Please let me know if you have any questions.

 

Im working on a trigger to assign a case to the account owner if the type is 3 of the 6.  Say if I have case types below. 

 

Type1

Type2

Type3

Type4

Type5

Type6

 

I want it to be assigned to account owner if the case type is the first 3.  I cant figure out how to list multiple values in the trigger.  Below is how I have it now.

 

//change owner to account owner

if (c.Type == 'Type1', 'Type2', 'Type3') {

for (Account a : lAccounts) {

if (c.AccountId == a.Id) {

Im working on a trigger to assign a case to the account owner if the type is 3 of the 6.  Say if I have case types below. 

 

Type1

Type2

Type3

Type4

Type5

Type6

 

I want it to be assigned to account owner if the case type is the first 3.  I cant figure out how to list multiple values in the trigger.  Below is how I have it now.

 

//change owner to account owner

if (c.Type == 'Type1', 'Type2', 'Type3') {

for (Account a : lAccounts) {

if (c.AccountId == a.Id) {

c.OwnerId = a.OwnerId;