• Maros Sitko
  • NEWBIE
  • 255 Points
  • Member since 2013

  • Chatter
    Feed
  • 9
    Best Answers
  • 6
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 79
    Replies

Hi,

 

 Please help me to write a trigger for my requirement below,

 

I am creating a date field in my org which should automatically copy all the account created date to that date field.

 

Note :

 

Only the date should be copied and not the time which should happen for all ther exisiting records and new one.

 

Please kindly help me.

 

Thnks

Hi,

 

MY VF page not ( New contact button ) not working in IE and Firefox. it works good in Chrome. please suggest if any thoughts.

 

when i click new contact button  it has to open in new primary tab.

 

Many Thanks

Beat.

<apex:page Controller="ContactSearch" sidebar="false" id="page">
<apex:pageMessages />
<p>No People Soft Contact found. Please search Salesforce below using Name, Phone, Email, or other identifying information.</p>
  <apex:includeScript value="/support/console/22.0/integration.js"/>
     <script type="text/javascript">
        function testOpenPrimaryTab() {
          
        
            //Open a new primary tab with the salesforce.com home page in it
            sforce.console.openPrimaryTab(null,'{!pageUrl}', true, 
                'newContact', openSuccess, 'newContact');
        }
        
        var openSuccess = function openSuccess(result){
            //Report whether opening the new tab was successful
            if (result.success == true) {
               // alert('Primary tab can be opened');
            } else {
                //alert('Primary tab cannot be opened');
            }
        };
        
     </script>
 <apex:form id="frm">
                  
     <apex:pageBlock mode="edit" id="block">
 
         <apex:pageBlockSection id="pbSectn">
            <apex:pageBlockSectionItem id="pbSitem" >
               <apex:outputLabel for="searchText">Search Salesforce Contacts</apex:outputLabel> 
               <apex:panelGroup >
                  <apex:inputText id="searchText" value="{!searchText}"/> <br/><br/>
                  <apex:commandButton value="Search" action="{!search}" />
                   <apex:commandButton value="Clear" action="{!Clear}" />
                   <apex:commandButton value="Back" action="{!Back}"/>
                   <apex:outputPanel style="text-align:center" layout="block" >
           <apex:commandbutton value="New Contact" action="{!newcontact}" style="float: centre;"  rendered="true" onclick="testOpenPrimaryTab():return false;"/>
          <script>
            testOpenPrimaryTab();
            return false
           </script>
         </apex:outputPanel>
         </apex:panelGroup>
         </apex:pageBlockSectionItem>
        </apex:pageBlockSection>  
         <apex:pageBlockSection Title="Results" id="results" columns="1" rendered="{!IsShown}"  > 
          
         <apex:pageBlockTable value="{!contactResults}" var="c">
                  <apex:column headervalue="Name" > 
                       <apex:outputLink value="/{!c.Id} " >{!c.name}</apex:outputLink>
                  </apex:column>
                  <apex:column value="{!c.emplid__c}"> </apex:column> 
                  <apex:column value="{!c.Phone}" ></apex:column> 
                  <apex:column value="{!c.Email}" ></apex:column> 
                       
       </apex:pageBlockTable> 
   </apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
 </apex:page>
               

 

In my pageBlockTable, when the "Quantity" is changed, it would be a action and reRender this table,

when the table is rerenderd, the focus in this table would be lost, so i'm trying to re-focus the last element.

here is my code:

<apex:page controller="Mycontroller">
<script type="text/javascript">
   var elementFocus = null;
   function setFocus(){
       elementFocus = document.activeElement;
   }
   function retainFocus(){
       elementFocus.focus();
   }
</script>
 <apex:form >
   <apex:pageBlock>
      <apex:pageBlockTable value="{!wrappers}" var="wrapper" id="wtable">
         <apex:column headerValue="Quantity">
             <apex:inputField value="{!wrapper.sub.Quantity__c}" id="Quantity__c">
                 <apex:actionSupport event="onchange" action="{!doSomething}"

                     <!-- before take action, set current focus. oncomplete, retain that focus -->
                     onbeforedomupdate="return setFocus()" rerender="wtable" oncomplete="return retainFocus()">
                 </apex:actionSupport>
             </apex:inputField>
         </apex:column>
         <apex:column headerValue="SalesPrice">
            <apex:inputField value="{!wrapper.sub.SalesPrice__c}" id="SalesPrice__c"/>
         </apex:column>
      </apex:pageBlockTable>
   </apex:pageBlock>
 </apex:form>
</apex:page>

 i use javascript to retain focus, and the alert also shows the right id, but elementFocus.focus(); just don't work.

should i include some other script?

<script type="text/javascript">
   var elementFocus = null;
   function setFocus(){
       elementFocus = document.activeElement;
       alert(elementFocus.id);
   }
   function retainFocus(){
       alert(elementFocus.id); //when debug, it shows the same value as the id in setFocus()
elementFocus.focus(); } </script>

 Any help would be much appreciated!

Hello Everybody,

 

I perform the Visualforce tutorial from this book: Visualforce Workbook.

 

I create Visualforce page and copy/paste the following code in it:

 

<apex:page standardController="Account">
<p>Hello {! $User.FirstName}!</p>
<p>You are viewing the {! account.name} account.</p>
</apex:page>

 

I call the page using the following URL like indicated in the Tuto:

     https://c.na15.visual.force.com/apex/Hello&id=001i0000007fhl9

 

I get the following error message in a blank page:

 

The name can only contain underscores and alphanumeric characters. It must begin with a letter and be unique, and must not include spaces, end with an underscore, or contain two consecutive underscores.

 

I get this message even when I change the standardController and comment the account.Name line. No message if I don't use the "&id=001i0000007fhl9" part or the URL.

The environment is completly new (less than 24 hour) and it was the first update I was performing.

 

Has anyone an explanation and possibly a solution to this issue ?

 

Thank very much you for your help

fredbe77

 

I have craeted a page and using apex:repeat i am creating multiple div and assiging them dynamic id's. On load want only one div to be visible and later based on certain actions, I would make other visible.

 

So on load I am getting the id of the div which needs to be visible and using setAttribute making it visible, but somehow it is still hidden.Can some one please look into the issue

 

<apex:pagetabStyle="Opportunity"standardController="Opportunity"extensions="LSOpportunityDetailsController"sidebar="false"showHeader="false">

 

<apex:includeScriptvalue="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"  />

<apex:includeScriptvalue="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js"  />

<apex:stylesheetvalue="//ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery.ui.theme.css"/>

<apex:stylesheetvalue="//ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery.ui.base.css"/>

 

<scripttype="text/javascript">

    $(document).ready(function() {

        getRemoteValidation();

    });                                               

</script>

<scripttype="text/javascript">

    function getRemoteValidation() {        

       

     

        document.getElementById(phaseBlock{!currentP}).setAttribute("style","visibility:visible;");

}

    </script>

   

<apex:form>

    <apex:pageblocktitle="Test">

        <tablecellspacing="0"style="border:1px dotted #999999;">

                <tr>

                    <apex:repeatvalue="{!phases}"var="phaseWrapper"id="theRepeat">

                        <td  valign="top"id="phaseBlock{!phaseWrapper.phase.Name}"style="visibility:hidden">

                            <table>

                                <tr height="35">

                                    <td style="background-color:#E4ECFF" width="950" valign="top">

                                        <table >

                                            <tr>

                                                <td><apex:outputText value="{!phaseWrapper.phase.Name}" id="theValue" style="font-size:10pt;"/></td>

                                            </tr>

                                        </table>                                                    

                                    </td>

                                </tr>                                                               

                            </table>                                   

                        </td> 

                    </apex:repeat>

                </tr>

            </table>

    </apex:pageblock>

</apex:form>

</apex:page>

This is the VF page

<apex:page standardController="Contact" extensions="sampleDetailPageCon"> <style> .fewerMore { display: none;} </style> <apex:form > <apex:pageMessages /> <apex:detail relatedList="true"></apex:detail> <apex:pageblock id="CustomList" title="Related Opportunities" > <apex:pageBlockTable value="{!oppz}" var="o" rendered="{!NOT(ISNULL(oppz))}"> <apex:column value="{!o.Name}"/> <apex:column value="{!o.Account.Name}"/> <apex:column value="{!o.Type}"/> <apex:column value="{!o.Amount}"></apex:column> <apex:column value="{!o.CloseDate}"/> </apex:pageBlockTable> <apex:outputLabel value="No records to display" rendered="{!(ISNULL(oppz))}" styleClass="noRowsHeader"></apex:outputLabel> </apex:pageblock> </apex:form> </apex:page>

 

This is the class that drive it.

public class sampleDetailPageCon {    
    private List<Opportunity> oppz;    
    private Contact cntact;     
    public sampleDetailPageCon(ApexPages.StandardController controller) {        
        this.cntact= (Contact)controller.getRecord();    
        }    
        public List<Opportunity> getOppz()    
        {        
            Contact con = [Select id, Account.id FROM Contact where id = :cntact.id];        
            if (con.Account == null)         
                return null;        
                oppz = [Select id, Name, Account.Name, CloseDate, Amount, Type from Opportunity where Account.id = :con.Account.id];        
                return oppz;    
        }
}

 

Visually, it is cool but basic.  How do I many the Opportunity data in the related list clickable?  Please help I will give kudos..

 

Thank you,

Steve Laycock

I have a flow embedded inside a VF page, which is embedded inside account detail page.

 

On finishLocation i can set the vf page url, but not the parent account detail page url.

 

I want to refresh the account detail page, so that i can see the flow reults, without manually refreshing it.

 

Can we use something like target attribut in pagereference, and set it to _parent to refresh the parent page ?? or any idea ??

 

Flow:

<flow:interview name="CSR_Withdrawal" finishLocation="{!FlowFinishLocation}" id="withrawlCSR" rendered="{!ShowWithrawlCSR}">
           <apex:param name="ID" value="{!account.id}"/>
</flow:interview>

 

Controller method:

public PageReference getFlowFinishLocation() {
     String url = '/apex/ClientAlerts?id=' + acct.id;
     Pagereference p = new Pagereference(url);
     return p;
}

I put visualforce page as into pagelayout for opportunity (embeded page ). For show my problem, I created next visualforce page

<apex:page standardController="opportunity">
<apex:form >

   <apex:detail subject="{!opportunity.id}" relatedList="false" inlineEdit="true"/>

   <apex:detail subject="{!opportunity.id}" relatedList="false" inlineEdit="true"/>

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

If I go on this page, I see embedded page only for first apex:detail section, for second not. If I edited some field in second apex:detail section, the second section is reloaded, what is correct, but embedded page from the first apex:detail section is reloaded (why from first section, if I edited second?).

this is only easy example, in real page I do not show the same opportunity, but behavior is the same.

Hi All,

during my work with apex, I had issue with searching data in maps of maps of maps... or combinations in lists. Sometimes I want to run a debug log and I want to see all values in fields. Salesforce put debug log into long string only, so it's hard to read. After time, I desided to create a new tool, which parse salesforce log into nice format for easy reading. Try it, and say if you like it. Feel free to request some improvements and ideas for implementing

 

 

http://www.cassacloud.com/nice-salesforce-debug/

 

enjoy!

 

PS: if you do not have any debug try this one:

16:55:49:253 USER_DEBUG [59]|DEBUG|{Best Case=(), Closed=(OppInfoTotal:[OppCategory=Closed, OppId=MyId, OppName=TestOPP1, OppProjectType=null, OppV2Practice=null, sumTotals=(sumQuarterRow:[RevenueType=Deposit, SumOfRow=null, month1=1.0, month2=0, month3=3.6], sumQuarterRow:[RevenueType=Milestone, SumOfRow=null, month1=3.0, month2=0, month3=0])]), Commit=(OppInfoTotal:[OppCategory=Commit, OppId=myId, OppName=TestOPP2, OppProjectType=null, OppV2Practice=null, sumTotals=(sumQuarterRow:[RevenueType=Final, SumOfRow=null, month1=1.0, month2=2.5, month3=1.9])]), Pipeline=()}

 

Hi, can you help me with post Chatter feed item with REST API?
I am able to post feeditem with attachment, but after download attachment (image),
my computer say that it is broken. So I thing, I have wrong Content-Type.
Here is my JSON

--0HWq8x4y4DSQ4fqjXt6MinVMyqbf1r
Content-Disposition: form-data; name="json"
Content-Type: application/json; charset=UTF-8

{"body":{"messageSegments":[{"type":"text","text":" From CassaDeveloper:\nabc"}]},"attachment":{"attachmentType":"NewFile","title":"image.png"}}

--0HWq8x4y4DSQ4fqjXt6MinVMyqbf1r 

 Content-Disposition: form-data; name="feedItemFileUpload"; filename="image.png"
Content-Type: application/octet-stream; Content-Transfer-Encoding: base64

blob of content which is from ContentVersion EncodingUtil.base64Encode((blob)file[0].VersionData)
--0HWq8x4y4DSQ4fqjXt6MinVMyqbf1r--

 I build it with apex as a String:

list<ContentVersion> file = [SELECT id, Title, VersionData, PathOnClient FROM ContentVersion where id = :attId];
jsonBody = '--0HW....';
jsonBody += EncodingUtil.base64Encode((blob)file[0].VersionData);
jsonBody += '--0H';
....
request.setMethod('POST');
request.setHeader('Content-Type',  'multipart/form-data; boundary=0HWq8x4y4DSQ4fqjXt6MinVMyqbf1r');
request.setBody(jsonBody);
....

  Thank you

Hi, I do not know how to resolve issue with extension in wsdl

this is part of wsdl

<complexType name="Contact">
  <annotation>
   <documentation>...</documentation>
  </annotation>
<complexContent>
<extension base="tns:BaseContact">
 <sequence>
  <element maxOccurs="1" minOccurs="0" name="id" type="xsd:long">
    <annotation>
     <documentation>...</documentation>
    </annotation>
  </element>
  <element maxOccurs="1" minOccurs="0" name="name" type="xsd:string">
    <annotation>
      <documentation>...</documentation>
    </annotation>
  </element>
.......

 salesforce wsdl2sfdc generate

public class Contact{
public String name;
private String[] name_type_info = new String[]{'name','https://....',null,'0','1','false'};
...
}

and 
public class BaseContact {
        public String BaseContact_Type;
        private String[] BaseContact_Type_type_info = new String[]{'BaseContact.Type','https://...',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'...','true','false'};
        private String[] field_order_type_info = new String[]{'BaseContact_Type'};
    }

 but it doesn't work, when I receive response form web service. Error message:

Web service callout failed: Unable to parse callout response. Apex type not found for element BaseContact.Type

 

Please, can anyone help me? I read some articles and tried many combinations, but it have not help me.

Do you have some documentation how to manualy write apex class from wsdl?

Hi,

 

I have visualforce page in Sites, where I am using custom lables. English, Germen and Spanish languages works ok, but Russian with azbuka characters is not shown. In stead of it, English translation is shown. Do you have any suggestion?

 

example of using

<h2>{!$Label.title}</h2>

 

of couser I tried <apex:outputText value="{!$Label.title}"/>

and {!$Label['title']}

Hi, I have issue with inserting vote object. My code in controller is

Vote newVote = new Vote(ParentId = articleId, Type = myvote);
try{
insert newVote;
} catch(DmlException e) {
ApexPages.addmessage(new ApexPages.Message(ApexPages.Severity.WARNING, e.getMessage()));
}

 

 

and I get error

Insert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: <unknown> duplicates value on record with id: <unknown>: []
 

 

 

Any suggestion? Thank you

Hi,

I do not know if it's bug, or I do not clearly understand date function : WEEK_IN_YEAR. Can someone explain it to me?

 

I have Aggragate soql query for sum col1 and col 2 in this and last week. It must be sort by week in year, because if last week is in previous month I will get bad order.

select WEEK_IN_MONTH(date1), sum(col1), sum(col2), CALENDAR_MONTH(date1),  WEEK_IN_YEAR(date1) from Obj1 WHERE (date1 = THIS_WEEK OR date1 = LAST_WEEK) GROUP BY WEEK_IN_MONTH(date1), WEEK_IN_YEAR(date1),CALENDAR_MONTH(date1) ORDER BY WEEK_IN_YEAR(date)

 

I get 2 results one for previous week (WEEK_IN_MONTH = 2, WEEK_IN_YEAR = 28) and for current week (WEEK_IN_MONTH = 3, WEEK_IN_YEAR = 28). Why I get week in month 28 for current week, becasue today(2013-07-16 is 29th week in year).

In documentation http://www.salesforce.com/us/developer/docs/dbcom_soql_sosl/index_Left.htm#StartTopic=Content/sforce_api_calls_soql_select_date_functions.htm is written:' The first week is from January 1 through January 7.' so it is not calendar week in year? just they calculate week by math? (numbers of days devided by 7? ).

 

In my opinion it should work like calendar week in year.

Hi,

 

I have apex:detail of opportunities inside apex:repeat. I have 2 issues:

first: is that inlineEdit did not work fine, when apex:repeat is empty, and after rerender it has some objects.

my page

<apex:form >
        <apex:commandButton value="Search" rerender="oppPanel" action="{!showOpp}"/>
 
</apex:form>
<apex:outputPanel id="oppPanel">
    <apex:outputPanel rendered="{!show}" id="inner">
        
       <apex:detail subject="{!opps[0].id}" relatedList="false" inlineEdit="true"/>
   </apex:outputPanel>
</apex:outputPanel>

 

 

second: in pagelayout I have custom button, which should execute javascript

window.open('/apex/mypage?id={!Opportunity.Id}','_newtab');


but salesforce create for this invokeAction javascript function, so in this function is only one Opportunity.Id. So when I click on any button it always open new tab with the same opportunity Id instead of use opportunity Id from pagelayout

Hi, can you help me?

I can not use canvas app in visualforce page with apex:canvasApp tag. every time I get this error

 

Visualforce Error

Unable to retrieve installed application by namespace [null] and developer name [myCanvasAppName].

 

PS: I know that it is dupliate topic to http://boards.developerforce.com/t5/Visualforce-Development/apex-canvasApp-in-Visualforce/td-p/602515 but it is important for me

 

Thank you

Hi,

I have issue with include canvas app into Visualforce Page. My canvas app include PHP site from my server. It works in Canvas App preview and in Chatter tab too. But in Visualforce page not.

My simple VF page

 

<apex:page >
 <apex:canvasApp developerName="myCanvasAppName" />
</apex:page>

 

then I enter URL https:...salesforce../apex/myPage, and I got this error


Visualforce Error

Unable to retrieve installed application by namespace [null] and developer name [myCanvasAppName].

 


I tried to add namespacePrefix="" to canvasApp tag, but i got the same error.

Do I need something set somewhere?

Hi All,

during my work with apex, I had issue with searching data in maps of maps of maps... or combinations in lists. Sometimes I want to run a debug log and I want to see all values in fields. Salesforce put debug log into long string only, so it's hard to read. After time, I desided to create a new tool, which parse salesforce log into nice format for easy reading. Try it, and say if you like it. Feel free to request some improvements and ideas for implementing

 

 

http://www.cassacloud.com/nice-salesforce-debug/

 

enjoy!

 

PS: if you do not have any debug try this one:

16:55:49:253 USER_DEBUG [59]|DEBUG|{Best Case=(), Closed=(OppInfoTotal:[OppCategory=Closed, OppId=MyId, OppName=TestOPP1, OppProjectType=null, OppV2Practice=null, sumTotals=(sumQuarterRow:[RevenueType=Deposit, SumOfRow=null, month1=1.0, month2=0, month3=3.6], sumQuarterRow:[RevenueType=Milestone, SumOfRow=null, month1=3.0, month2=0, month3=0])]), Commit=(OppInfoTotal:[OppCategory=Commit, OppId=myId, OppName=TestOPP2, OppProjectType=null, OppV2Practice=null, sumTotals=(sumQuarterRow:[RevenueType=Final, SumOfRow=null, month1=1.0, month2=2.5, month3=1.9])]), Pipeline=()}

 

im not really loving the way required fields are handled
 - sometimes it wont let me change rendered boxes, like an edit view vs a read view (get stuck in edit mode)
 - the error message isnt always clear : j_id0:j_id2:j_id10:EditInfo:j_id23:j_id29:j_id33: Validation Error: Value is required.
 - sometimes the indicator is missing

i feel like im going to have to hand validate each field on this massive form: native account and contact fields with other custom fields
how do you end up getting the most out of coding and not having to worry about every single field?
unfortunately, saying required="true" just isnt really as user friendly as we need it to be
Hi All

I am currently designing a custom home page for salesforce community. 

I have set a background image in body css.

Then I add a header image which should sit on top of that html background image. However when I do, it creates a white background for the image.

How can i just add the logo so that it looks a part of that background image?

Regards
Sameer Sheikh
means i wrote a trigger to send a mail .After sending mail for first time the status of that trigger is inactive(fires only onces).
I've opened a case for this, 10197829, but wanted to report it here as well in hopes of getting it noticed/resolved faster.  I realize this limit is no longer enforced, but older code that checks to see if the limit has been exceeded is now erroring out due to this issue.  Yes, the code can be fixed but in this case the code is part of a managed package with several major versions in the wild and fixing this would require fixing and pushing updates to almost 30 different major releases.

To reproduce the issue, simply execute this in the developer console:

System.debug( Limits.getScriptStatements() );

You'll see that it both returns 200,000 and the cumulative stats will report that 200,000 of 200,000 script statements have been executed.  See this log:

30.0 APEX_CODE,DEBUG;APEX_PROFILING,FINEST;CALLOUT,ERROR;DB,DEBUG;SYSTEM,DEBUG;VALIDATION,ERROR;VISUALFORCE,ERROR;WORKFLOW,ERROR
Execute Anonymous: System.debug( Limits.getScriptStatements() );
Execute Anonymous: System.debug( Limits.getLimitScriptStatements() );
09:04:43.038 (38268000)|EXECUTION_STARTED
09:04:43.038 (38284000)|CODE_UNIT_STARTED|[EXTERNAL]|execute_anonymous_apex
09:04:43.038 (38842000)|SYSTEM_METHOD_ENTRY|[1]|Limit.getScriptStatements()
09:04:43.038 (38906000)|SYSTEM_METHOD_EXIT|[1]|Limit.getScriptStatements()
09:04:43.038 (38930000)|SYSTEM_METHOD_ENTRY|[1]|System.debug(ANY)
09:04:43.038 (38945000)|USER_DEBUG|[1]|DEBUG|200000
09:04:43.038 (38953000)|SYSTEM_METHOD_EXIT|[1]|System.debug(ANY)
09:04:43.038 (38964000)|SYSTEM_METHOD_ENTRY|[2]|Limit.getLimitScriptStatements()
09:04:43.038 (38996000)|SYSTEM_METHOD_EXIT|[2]|Limit.getLimitScriptStatements()
09:04:43.039 (39008000)|SYSTEM_METHOD_ENTRY|[2]|System.debug(ANY)
09:04:43.039 (39019000)|USER_DEBUG|[2]|DEBUG|200000
09:04:43.039 (39027000)|SYSTEM_METHOD_EXIT|[2]|System.debug(ANY)
09:04:43.129 (39069000)|CUMULATIVE_LIMIT_USAGE
09:04:43.129|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 0 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Number of code statements: 200000 out of 200000 ******* CLOSE TO LIMIT
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 10
  Number of Email Invocations: 0 out of 10
  Number of fields describes: 0 out of 100
  Number of record type describes: 0 out of 100
  Number of child relationships describes: 0 out of 100
  Number of picklist describes: 0 out of 100
  Number of future calls: 0 out of 10
  • February 08, 2014
  • Like
  • 0
@Httpget
global static <Apexclass> config() {
         try {

          } catch ( Exception configException ) {
               // DML operation inserting a new record
              throw new <Custom Exception>;
          }
}

When I execute it, I was able to throw the exception, but DML operation is reverting back. I want to stop the revert back operation and want to throw the exception. Is it possible ??
When using force.com technologies (e.g. Apex or the point-and-click app logic),  is there support for Aspect Oriented Programming?
For example I'm looking for an easy way to inject my custom code before/after  major business functions, in order to measure how long they took. Or in order to audit them.

Thanks
Hi friends,
I am having an issue with inputcheckbox/commandlink when rendering.
Below is my page code.

<apex:dataTable value="{!VenueList}" var="v" rowClasses="even,odd" cellpadding="5" styleClass="table_vl" id="table_List"  rendered="{!VenueList.size > 0}">
         <!-- Action Checkbox -->
         <apex:column headerValue="REFER">
    <apex:outputPanel id="recomendationNotcreated" rendered="{!IF((v.rec==null), 'true', 'false')}">
           <apex:inputCheckbox value="{!v.isSelected}" id="referLabel" styleClass="referLabel" style="margin-left: 15px;" rendered="{!IF((v.noOfServiceProviders == 1), 'true','false')}">
            <apex:actionSupport event="onclick" action="{!createRecomendation}" rerender="headerComponent,table_List" status="RecomendingStatus">
      <apex:param name="vid" value="{!v.VenueDB.id}" assignTo="{!venueRefId}"/>
                  <apex:param name="venueRefd" value="{!v.vpi.id}" assignTo="{!venuePricingInfoRefId}"/>
                  <apex:param name="locationRefd" value="{!v.vpi.MD_Locations_Serviced__c}" assignTo="{!locationServicedRefId}"/>
     </apex:actionSupport>
     </apex:inputCheckbox>
    </apex:outputPanel>
     <apex:actionStatus id="RecomendingStatus">
     <apex:facet name="start">
         <!-- <div class="vd-processing">&nbsp;&nbsp;<apex:outputLabel value="Processing..." for="referLabel"/></div> -->
         <div class="loading_Text"></div>
      <div class="innerBlock_Text">
             <img  src="{!URLFOR($Resource.VenueSearch,'images/130.gif')}" width="16px" height="16px" title="Please Wait..." />
         </div>
        </apex:facet>
    </apex:actionStatus>
   <apex:outputPanel id="recomendationcreated" rendered="{!IF((v.rec!=null), 'true', 'false')}">
           <apex:commandLink styleClass="clearRefer Remove" value="Remove" action="{!updateRecomendation}" rerender="headerComponent,table_List" status="loadingStatus" >
                  <apex:param name="dvid" value="{!v.vpi.id}" assignTo="{!venuePricingInfoRefId}"/>
                  <apex:param name="recommendId" value="{!v.rec.Id}" assignTo="{!recomendUpdateId}"/>
                  <apex:param name="vid" value="{!v.VenueDB.id}" assignTo="{!venueRefId}"/>
              </apex:commandLink>
           </apex:outputPanel>
              <apex:actionStatus id="loadingStatus">
               <apex:facet name="start">
               <!-- <div class="vd-place">&nbsp;&nbsp;Please wait...</div> -->
                 <div class="loading-Txt"></div>
                 <div class="innerBlocktxt">
                  <img  src="{!URLFOR($Resource.VenueSearch,'images/130.gif')}" width="16px" height="16px" title="Please Wait..." />
                 </div>
              </apex:facet>
              </apex:actionStatus>
        </apex:column>
</apex:datatable>

Here I am rendering commandlink when I click on checkbox and when I click on command link I am rendering checkbox. Here it is working only when the page get refreshed manually. I need to render those without loading the page. Please post your comments if I have made any mistake in the page...
Hi ,
I am getting this error while using the below code in vf(System.NullPointerException: Argument 1 cannot be null )
public class FAQCu {
public String selectedValue {get;set;}
public List<SelectOption> getUserType()
{
  List<SelectOption> options = new List<SelectOption>();   
   Schema.DescribeFieldResult fieldResult =FAQ__c.Users__c.getDescribe();
   List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
    // options.add(new SelectOption('All','All'));
   for( Schema.PicklistEntry f : ple)
   {
      options.add(new SelectOption(f.getLabel(), f.getValue()));
   }   
   return options;
}
public List<FAQ__c> getSearch(){
        System.debug('====selectedValue===='+selectedValue); // You will get the Selected Value here
       
        List<FAQ__c> temp = new List<FAQ__c>();
     String queryString;
   if(selectedValue=='AllUsers')
   queryString='SELECT Users__c,Question__c,Answer__cfrom FAQ__c WHERE Users__c = \'AllUsers\' ';
   else if(selectedValue=='InternalUsers')
   queryString='SELECT Users__c,Question__c,Answer__cfrom FAQ__c WHERE Users__c = \'InternalUsers\' ';
   else if(selectedValue=='ExternalUsers')
queryString='SELECT Users__c,Question__c,Answer__cfrom FAQ__c WHERE Users__c = \'InternalUsers\' ';
/Line 26/temp = Database.query(queryString);
      return temp;
      }
    }
VF
apex:page controller="FAQCu" id="theRepeat">
<apex:form >

<apex:selectList id="users" value="{!selectedValue}" size="1" required="true">
  <apex:selectOptions value="{!userType}"/>
</apex:selectList>
</apex:form>
<apex:repeat value="{!search}" var="string" id="theRepeat">
<apex:outputText value="{!string}" id="theValue"/><br/>
    </apex:repeat>
</apex:page>

Hi

I'm trying to write a query which will pull back a custom field from leads for a specific set of activities

I've tried the query below but cannot figure out how to tunnel into the Leads table to get at the field i want (Solution_Type__c)

Can someone help me?

 

SELECT Id, subject, Who.Name, Who.Id.Solution_Type__c  FROM Task Where Webform_completed__c != NULL AND CreatedDate = Last_month And IsDeleted != TRUE

Hi,

 

I have a pageblock table without controller and it is having 4 columns

Line item                 Desc              Price             QTy

1                               cdskcn             12                  1

                                     gv                     4                  1

                                     ds                   3                   2

                                    dhbd               34                 1

 

i have 1 line item and other are blank so i want to show in it two tables

1. Table 1,in which line item field is not blank and its related records

2. Second table, in which line item is blank and its related records

 

 

 

  • December 16, 2013
  • Like
  • 0

Hi, I do not know how to resolve issue with extension in wsdl

this is part of wsdl

<complexType name="Contact">
  <annotation>
   <documentation>...</documentation>
  </annotation>
<complexContent>
<extension base="tns:BaseContact">
 <sequence>
  <element maxOccurs="1" minOccurs="0" name="id" type="xsd:long">
    <annotation>
     <documentation>...</documentation>
    </annotation>
  </element>
  <element maxOccurs="1" minOccurs="0" name="name" type="xsd:string">
    <annotation>
      <documentation>...</documentation>
    </annotation>
  </element>
.......

 salesforce wsdl2sfdc generate

public class Contact{
public String name;
private String[] name_type_info = new String[]{'name','https://....',null,'0','1','false'};
...
}

and 
public class BaseContact {
        public String BaseContact_Type;
        private String[] BaseContact_Type_type_info = new String[]{'BaseContact.Type','https://...',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'...','true','false'};
        private String[] field_order_type_info = new String[]{'BaseContact_Type'};
    }

 but it doesn't work, when I receive response form web service. Error message:

Web service callout failed: Unable to parse callout response. Apex type not found for element BaseContact.Type

 

Please, can anyone help me? I read some articles and tried many combinations, but it have not help me.

Do you have some documentation how to manualy write apex class from wsdl?

Hi and thank you in advance.

 

 

The situation:

 

I have a 2 custom  fields on opportunity object.  I want to populate these 2 fields with information from the Opportunity Team Member object...Names of the users that fall under a particular role.

 

I think im tired, but this is not making sense to me.  Can you point me in the right direction?

 

 

Wsdl2java (Axis 2.0) generates class extension is properly. But in Apex, generate Apex from WSDL feature is not giving appropriate class relationship.

e.g. I have following xsd in wsdl

<xsd:complexType name="Profile">
      <xsd:simpleContent>
              <xsd:extension base="xsd:string">
                 <xsd:attribute name="lang" type="xsd:string" use="optional"/>
              </xsd:extension>
      </xsd:simpleContent>
</xsd:complexType>

<xsd:complexType name="UserProfile">
        <xsd:simpleContent>
            <xsd:extension base="Profile">
                <xsd:attribute name="code" type="xsd:string"/>
            </xsd:extension>
        </xsd:simpleContent>
</xsd:complexType>

 

WSDL2Apex generates UserProfile and Profile classes, but dont have any relationship. In java Profile class has String _value containment. But Apex class does not have that containment too.

 

Any help would be appreciate.

 

Thanks.

Ankur