• Dharshni
  • NEWBIE
  • 50 Points
  • Member since 2011

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 10
    Replies

Hi friends,

 

i designed one application in that insted of multipicklist i used <apex:selectlist> tag to capture the information (for clientside view). i created one validation rule for that picklist using apex code.when validation occure it shows on the top of the page (apex:pagemessage). Is there any way to show at field level when validation occure. 

 

Hi,

 

I am developing a side bar, HTML home page component, where I have to query user records.

 

Here is my code :

 

<script scr="../../soap/ajax/26.0/connection.js" type="text/javascript">
</script>
<script>
function showUsers(){ result = sforce.connection.query("Select Name, Id from User limit 1"); records = result.getArray("records"); for (var i=0; i< records.length; i++) { var record = records[i]; console.log(record.Name + " -- " + record.Id); } }
</script> <input type="button" value="Click Me" onclick="showUsers();">

 

I am getting the following error when I click the button.

 

Uncaught {faultcode:'sf:INVALID_SESSION_ID', faultstring:'INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session', detail:{UnexpectedErrorFault:{exceptionCode:'INVALID_SESSION_ID', exceptionMessage:'Invalid Session ID found in SessionHeader: Illegal Session', }, }, }

 

I am trying the above code in a sandbox. To my wonder, the same code works in another development instance.

 

Could anyone explain what is the reason and a fix for this? 

 

Thanks in advance.

Hi, 

 

Is there any method in Apex to retrieve org-specific details like Default Time Zone, Coroporate Currency.,etc. I need to know the Default Time Zone, in order to schedule a class in sync with an external system. 

 

Thanks for your help.

I am using a rich-text area field in a VF page, in <inputField> tag. The space characters entered in this editor is displayed as normal ' ' character in the backend. But when I do some manipulation, for eg., replace all space with some other character, some of the space characters wouldn't change. 

 

When I used a HEX editor and encoding methods, I see that some space characters are actually present as a special character - exactly 'Å'.

 

These characters are causing troubles when I send this richtext field to a webservice,through XML. I am enclosing the data in CDATA tag, but the problem is caused by the special encoding.

 

Could you please let me know how I can replace these special space characters to normal spaces?

 

Many thanks. 

I have a page which sends emails. I have set  'Would you like to automatically BCC emails to your return address?'  to 'YES'  under 'Personal Setup->Email->My Email Settings'. But the emails sent through apex code are not sent as BCC to my return address?

 

Is there any method to access this setting of an user through apex code? 


Also would like to know methods to get the Email Signature field of user through code. 

 

Thanks. 

 

 

Hi,

 

I have a VF page which has a inputTextArea which is richText. When I click a command button which has onclick, action and oncomplete, I have a problem in binding the value to the controller. The page works well in sandbox, but when moved to production, the binding doesn't happen. I am not able to get the richText's latest value in the controller. When the page is refreshed, the next time I click the button, I get the old value. So I can tell this must be a binding issue.

 

Strange since the same code works in sandbox, but not in production. I have given getter setter methods for the string used in the page. But still the problem persists. 

 

One more thing is, if the inputTextArea is normal, removing the 'richText=true' part, the code works properly in production also. 

I have checked the version settings and they are same in production and sandbox.

 

Can you please let me know how to resolve binding issues for richText inputs? 

(or)

Is there any other setting that could be missed here between production and sandbox? 

 

Thanks.

 

 

I am trying to use a same VF component more than once in a VF page. I can see that the last used component alone works fine and the others give no response. 

 

Could anyone please tell if there is a problem in using the same component twice? 

 

Below are the generic code with standard objects for your convenience:

 

Component :

 <apex:component controller="ContactEmailController">

<apex:actionFunction action="{!dispFunc}" name="callFunc"/>
<apex:inputField value="{!opp.accountId}" onchange="callFunc();"/>
{!accnt.Name}
</apex:component>

 

Component Controller :

public class ContactEmailController {


public Account accnt{get;set;}
public Opportunity opp{get;set;}

public PageReference dispFunc(){
if(opp.AccountId!=null)
accnt = [select id, name from Account where id=:opp.AccountId];
return null;
}

public ContactEmailController(){
accnt = new Account();
opp = new Opportunity();
}
}

 

Page using the component :

<apex:page >
<apex:form >
<c:ContactEmail />
</apex:form>
<apex:form >
<c:ContactEmail />
</apex:form>
</apex:page>

 

I am trying to get this working for a long time now. Please help.

Thanks in advance. 

 

I am trying to prepopulate values in a standard page using field-IDs. I have hard-coded the field-ID. I am not sure - if when I move the code to other orgs/package it, will the field-ID work? Is there anyway I can get the field-ID dynamically?

 

The link which I use currently is : 

 

onclick="window.parent.location.href='/a0U/e?CFxxxxxxxxxxxxxxx={!account.Name}&CFxxxxxxxxxxxxxxx_lkid={!account.Id}&retURL={!account.Id}'"

 

Any ideas on this would be really helpful.

 

Thanks.

 

 

Hi

 

Can a custom button created for an object used in a Visualforce page? I have a custom list button on my object. I want to use this button in a visualforce page that I build. 

 

I have currently copied the javascript in the vf page and its working. But is there anyway to use the custom button directly?

 

Thanks.

Hello All,

 

      public pagereference Save()
   {
          widgetpro = new C_P_Widgets__c();      
             for(integer i=0; i<selectlayout.size(); i++)  {  
               widgetpro.Widget_Category__c = Name1;
                widgetpro.Name =  Username ;
                   
                if(val != null)   {
                         val = val+  '<widget Image="' + selectlayout[i].Image1 + '" FieldLabel="' + selectlayout[i].label1 + '" result="' + selectlayout[i].result + '"/></widget>' ;    
                 }
                else {
                        val = '<widget Image="' + selectlayout[i].Image1 + '" FieldLabel="' + selectlayout[i].label1 + '" result="' + selectlayout[i].result + '"/></widget>' ;               
                     }
                  widgetpro.Displayed_Values__c = val;                       
           }                
              
           insert widgetpro;
           
             wid = widgetpro.id;  
         
         PageReference page =  new PageReference('/apex/widgetpageview?id='+wid);
           page.setRedirect(true);   
            return page;
  }

 

Here I'm saving the values and redirecting it to second vfpage and my vf page and controller class is

 

 <apex:pageblockSection title="Widget Details" collapsible="false" columns="1">
         <apex:pageblocktable value="{!widdata}" var="w">
       {!w.Name}    
           <apex:column value="{!w.Name}" headerValue="Widget Name"/>
           <apex:column value="{!w.Widget_Category__c}" headerValue="Category"/>
           <apex:column value="{!w.Displayed_Values__c}" headerValue="Result"/>
         </apex:pageblocktable>
       </apex:pageblockSection>

 

public class widgetpageview1 {
public string wid{set;get;}
 public widgetpageview1()
 {
 wid=apexpages.currentpage().getparameters().get('id');
 system.debug('!!!!!'+wid);
 
 }
  public list<C_P_Widgets__c>  widdata{set;get;}
           public list<C_P_Widgets__c> getwiddata()
           {         

              widdata = new  list<C_P_Widgets__c>();
           for(C_P_Widgets__c allwids : [select id, name, Displayed_Values__c, Widget_Category__c from C_P_Widgets__c where id=:wid limit 1])
           {           
           
           widdata.add(allwids);
            
           }
            system.debug('alllll' +widdata);
           return widdata;
            
           }
}

 

My problem is I can't see the saved values in this page.....Don't know why?please help

 

 

I am using a rich-text area field in a VF page, in <inputField> tag. The space characters entered in this editor is displayed as normal ' ' character in the backend. But when I do some manipulation, for eg., replace all space with some other character, some of the space characters wouldn't change. 

 

When I used a HEX editor and encoding methods, I see that some space characters are actually present as a special character - exactly 'Å'.

 

These characters are causing troubles when I send this richtext field to a webservice,through XML. I am enclosing the data in CDATA tag, but the problem is caused by the special encoding.

 

Could you please let me know how I can replace these special space characters to normal spaces?

 

Many thanks. 

I have a page which sends emails. I have set  'Would you like to automatically BCC emails to your return address?'  to 'YES'  under 'Personal Setup->Email->My Email Settings'. But the emails sent through apex code are not sent as BCC to my return address?

 

Is there any method to access this setting of an user through apex code? 


Also would like to know methods to get the Email Signature field of user through code. 

 

Thanks. 

 

 

I am trying to use a same VF component more than once in a VF page. I can see that the last used component alone works fine and the others give no response. 

 

Could anyone please tell if there is a problem in using the same component twice? 

 

Below are the generic code with standard objects for your convenience:

 

Component :

 <apex:component controller="ContactEmailController">

<apex:actionFunction action="{!dispFunc}" name="callFunc"/>
<apex:inputField value="{!opp.accountId}" onchange="callFunc();"/>
{!accnt.Name}
</apex:component>

 

Component Controller :

public class ContactEmailController {


public Account accnt{get;set;}
public Opportunity opp{get;set;}

public PageReference dispFunc(){
if(opp.AccountId!=null)
accnt = [select id, name from Account where id=:opp.AccountId];
return null;
}

public ContactEmailController(){
accnt = new Account();
opp = new Opportunity();
}
}

 

Page using the component :

<apex:page >
<apex:form >
<c:ContactEmail />
</apex:form>
<apex:form >
<c:ContactEmail />
</apex:form>
</apex:page>

 

I am trying to get this working for a long time now. Please help.

Thanks in advance. 

 

Hello everyone,

 

Im a total newbie to the Apex World but really keen on learning!

 

We're trying to build a code that would let us connect two fields under standard objects namely Account and Contact.

 

e.g. if "A" field (checkbox) under "Account" object is TRUE - "A" field (checkbox) under "Contact" object is also TRUE.

 

We're also trying to get the same work with the "date" field e.g. if I insert a date 5/5/2012 in "Test Date" field under "Account" object, the exact same date will appear under "Test Date" field under "Contact" object.

 

Why we want to do that? We'd like this to trigger certain workflows built on "Contact" object but want to do updated under "Account" object only.

 

Would someone be able to help me out?

 

Thanks you all

Piotr

Hi,

 

 Can someone help me to query some fields of Opportunity along with contact fields.

Opportunity has a field Account and there are contacts for this account. I want to retrieve some fields of opportunity and fields of contacts with the accountId .

 

Please help..

  • March 21, 2012
  • Like
  • 0

I am not sure if a cross object formula is the answer, but here is what I think I need.

In order to pull list of accounts that purchased specific products during a specified time period, I would like to create a formula field in Opportunities that lists every item code associated with that Opportunity from the line items (Opportunity Products). I do not know how to create a cross object formula, much less one that can list multiple values.

This would also allow us to use the Marketo app to pull email lists for those accounts.

Thanks in advance for any instructions, suggestions or questions. Eric

Hi friends,

 

i designed one application in that insted of multipicklist i used <apex:selectlist> tag to capture the information (for clientside view). i created one validation rule for that picklist using apex code.when validation occure it shows on the top of the page (apex:pagemessage). Is there any way to show at field level when validation occure. 

 

I am trying to write an SOQL query to get followed opportunities but I get strange errors each time.

 

For example the following works:

  SELECT ParentId FROM EntitySubscriptions WHERE ParentId IN

    (SELECT ID FROM Opportunitiy) LIMIT 1000

 

but it returns me ID's which I would then need to make additional calls to get the opportunities

 

If I try the reverse:

  SELECT Id, Name, CloseDate FROM Opportunity WHERE Id IN

    (SELECT ParentId FROM EntitySubscriptions LIMIT 1000)

 

then I get complaints when I include the limit (expected right parenthesis) or I get complaints for not including the LIMIT.

 

Any ideas what I am doing wrong?

 

Thanks, Bill

  • March 20, 2012
  • Like
  • 0