• Suri
  • NEWBIE
  • 130 Points
  • Member since 2009

  • Chatter
    Feed
  • 3
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 15
    Questions
  • 40
    Replies
Hello,

I am having an issue using the StandardSetController in a VF page for displaying the records from different List Views on Accounts, especially with the setFilderID(String) method.

What my Page does:
It basically just shows all the available List Views on Accounts using the StandardSetController.getListViewOptions() method.

Then the User selects the desired view, it simply sets the StandardSetController.setFilterID() to the selected View ID.

This seems to work fine in most cases, but here is the problem sometimes.

Problem:

For example let's say my List View is "X" with Criteria: Name startsWith Test
- When the StandardSetController.setFilterID() is set to this view, it ALWAYS displays ALL Accounts in the System. The List View filter criteria does not seem to be respected.

HOWEVER, if I just change the SAME List View "X" Criteria to: Name startsWith Sample, the StandardSetController.setFilterID() works perfectly fine.
- and shows me the correct accounts with Names starting with "Sample..."

My conclusion:
The setFilterID() seems to fail in certain cases depending on the VALUE entered in the View Filter (not necessarily on the Field).

Does ANYONE have ANY idea how to solve this?

I tried logging a Case to salesforce already but no viable solution from them yet.

Thanks,

Suri

Hi All,

 

I have created a trigger on account, when mergae two accounts then lossing account owner will be the part of account team. I have tested this trigger on sandbox and everythng is working fine.

 

Now i am deploying this trigger on production then it is showing error "Entity is not org-accessible". Please help me.

 

Trigger Code is:

============================================================

trigger AccountMerge on Account (after delete) {
TriggerEnabled__c myCS = TriggerEnabled__c.getValues('AccountMerge');
if(myCS==Null || (myCS.Object_Name__c=='Account' && myCS.Active__c==True)){
List<AccountTeamMember> lstAccountTeam = New List<AccountTeamMember>();
List<AccountShare> acctSharingRules = new List<AccountShare>();
Map<id, Account> mapAccount= New Map<Id, Account>();
Map<string,AccountTeamMember> mapAccountTeam = New Map<string,AccountTeamMember>();
List<Id> lstAccountID= new List<Id>();

for(Account objAccount: trigger.old)
if(objAccount.MasterRecordId!=Null)
lstAccountId.add(objAccount.MasterRecordId);

for(Account objAccount: [Select id, Ownerid, Name from Account where id =:lstAccountId])
mapAccount.put(objAccount.Id, objAccount);

for(Account objAccount: trigger.old)
{
if(objAccount.MasterRecordId!=Null && mapAccount.get(objAccount.MasterRecordId).OwnerId!=objAccount.OwnerId){

string strTemp= objAccount.MasterRecordId + '-' + objAccount.Ownerid;
if(!mapAccountTeam.containsKey(strTemp)){
AccountTeamMember objAccountTeam = new AccountTeamMember();
objAccountTeam.AccountId = objAccount.MasterRecordId;
objAccountTeam.TeamMemberRole = 'Sales Rep';
objAccountTeam.UserId = objAccount.ownerid;
lstAccountTeam.add(objAccountTeam);
mapAccountTeam.put(objAccount.MasterRecordId + '-' + objAccount.ownerid,objAccountTeam );

AccountShare processorSharingRule = new AccountShare();
processorSharingRule.AccountId = objAccount.MasterRecordId;
processorSharingRule.OpportunityAccessLevel = 'Edit';
processorSharingRule.CaseAccessLevel = 'Edit';
processorSharingRule.AccountAccessLevel = 'Edit';
processorSharingRule.UserOrGroupId = objAccount.ownerid;
acctSharingRules.add(processorSharingRule);
}
}
}
system.debug('Account Team---->' + lstAccountTeam);
//system.debug('acctSharingRules------>' + acctSharingRules);
try {
if(lstAccountTeam.size()>0)
insert lstAccountTeam;
if(acctSharingRules.size()>0)
insert acctSharingRules;
}
catch (System.DmlException e){
}
}
}

====================================================================

 

 

In the User's Guide there is a sample http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_test.htm?CSHID=apex_methods_system_test.htm#TestLoadDataExampleSection

of how to use the Test.loadData method to load a csv file with Accounts.

 

I cannot see any documentation nor samples showing how to load records with references (lookup or master-detail) to parent records - e.g. if I want to load Contacts, which refer to Accounts.

 

Anyone who knows. I suppose I am not going to "invent" record IDs????

Hello,

I have a Visualforce Component that just contains a button, and performs an Apex Controller action, and reRenders a part of the Component.

VF Component:

<apex:form id="formId">

String reRendered oncomplete: {!reRenderedTextValue}

<apex:commandButton value="ClickButton" action="{!someAction}" reRender="formId" />

</apex:form>

 

This Component works absolute fine when I include it in a VF page in a static way like: <c:MyComponent />

The value of the text in the reRendered postion is refreshed.

But when I include the component using an apex:dynamicComponent like this:

Controller:


public Component.Apex.OutputPanel getDynamicPanel() 
{
Component.Apex.OutputPanel op = new Component.Apex.OutputPanel ();
Component.Apex.PageBlock pBlock = new Component.Apex.PageBlock();
pBlock.childComponents.add(new Component.MyComponent());
op.childComponents.add(pb);
return op;
}

 


In the VF Page:


<apex:dynamicComponent componentValue="{!DynamicPanel}"/>

In this VF Page, when I click the Button, the 'reRender' in the MyComponent does not work at all.

Could any1 help me here?

Thanks,

Suri

Hi, I am constructing a HTML in a string, and converting it to PDF using the Blob.toPdf() method.

 

I was getting the following error:

 

FATAL_ERROR|System.InvalidParameterValueException: An error occurred while parsing the input string.

 

I checked it line by line, and I realize that this particular line causes this error. I am referencing a Static Resource in an Image tag, and this is causing the error.

 

Can anybody tell me why? and how to resolve this?

 

String htmlBody = '<img src="/resource/1347290849000/myCompany_Logo" />';

Blob.toPdf(htmlBody);

Hello everybody,

 

while trying to render a page as .pdf, I tried to use font-family: Arial Unicode MS with font-weight: bold.

That did not work. So I did first things first: google told me that it is simply not possible to do that.

 

Ofcourse I also used SF.com documentation and found this:

 

http://www.salesforce.com/us/developer/docs/pages/Content/pages_quick_start_renderas_pdf.htm

 

So, Arial Unicode MS with font-weight: bold is used right in the doc. So what am I doing wrong, it is absolutely not working for me.

 

body {
            font-family:Arial Unicode MS;
            font-weight:bold;    
     }   

// First way I tried it 

body {
            font-family:Arial Unicode MS;  
     }                   
            
div.content {
            font-weight:bold;    
     }   

// Second way I tried

 

Hello,

 

I am getting an exception while making an apex callout to a 3rd party web service from apex stub classes - System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element : <element name>

 

I can see the request as well as response in the developer org, but after getting the response, SFDC might throwing an exception while parsing.

 

Please suggest if anyone has ever encountered this error.

 

Regards,

Hi all,
 
Any thoughts on why this happens?
 
Basically, I have a user Object defined in my Controller, and there are 2 input Fields on my VF page.
 
The inputFields are: User.UserRoleId and User.ProfileId
 
When the Role Lookup is selected, and if ANY action happens on the page, the Role simply disappears i.e., becomes null.
 
Any clue why? Or is it a bug in salesforce.com?

 
Please have a look at the code below. Paste this, and just select a Role and hit the "Test" button.
 
VF Page Markup:

======================= VF PAGE MARK UP ==============================
<apex:page controller="TempRolePageController">
<apex:form >
    
    <apex:pageBlock >
        
        <apex:pageBlockButtons >
            <apex:commandButton value="Test" action="{!testButton}" />
        </apex:pageBlockButtons>
        
        <apex:pageBlockSection >
        
            <apex:inputField value="{!userObj.UserRoleId}" required="false" />
            
            <apex:inputField value="{!userObj.ProfileId}" required="false" />
        
        </apex:pageBlockSection>
        
    </apex:pageBlock>
    
    SELECTED ROLE ID: {!userObj.UserRoleId} <br/><br/>
    SELECTED PROFILE ID: {!userObj.ProfileId}
</apex:form>
</apex:page>

=====================================================================
 
Apex Class:
 
==================== CONTROLLER =====================================
 
public class TempRolePageController {

    

    public User userObj { get; set; }

    

    public TempRolePageController()

    {

        userObj = new User();

    }

    

    //Test button

    public pageReference testButton()

    {

        return null;

    }

    



}

=======================================================================

Hi

 

I have a page where I have used the "connection.js" to Login into a Salesforce instance.

 

But I am receiving errors when I try to do this.

 

When I host it from a Local Server or on a Salesforce Sites page, I get the error:

 

[Exception... "Access to restricted URI denied"  code: "1012" nsresult: "0x805303f4 (NS_ERROR_DOM_BAD_URI)"  location: "https://na6.salesforce.com/soap/ajax/16.0/connection.js Line: 594"]

 

Can anyone tell me why this error occurs? And what should be done for successful Login?

 

I have provided my code below. Its a simple JS code that calls the Login method.

 

 

================ CODE ==============================

 

<HTML>
<HEAD>

<script src="https://na6.salesforce.com/soap/ajax/16.0/connection.js" ></script>

<script type="text/javascript" >

function logincall()
{

    try{
   
    sforce.connection.serverUrl = 'http://www.salesforce.com';
   
    var usrname = document.getElementById('userid').value;
    var passwrd = document.getElementById('passid').value;

    if(usrname == null || usrname == '' || passwrd == null || passwrd == '')
    {
        alert('Please enter Username AND Password');
        return;
    }
   
    var result = sforce.connection.login(usrname, passwrd);

    alert("Logged in with session id " + result.sessionId);
    }
    catch(error)
    {
        alert(error);
       
    }

}

</script>

</HEAD>

<BODY>


To test logging into a Salesforce Instance using the connection.js "login" call


<table>
        <tr>
            <td>Username</td>
            <td><input type="text" id="userid" value="" /></td>
        </tr>
        <tr>
            <td>Password</td>
            <td><input type="password" id="passid" value="" /></td>
        </tr>

</table>


    <input type="button" value="Login" onclick="logincall();" />

</BODY>

</HTML>

 

================ CODE ==============================

Hi

 

I have a problem using the Flex Toolkit for salesforce.  I would greatly appreciate if anyone patiently reads this and helps me out.

 

The following are the steps I followed:

 

1. Created a flex project in Flex Builder 3

2. Dropped in the salesforce.mxml file as a startup application

3. Included the as3Salesforce.swc in the library path

4. Entered my own developer username and password into this (salesforce.mxml) file

5. Set the Setup --> Administration Setup --> Security Controls --> Session Settings --> 'Require secure connections (HTTPS)' Checkbox to FALSE

6. Built the project and ran the application salesforce.mxml


Now this works perfectly fine if I run this from my Flex Builder, and I have no issues.

 

Then, what I did was, I exported this as a ".swf" file and uploaded it as a Static Resource in another developer org. of mine. I then embedded this onto a VF Page.

 

Now, when I access this VF Page, the "login" operation works perfectly fine (logging into my 1st developer org) and I get the following text in the "ta.text" Textarea:

 

Login successful:
(com.salesforce.results::LoginResult)#0
  context = (null)
  passwordExpired = false
  serverUrl = "https://na7-api.salesforce.com/services/Soap/u/9.0/...............

 

 

Here is my issue. When I try to do any other operation after this, like "describeSObjects" / "describe all" and so on, I receive this error:

 

fault from operation: (mx.rpc::Fault)#0
  content = (null)
  errorID = 0
  faultCode = "Channel.Security.Error"
  faultDetail = "Destination: DefaultHTTP"
  faultString = "Security error accessing url"
  message = "faultCode:Channel.Security.Error faultString:'Security error accessing url' faultDetail:'Destination: DefaultHTTP'"
  name = "Error"
  rootCause = (flash.events::SecurityErrorEvent)#1
    bubbles = false
    cancelable = false
    currentTarget = (flash.net::URLLoader)#2
      bytesLoaded = 0
      bytesTotal = 0
      data = (null)
      dataFormat = "text"
    eventPhase = 2
    target = (flash.net::URLLoader)#2
    text = "Error #2170: Security sandbox violation: http:<my developer org 2 VF Page URL> cannot send HTTP headers to https://na7-api.salesforce.com/services/Soap/u/9.0/<dev org 1 ID>."
    type = "securityError"

 

 

 Could anyone tell me why exactly this happens and what is the Solution?

 

 I checked out the community Posts:

 

 

  • http://community.salesforce.com/sforce/board/message?board.id=ajax_toolkit&message.id=2741
  • http://community.salesforce.com/sforce/board/message?board.id=general_development&message.id=11600

 

 

and tried them out, but doesn't seem to work.

 

 

I would greatly appreciate any help on this issue.

 

Thank You.

Message Edited by Suri on 10-09-2009 06:20 PM
Message Edited by Suri on 10-14-2009 04:39 PM

Hi,

Is there a way to disable the Edit buttoni n the Enhanced list view? Thank you much.

 

Paul

 

Hi

 

I have created a visualforce page with contentType="application/vnd.ms-powerpoint".

 

I want to know how to provide a "slide-break" (not sure if that's the right term to be used) in order to specify the content in different number of slides.

 

Because right now, irrespective of the size of the visualforce page, the entire page content falls into just a single slide.

 

I would appreciate any help on this issue.

 

Thanks,

 

Suri