• modolea
  • NEWBIE
  • 30 Points
  • Member since 2007

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 8
    Replies
Hello everyone, I appreciate any help with this issue.

I will like to know if it's possible to assign a dynamic id to a panel inside a custom component. For example:

Code:
<apex:component>
<apex:attribute name="OPid" description="This is the id that will be assigned to the panel" type="String" required="true"/>
             
           <apex:outputPanel id="{!Opid}"></apex:outputPanel>

</apex:component>


If I do it this way, I get thrown an Illegal argument exception, is it possible to assign this value to the id property of the outpanel?
Thanks in advance.

Jonathan.
Hi
 
I try to create a wizard who allows the sfdc administrator to quickly create and edit a user (required fields only).  
Code:
        <apex:pageBlock tabStyle="user" mode="edit">
            <apex:pageBlockSection title="Locale Setting" columns="1">
                <apex:inputField value="{!Custom_obj__c.SalesforceUser__r.TimeZoneSidKey}"/>                    
                <apex:inputField value="{!Custom_obj__c.SalesforceUser__r.LocaleSidKey}"/>                    
                <apex:inputField value="{!Custom_obj__c.SalesforceUser__r.LanguageLocaleKey}"/>                    
                <apex:inputField value="{!Custom_obj__c.SalesforceUser__r.CurrencyIsoCode}" />                   
                <apex:inputField value="{!Custom_obj__c.SalesforceUser__r.EmailEncodingKey}"/>                    
            </apex:pageBlockSection>
...........

This code is used for both create and edit page according the master record (Custom_obj__c) is already created or not.
When the master record exists, the edit page is correctly displayed, but when I try to create a new one I get an error:
Visualforce Error
Currency ISO Code: invalid currency code: {0}

The same error occurs when I use
Code:
<apex:outputField value="{!Custom_obj__c.SalesforceUser__r.CurrencyIsoCode}" />

Please note that the page is properly displayed when I remove this field from the code.
Thanks for any help.
adrian


Message Edited by modolea on 08-11-2008 03:00 AM
Hi,
 
Since today, in one of our sandboxes (cs2), we have a problem with triggers that use UserInfo methods.
Unfortunately Basic support does not troubleshoot triggers or development issues.
 
Code:
// line 26:
customObj__c.User__c = UserInfo.getUserId(); // error also occurs when I use: // String name = UserInfo.getName();
ErrorError: Compile Error: Method does not exist or incorrect signature: UserInfo.getUserId() at line 26 column 46

 
Please note that this code worked well before.
Have you any idea?
 
Thanks
adrian


Message Edited by modolea on 08-08-2008 12:10 AM
Hi,
 
I try to make dinamicaly a custom component in order to display an outputLabel and an outputField from a single vf tag.
Here is the code I use in the custom component called 'detailField':
 
Code:
 <apex:component>
    <apex:attribute name="label" type="String" required="true" description=""/>
    <apex:attribute name="value" type="SObject" required="true" description=""/>
    <apex:attribute name="style" type="String" required="true" description=""/>
    
    <apex:outputLabel value="{!label}" styleClass="{!style}"/>
    <apex:outputField value="{!value}"/>
</apex:component>
 
I get an error when I save: Error: Could not resolve the entity from <apex:outputField> value binding '{!value}'. outputField can only be used with SObject fields.
 
Can someone provide me a solution?
 
Thanks
adrian
 
 
 

Hi I am using sforce.connection.login call from javascript in my VF page accessible from a Site that what is does is to log a user in Salesforce (the user exists in Salesforce and it is active), but I am getting the following error:

 

{faultcode:'UNKNOWN_EXCEPTION', faultstring:'UNKNOWN_EXCEPTION: Site under construction', }

 

here is my VF page:

 

<apex:page showheader="false" standardStylesheets="false"> <apex:includeScript value="/soap/ajax/17.0/connection.js"/> <apex:includeScript value="/soap/ajax/17.0/apex.js"/> <script type="text/javascript"> function approveCrf() { try{ sforce.connection.sessionId = '{!$Api.Session_ID}'; var username = document.getElementById('un'); var password = document.getElementById('pw'); var loginResult = sforce.connection.login(username.value, password.value); }catch(error) { if (error.faultcode.indexOf("INVALID_LOGIN") != -1) { alert("check your username and passwd, invalid login"); } else { alert(error); } } } </script> <form id="loginForm"> UserName: <input type="text" id="un" size="15" value=""/><br /> Password: <input type="password" id="pw" size="15" value=""/><br /> <p><input type="button" value="Login and Approve" onclick="approveCrf();"/></p> <apex:message styleClass="locationError" /> </form> </apex:page>

Any ideas?

Thanks

Message Edited by lopezc on 12-17-2009 07:25 AM
  • December 17, 2009
  • Like
  • 0
Hello everyone, I appreciate any help with this issue.

I will like to know if it's possible to assign a dynamic id to a panel inside a custom component. For example:

Code:
<apex:component>
<apex:attribute name="OPid" description="This is the id that will be assigned to the panel" type="String" required="true"/>
             
           <apex:outputPanel id="{!Opid}"></apex:outputPanel>

</apex:component>


If I do it this way, I get thrown an Illegal argument exception, is it possible to assign this value to the id property of the outpanel?
Thanks in advance.

Jonathan.
Hi,
 
Since today, in one of our sandboxes (cs2), we have a problem with triggers that use UserInfo methods.
Unfortunately Basic support does not troubleshoot triggers or development issues.
 
Code:
// line 26:
customObj__c.User__c = UserInfo.getUserId(); // error also occurs when I use: // String name = UserInfo.getName();
ErrorError: Compile Error: Method does not exist or incorrect signature: UserInfo.getUserId() at line 26 column 46

 
Please note that this code worked well before.
Have you any idea?
 
Thanks
adrian


Message Edited by modolea on 08-08-2008 12:10 AM
Hi I have the following:
Code:
trigger updateCM on Account_Membership__c (after update) 
{
  // first, we need to change the status of all case roles if the
  // CM status value has changes
  
  if (Trigger.isUpdate) 
  {
    for (Integer i = 0; i < Trigger.new.size();i++)
    
    {
      Account_Membership__c casenew = Trigger.new[i];
      Account_Membership__c caseold = Trigger.old[i];
      
      // we check to see if the status has changed
      if (casenew.Status__c != caseold.Status__c) 
      {
            for(Contact_Membership__c cr: [select Id, Account_Membership__c  from Contact_Membership__c where Account_Membership__c = :casenew.id ])
            
            {
                cr.Status__c = casenew.Status__c;
                cr.Type__c =  casenew.Type__c;
                cr.Joined__c  = casenew.Joined__c;
                cr.Expires__c = casenew.Expires__c;
                cr.OwnerId =  casenew.OwnerId;
                update cr;
            } 
           
      }          
      }
    } 
  }
I keep geting
Too many DML statements: 21: Trigger.updateCM: line 25, column 17

What should I do...

 

Hi
How can i write method for same working as {!$User.LastName} in visual force page.
 
I also found what are the method's for
 
1.{!$UserRole
2.{!$User
3.{!$System
4.{!$SControl
5.{!$Profile
6.{!$Organization
7.{!$ObjectType
8.{!$Api
9.{!$Action
 
These are used in s-controll.I wants what are the method which can be used in apex-code.
Or you can give link where i got
 
 
Thanks & Regards
Brijesh baser
Hi,
 
I try to make dinamicaly a custom component in order to display an outputLabel and an outputField from a single vf tag.
Here is the code I use in the custom component called 'detailField':
 
Code:
 <apex:component>
    <apex:attribute name="label" type="String" required="true" description=""/>
    <apex:attribute name="value" type="SObject" required="true" description=""/>
    <apex:attribute name="style" type="String" required="true" description=""/>
    
    <apex:outputLabel value="{!label}" styleClass="{!style}"/>
    <apex:outputField value="{!value}"/>
</apex:component>
 
I get an error when I save: Error: Could not resolve the entity from <apex:outputField> value binding '{!value}'. outputField can only be used with SObject fields.
 
Can someone provide me a solution?
 
Thanks
adrian