• geosow
  • NEWBIE
  • 80 Points
  • Member since 2010

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

I have a formula which concatenates two text fields.

 

I have run queries against it and can see records which contain non-null values and fields listed as null values in Real Force Explorer Query Tool.

 

I have been using the syntax myfield__c != null but that does not filter out any of the values which appear to be empty. I also tried syntax myfield__c != '' for kicks but neither seems to filter out the records.

 

My next step is to reach out to the community to see if perhaps I need to be doing something different to evaluate null formula values in SOQL or if there is a function to check the length of a text field (so I can check for a length greater than 1 for example)

 

 

I am developing a package and am testing it in a professional edition.  I wrote a PostInstall script that populates some custom Lead fields that are part of the package.  

 

The script fails in the PE because the fields are not writeable.  The only way to make fields writeable, to my knowledge, is to add them to the layout.  Is there any way around this error?  

 

Thanks,

 

--

George Sowards

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 
Salesforce.com Certified Advanced Developer

RedPoint Solutions, Inc.

 

I've enabled Salesforce Touch on several production orgs.  They all redirect to "touch" when browsing from a mobile browser except for one org.  The only difference is the org that is not working is set up with a "My Domain".  Is anyone able to use Touch with an org that uses a "My Domain"?

 

Thanks.

  • September 24, 2012
  • Like
  • 0

I am working on an integration that pushes data to Salesforce using XML as the format.  However, one of the values is serialized and I'm having the hardest time parsing it.  It is getting serialized on the other end using the PHP Serialize function.  Is there anything out there that I can use in Apex that can help deserialize this value?  Even if I have to do a callout with the value to get deserialized data back, I'd be happy with that.  Thanks,

 

~geosow

 

PS - this is an integration with Magento.

  • August 24, 2012
  • Like
  • 0

I've been working in an org for almost 2 years.  They just installed a managed package; it's a large 100% native accounting application (I didn't want to put the name in this thread just yet).

 

Everything has been speedy.  However, after the installation, I've noticed that it now takes over 2 minutes to save triggers, classes and visualforce pages via Eclipse.  I have clients on the same CS12 instance and the performance is fine.  Has anyone experience a significant performance decrease in the ID after installing "FF" ?

 

All I'm doing is a save/build.  No unit tests or anything.  Just a save of small modifications to triggers and stuff.  

 

To troubleshoot, I re-created my project in Eclipse and it took over 15 minutes just to get the listing of items that I wanted to add to my project.  Any ideas?  Thanks,

 

George Sowards

www.RedPointSolutions.com

  • August 17, 2012
  • Like
  • 0

I just refreshed a sandbox and it was created on the CS11 instance.  I couldn't get Data Loader or Eclipse to authenticate.  I had to hard-code the instance to "CS11" and it worked fine.  Is this a new issue or have I been lucky enough to never have a sandbox on CS11?  

 

So logging in using https://test.salesforce.com fails but if I point to https://cs11.salesforce.com, it works fine.

  • April 06, 2012
  • Like
  • 0

I'm working with a Visualforce page that has anchors in it.  It's doing inputFile "stuff" and this requires a page refresh.  So I force the page refresh with an anchor in the pageReference like this:

 

PageReference refreshPage = new PageReference('/apex/thePage?id=' + o.Id);    	    
refreshPage.setAnchor(tabNumber);
refreshPage.setRedirect(true);
return refreshPage ;  

 

The code above works like a charm and allows me to go back to a jQuery tab on refresh of the page.  My new URL after refresh is this: https://c.cs0.visual.force.com/apex/thePage?id=006T0000008O8mVIAS#tabs-1

 

The problem I'm having is with this code:

 

PageReference newPage;
newPage = new PageReference('/apex/anotherPage?id=' + o.Id);
newPage.setRedirect(true);
return newPage;

 

With the above code I get this URL:  https://c.cs0.visual.force.com/apex/anotherPage?id=006T0000008O8mVIAS%23tabs-1

 

And I get this error:  "Id value 006T0000008O8mVIAS#tabs-1 is not valid for the Opportunity standard controller" 

 

I've tried to set the anchor to null and blank.  A debug on getAnchor shows nothing before the redirect.  For starters, I don't see why the standard controller isn't parsing out the %23 as an anchor.  And finally I don't see how the anchor is getting passed to the next page in the first case.  Any ideas?

 

I've solved this with what I would consider a hack.  I'll post it in a bit but wanted to see if anyone had some ideas.  Thanks,

 

George

 

  • February 08, 2012
  • Like
  • 0

Has anyone noticed that the "Recent Items" in sidebar started acting weird after the Spring '12 release if you're using Chrome?  When you click a link in the recent items it collapses and most of the time doesn't direct you to the new page.  I noticed it in the sandboxes that were upgraded to Spring '12 over the last few weeks but figure that it was such a glaring issue that it wouldn't find it's way to production orgs; this morning, I'm seeing that the issue is in production.  Is there a setting in Chrome that causes this or an oversight by SFDC's QA?

  • February 06, 2012
  • Like
  • 0

I have an issue in my sandbox that was moved to Winter '12 over this last weekend.  The following code does not throw an error in the Summer '11 production org.  I could add a try/catch but I'm wondering if this is a glimpse into bigger problems with the dom class?  Any thoughts?

for (dom.Xmlnode x:parent.getChildElements()) {
      	   
   if (x.getText() == 'shipping_address') {system.debug('*****found shipping*****'); foundShipping = true;}

}

//x.getText() throws a System.NullPointerException in Winter'12 but not in Summer'11

 

  • September 20, 2011
  • Like
  • 0

I have several fields on my Case object that I want to auto populate depending on certain conditions.  For the most part, I have my trigger set up to do what I want.  The issue I am running into is at the end of the trigger.  The field (c.Task_Steps__c) is a text field with the ability to have 255 characters.  Currently, how my trigger is written, it populates the text field with a horizontal list like such:

1. Review Quote  2. Approve / Reject Quote  3. Complete task in Salesforce

However, I want to populate this field with vertical list values so that it looks like the following:

  1. Review Quote
  2. Approve / Reject Quote
  3. Complete task in Salesforce

Is this even possible?  I am new to writing Apex and Triggers so any information / code modification would be greatly appreciated :)!

Code:

trigger SEApproveRejectQuote_assignment on Case (Before update)
{for (Case c: Trigger.new)
{if(c.Reason=='Approve / Reject Quote' && c.Status=='New')
{
c.Origin='End User Request';
c.Type='SE Task';
c.Subject='Approve / Reject Quote';
c.Description='Quote approval is needed';
c.Task_Steps__c='1. Review Quote  2. Approve / Reject Quote  3. Complete task in Salesforce';
             }}}

 

I'm new to SF and have been successful in some areas and not in others. Hopefully this makes sense and I've used the right terms.

I've been reading about the need to write apex code when you want to update fields between 2 objects when one is standard and one is custom. I have the need to upcate the parent (Account) email (custom field) with the values from the child (contact) when the child is updated. These are both standard objects, so I'm hoping apex isn't required. I haven't had too much success with that (yet).

I've created a lookup between the 2 objects, thereby linking them. There may be many contact records associated with the account record, but only one contact record is set as "head of household". When that record changes the email address (eventually the street address, phone number and other fields will also apply), should transfer to the account's email field.

I attempted to do this using workflow and update field logic, but I was only able to get the update to work when I updated the parent record. I tried to flip it around, puting the flow on the contact record, but I was unable to get the account fields to show as available fields for the update.




I have a custom object 'Plan'.I am trying to share it  with all the community users(which contains users with different profiles) through apex code(Plan_share object)
 BUT facing an exception as:

System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, field integrity exception: unknown (invalid user or group: 005U0000002hje3): [unknown]

whereas If I go the same Id i.e;005U0000002hje3 in my org ,there exist a valid community user with this id.

Can anybody suggest what I am missing here??

Hello guys,

 

I need a little help.

 

I have a bug that goes like this: when the user edits an input field in an apex:repeat, and keeping the focus on the input goes with the mouse and clicks directly the Save button, only 1 ajax call is sent to the server, the one for the actionsupport of the inputField. Shouldn't 2 POSTs be made? one for the actionsupport that rerender a part of the table, and one for the {!save} action?

 

VF:

<apex:form>
	...
	<apex:commandButton action="{!save}" value="Save" rerender="existingProductsBlock,summaryTable,newProductsBlock" status="status" />
	...
	<apex:pageBlock>
		<apex:repeat value="{!fwrapper.wrapperList}" var="wrapper" >
			...
			<apex:outputPanel id="quantity" rendered="{!wrapper.isSelected}">
	   			<apex:actionRegion >
	                <apex:inputText value="{!wrapper.quantity}" style="width:30px;" onkeyup="return validate_qty(this);" >                                                                                                  
	                	<apex:actionSupport event="onchange"   reRender="existingProductsBlock" status="status"/>
	                </apex:inputText>
	            </apex:actionRegion>
	        </apex:outputPanel>
	        <apex:outputPanel id="quantity2" rendered="{!NOT(wrapper.isSelected)}">
	       		<apex:outputText value="{!wrapper.quantity}" style="width:30px;"  />
	        </apex:outputPanel>
	        ...

 The actionsupport is needed to rerender the list. This is because some fields influence the values of others, for example modifying quantity needs to modify the year1 values. 

public Decimal quantity							{
    		get; 
    		set {
    			if (quantity == value) {
    				return;
    			}
    			quantity = value;
    			if (quantity == null) {
    				quantity = 0;
    			}
    			if (listPrice == null) {
    				listPrice = 0;
    			}
    			if (discount == null) {
    				discount = 0;
    			}
    			year1 = listPrice*quantity*(100-discount)/100;
    			year2 = year1;
    			year3 = year1;
    			year4 = year1;
    			year5 = year1;
    			year6 = year1;	
    		}
    	}

 

So, in the page, when the user modifies a value, AND doesn't click anywhere else on the page, as in the cursor doesn't leave the input, BUT he goes directly to the save button, only the setting of that field occurs. The user needs to click again the save for it to occur...

 

Also, since the list of records is pretty large, or the instance is slow, idk, the setters are kinda slow. Setting a value, and waiting for the dependent fields to be modified in the controller takes some time. Is there some way to move this dependency logic in the client(javascript maybe?) so that the controller is not called on every input change?

 

Thank you,

Adrian

 

I could be missing something here, but Salesforce Touch has always been, and is still, advertised to work with "any device", "anywhere".  I understand a phased rollout and what not, so it makes sense that it is only available for iPad 2 and 3 in the initial release.  But, there is no mention of when it will be available for any other device.  I'm specifically interested in Android 4.0 on an Acer tablet, but I can't find "any" information "anywhere" about it.  I just go to the site every so often (it's been a long time now) and all I've ever seen is "coming soon".  But then I came to know that it's already available for iPad 2 and 3 running 5.0 or higher.

Hey guys,

I am like two weeks into visualforce development and am stuck. I have a page with a datatable. one of the columns is basically a link to another popup page which returns selected value from a list. Basically this replicates visualforce lookup for opportunities but with a filter on accountid and an added functionality to create new opportunity if none exists.

 

The problem: everything works well in firefox. The Save option does nothing in IE9. Clicking it like ten times return the error basically saying that all fields are null and so the insert fails. I have set the IE security/privacy configurations as suggested in the online help. I have also tried emulating IE8.

 

The page:

 

<apex:page controller="LookupPopupController" sidebar="false" showheader="false">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
<script language="javascript">
   var btnGo = document.getElementById("{!$Component.form.block.section.btnGo}");
   window.onload = new function() 
   { 
      window.focus(); 
      var ele=document.getElementById('{!$Component.form.block.section.query}');
      if (ele)
      {
         ele.focus();
      }
   }
   
   function fillIn(name, id)
   {
      var winMain=window.opener;
      if (null==winMain)
      {
         winMain=window.parent.opener;
      }
      var ele=winMain.document.getElementById('{!$CurrentPage.parameters.namefield}');
      ele.value=name;
      ele=winMain.document.getElementById('{!$CurrentPage.parameters.idfield}');
      ele.value=id;
      CloseWindow();
   }

   function CloseWindow()
   {
      var winMain=window.opener;
      if (null==winMain)
      {
         winMain=window.parent.opener;
      }
      winMain.closeLookupPopup();
   }
</script>

  <apex:messages />
  <apex:form id="form" >  

     <div style="width 100%">
        <apex:pageBlock title="Lookup" id="block">

          <apex:pageBlockSection id="section">
              Filter by Opportunity Name<br/>
              <apex:inputText value="{!query}" id="query"/> 
              <apex:commandButton id="btnGo" value="Search" action="{!runQuery}"/>
          </apex:pageBlockSection>

          <apex:pageBlockSection columns="1">
              <apex:pageBlockTable value="{!Opportunitys}" var="opvar">
                <apex:column headerValue="Name">
                  <apex:outputLink value="#" onclick="fillIn('{!opvar.Name}', '{!opvar.id}')">{!opvar.Name}</apex:outputLink>       
                </apex:column>
                <apex:column headerValue="Quote" value="{!opvar.Quote_Number__c}"/>
                <apex:column headerValue="Amount" value="{!opvar.amount}"/>
                <apex:column headerValue="Probability" value="{!opvar.probability}"/>
              </apex:pageBlockTable>    
          </apex:pageBlockSection>
        </apex:pageBlock>

        <apex:commandlink value="Create New Opportunity..." action="{!toggleContent}" rerender="opportunitypanel"></apex:commandlink>     

        <apex:outputpanel id="opportunitypanel">
        <apex:actionStatus startText="requesting..." stopText="" id="myStatus" />
        <style type="text/css">  
                .toggleContent {display:{!if(showContent,"block","none")};}  
        </style> 
        <div class="toggleContent"> 
        <apex:pageBlock title="New Opportunity">
          <apex:pageBlockSection collapsible="true">
                <apex:inputField value="{!ops.Name}" required="false"/>
                <apex:outputField value="{!ops.AccountId}" />
                <apex:inputField value="{!ops.CloseDate}" required="false"/>
                <apex:inputField value="{!ops.ForecastcategoryName}" required="false"/>
                <apex:inputField value="{!ops.StageName}" required="false"/>
            </apex:pageBlockSection>
          <apex:pageBlockButtons >
            <apex:commandButton value="Save" action="{!save}" oncomplete="fillIn('{!ops.Name}', '{!ops.Id}')" rerender="error"/>
          </apex:pageBlockButtons>
          </apex:pageBlock>
          </div>
          </apex:outputpanel>   
         </div>
         <div>
             <apex:commandbutton value="Close" onclick="CloseWindow();">  
             </apex:commandbutton> 
         </div>

   </apex:form>
</apex:page>

It is the  <apex:commandButton value="Save" action="{!save}" oncomplete="fillIn('{!ops.Name}', '{!ops.Id}')" rerender="error"/>  code that is unresponsive in IE9.

 

and here's the apex class:

public with sharing class LookupPopupController
{
    public String query {get; set;}
    public String AccId {get; set;}
    public List<Opportunity> Opportunitys {get; set;}
    public Opportunity ops {get; set;}    
    public Boolean showContent { get; set; }  

    public PageReference toggleContent() {  
        if(showContent){  
            showContent = false;  
        }  
        else{  
            showContent = true;  
        }  
        return null;  
    }  
    public PageReference runQuery()
    {
        String query1;
        if (query == null){
           Opportunitys=[select id, name, quote_number__c, amount, probability from Opportunity where AccountId = :AccId];
           }
        else{
           query1 = '%'+query+'%';
           Opportunitys=[select id, name, quote_number__c, amount, probability from Opportunity where AccountId = :AccId and name like :query1];
           }
        return null;
    }
    public LookupPopupController(){
        showContent = false;  
        AccId=System.currentPagereference().getParameters().get('AccId');
        runQuery();
        ops = new Opportunity();
        ops.AccountId = AccId;
    }
    public PageReference save(){
        insert ops;
        return null;
    }
}

 

Thanks in advance for any help..

  • September 13, 2012
  • Like
  • 0

I am working on an integration that pushes data to Salesforce using XML as the format.  However, one of the values is serialized and I'm having the hardest time parsing it.  It is getting serialized on the other end using the PHP Serialize function.  Is there anything out there that I can use in Apex that can help deserialize this value?  Even if I have to do a callout with the value to get deserialized data back, I'd be happy with that.  Thanks,

 

~geosow

 

PS - this is an integration with Magento.

  • August 24, 2012
  • Like
  • 0

I've been working in an org for almost 2 years.  They just installed a managed package; it's a large 100% native accounting application (I didn't want to put the name in this thread just yet).

 

Everything has been speedy.  However, after the installation, I've noticed that it now takes over 2 minutes to save triggers, classes and visualforce pages via Eclipse.  I have clients on the same CS12 instance and the performance is fine.  Has anyone experience a significant performance decrease in the ID after installing "FF" ?

 

All I'm doing is a save/build.  No unit tests or anything.  Just a save of small modifications to triggers and stuff.  

 

To troubleshoot, I re-created my project in Eclipse and it took over 15 minutes just to get the listing of items that I wanted to add to my project.  Any ideas?  Thanks,

 

George Sowards

www.RedPointSolutions.com

  • August 17, 2012
  • Like
  • 0

I'm a newbie and I'm stumped.  

 

When I run Apex Test Runner in Eclipse, it shows Average test coverage across all Apex Classes and Triggers is 41%.  

   (I read on a different post that if you clear the test history in Eclipse and run again, it will correct.  That didn't work in my case.  It still says 41%)

 

When I run overall code coverage in my developer account of SFDC, it says I'm at 77%.  

 

When I try to deploy from Elipse to my production server, it says Average test coverage across all Apex Classes and Triggers is 71%. 

 

Which one is right?  How can I deploy my project to my production server??

I'm working with a Visualforce page that has anchors in it.  It's doing inputFile "stuff" and this requires a page refresh.  So I force the page refresh with an anchor in the pageReference like this:

 

PageReference refreshPage = new PageReference('/apex/thePage?id=' + o.Id);    	    
refreshPage.setAnchor(tabNumber);
refreshPage.setRedirect(true);
return refreshPage ;  

 

The code above works like a charm and allows me to go back to a jQuery tab on refresh of the page.  My new URL after refresh is this: https://c.cs0.visual.force.com/apex/thePage?id=006T0000008O8mVIAS#tabs-1

 

The problem I'm having is with this code:

 

PageReference newPage;
newPage = new PageReference('/apex/anotherPage?id=' + o.Id);
newPage.setRedirect(true);
return newPage;

 

With the above code I get this URL:  https://c.cs0.visual.force.com/apex/anotherPage?id=006T0000008O8mVIAS%23tabs-1

 

And I get this error:  "Id value 006T0000008O8mVIAS#tabs-1 is not valid for the Opportunity standard controller" 

 

I've tried to set the anchor to null and blank.  A debug on getAnchor shows nothing before the redirect.  For starters, I don't see why the standard controller isn't parsing out the %23 as an anchor.  And finally I don't see how the anchor is getting passed to the next page in the first case.  Any ideas?

 

I've solved this with what I would consider a hack.  I'll post it in a bit but wanted to see if anyone had some ideas.  Thanks,

 

George

 

  • February 08, 2012
  • Like
  • 0

I recently upgraded my Force.com IDE (and all projects) to the Winter '12 release. Since upgrading, I've been observing that when I attempt to run unit tests against an Apex class, it often takes a very long time to execute. Even relatively simple tests sometimes take a minute or two to complete. The time doesn't seem to be spent during test execution, but rather during the "preparing results..." phase (based on the progress indicator in the IDE). Reducing the log level doesn't seem to have any impact one way or the other. I've also seen it simply get stuck in the "preparing results..." phase to the point where I had to kill the Eclipse process. Anyone else seeing this?

  • January 04, 2012
  • Like
  • 0

Hi, when i create a package then i didn't see approval processes item in the add drop down list. Is it possible to add Approval process into Package?

  • March 22, 2011
  • Like
  • 0