• magdielhf
  • NEWBIE
  • 30 Points
  • Member since 2009
  • Technical Architect
  • Accenture


  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 28
    Replies

I created a custom wrapper object as such:

 

global class DocumentWrapper {
public List<Attachment> attchments { get; set;}
public Document__c document{ get; set; }


public DocumentWrapper (){

attchments = new List<Attachment>();
document = new Document__c();
}
}

 

I want to return a document with all the related attachments.  The webservice returns a List of these DocumentWrapper objects.  I generate the WSDL and I can call it from .NET.

 

However the DocumentWrapper object class that is generated in .NET has not fields in it, just an empty class?  Is this possible? What am I doing wrong?  I belive I remember someone saying force.com WSDLs cannot handel returning arrays?

 

Are there any work arounds to get Complex types to work in Apex web service calls.  Will manually editing the WSDL work?

 

Message Edited by dke01 on 01-27-2010 02:31 PM
  • January 27, 2010
  • Like
  • 0

Given the Start Date and No. of Business days  find ending date, if you pass a negative amount of days then should get Current Date less those business days,

 

Already test it and currently using it, feel free to correct or improve it for sharing

 

    public static Boolean IsWeekendDay(Datetime dateParam)
    {
       boolean result     = false;
        
       //Recover the day of the week
       Date startOfWeek   = dateParam.date().toStartOfWeek();
       Integer dayOfWeek  = dateParam.day() - startOfWeek.day();
           
       result = dayOfWeek == 0 || dayOfWeek == 6 ? true : false;
        
       return result;
    } 
    
    
    public static Datetime AddBusinessDays(Datetime StartDate, integer BusinessDaysToAdd )
    {
       //Add or decrease in BusinessDaysToAdd days 
       Datetime finalDate = StartDate;
       
       integer direction = BusinessDaysToAdd < 0 ? -1 : 1;

        while(BusinessDaysToAdd != 0)
        {
            finalDate = finalDate.AddDays(direction);            
            
            if (!isWeekendDay(finalDate))
            {
                BusinessDaysToAdd -= direction;
            }
        }

        return finalDate;
    } 

 

 

Hi,

I'm trying to create a simple trigger which creates an opportunity whenever an account field is updated. However, I'm getting this error upon saving:

Error: Compile Error: Loop variable must be of type SOBJECT:Opportunity at line 3 column 19

Here's my trigger:

trigger CreateNewOppinPeakfolio on Account (after insert, after update){
     List <Opportunity> insertopp = new List <Opportunity> ();    
     for (Account acc: Trigger.new){
        if(acc.Analysis_Status_in_Peakfolio__c == 'Portfolio Analysis'){
            Opportunity o = new Opportunity ();
            o.Name = acc.Name;
            o.StageName = 'Portfolio Analysis';
            o.CloseDate = system.today() + 30;
            o.AccountId = acc.Id;
            insertopp.add(o);
        }
    }
    try {
            insert insertopp;
    }
    catch (system.Dmlexception e) {
            Trigger.new[0].addError(e);
    }
}
Hi

I am following the Force.com Workbook and I created a method to renumber the line items under the invoice Invoice and Line Item have a master detail view. The method is being called from a button on the Invoice and it works correctly (updated the Line Number beginning from 1).
The issue is that the line numbers do no always appear ordered in the App. Sometimes the Line Items come as 1,3,2,4.

How can i show these line items in order in the App?

I have a service cloud console app with a visualforce page on the left side that lets a user search for accounts.  If they collapse the left side and then uncollapse it, the visualforce page has lost all of it's search parameter values and the result set of search items.  It's as if the page has reloaded.  Has anyone seen this before and come up with a solution?

Thanks,

Todd

tell me apex component tag support  apex tabpanel in visualforce page

 

problem is 

my tabs are not working in visualforce page when click a tab(it is not opening)

<c:mycomponent/>

 

<apex:component access="global" allowDML="true">

<style>

.activeTab {background-color: #236FBD; color:white; background-image:none}
.inactiveTab { background-color: lightgrey; color:black; background-image:none}

</style>


<apex:tabPanel switchType="client" tabClass="activeTab" inactiveTabClass="inactiveTab" width="10%" >
<apex:tab label="Depts">
<br/>
<br/>
<div align="right">
<apex:outputLink >Add Department</apex:outputLink>
</div>
</apex:tab>
<apex:tab label="Posts"><apex:outputLink >Add Department</apex:outputLink></apex:tab>
<apex:tab label="Sections" ></apex:tab>
<apex:tab label="Leave Type"></apex:tab>
<apex:tab label="Stations"></apex:tab>
<apex:tab label="Contract Types"></apex:tab>
<apex:tab label="Qualification Types"></apex:tab>
<apex:tab label="TAB"></apex:tab>
</apex:tabPanel>

</apex:component>

 

 

+++++++++++++++++

 

 

<c:setup ></c:setup>

Is there any method to get user timezone in apex class.

I have a new work pc ((Windows 7 64 bit) and want to install Force.com IDE

 

I downloaded the standalone Windows 64 installation and after configuring proxy settings as per the advice of our Tech Services proceeded to install but the Pulse installation seems to freeze half way through.

 

Tried the same installation on my home PC but seems to stop installing half way through "Installing Force.com IDE: Fetching software - 44.9 MB remains

 

Are there any detailed installation instructions for standalone installation. Or any advice?

 

I previously used Force.com under Eclipse on my Windows XP PC but only need Eclipse for Salesforce.

 

Screen grab 

 

 

 

 

  • July 02, 2010
  • Like
  • 0

Given the Start Date and No. of Business days  find ending date, if you pass a negative amount of days then should get Current Date less those business days,

 

Already test it and currently using it, feel free to correct or improve it for sharing

 

    public static Boolean IsWeekendDay(Datetime dateParam)
    {
       boolean result     = false;
        
       //Recover the day of the week
       Date startOfWeek   = dateParam.date().toStartOfWeek();
       Integer dayOfWeek  = dateParam.day() - startOfWeek.day();
           
       result = dayOfWeek == 0 || dayOfWeek == 6 ? true : false;
        
       return result;
    } 
    
    
    public static Datetime AddBusinessDays(Datetime StartDate, integer BusinessDaysToAdd )
    {
       //Add or decrease in BusinessDaysToAdd days 
       Datetime finalDate = StartDate;
       
       integer direction = BusinessDaysToAdd < 0 ? -1 : 1;

        while(BusinessDaysToAdd != 0)
        {
            finalDate = finalDate.AddDays(direction);            
            
            if (!isWeekendDay(finalDate))
            {
                BusinessDaysToAdd -= direction;
            }
        }

        return finalDate;
    } 

 

 

Hi,

 

I have a case where i need to process an opportunity after 30 business days of its creation . 

(Given the Start Date, No. Of Business days, find End_Date..) . Can anybody suggest the best way to do it using formula?

 

Thanks in advance.

Hi,

 

I recently signed up for the chatter development preview and I

received an @chatterdevzone.org set of credentials as well as a

Force.com developer edition credentials.

 

However, in one of the emails there was mention that I would be

receiving an @chatterdev.org set of credentials which I have not.

 

Could someone elaborate on this i.e. is it needed or would my

Force.com developer edition login credentials be all that I need? 

 

Thanks 

After a lot of persistence I finally was able to get repeating header and footers when rendering a Visualforce page as a PDF. The key to this is the page2PDF support of CSS3. 

 

Here is the css I came up with:

 

<style type="text/css">

@page {

@top-center {

content: element(header);

}

}

div.header {

padding: 10px;

position: running(header);

}

</style>

 

In the visualforce page I have the header setup as a div with the class name "header" the position running command pulls the content in my div and repeats it at the top of every page. The key for some reason is to put your header and footer divs at the top before you put your content on the page.

 

Here is my page

 

<apex:page renderAs="pdf">

<head>

<style type="text/css" media="print">

@page {

@top-center {

content: element(header);

}

@bottom-left {

  content: element(footer);

}

}

 

div.header {

padding: 10px;

position: running(header);

}

div.footer {

display: block;

padding: 5px;

position: running(footer);

}

 

.pagenumber:before {

content: counter(page);

}

.pagecount:before {

content: counter(pages);

}

</style>

</head>

 

<div class="header">

<div>My Header Text</div>

</div>

 

<div class="footer">

<div>Page <span class="pagenumber"/> of <span class="pagecount"/></div>

</div>

 

<div class="content">

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nec nulla turpis. Suspendisse eget risus sit amet lectus ornare varius. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean nec urna purus, adipiscing accumsan massa. Nullam in justo nulla, sed placerat mauris. In ut nunc eget libero posuere luctus. Donec vulputate sollicitudin ultrices. Nulla facilisi. Mauris in sapien arcu. Phasellus sit amet quam non mi ornare tincidunt ac quis lectus.</p>

</div>

</apex:page>

 

I cut the content text short for the purpose of this post. I am sure it will just take some more playing around.

 

Hope this helps someone avoid some late nights like I spent trying to figure this out. :smileyhappy:

 

 

Message Edited by JohnDS on 03-10-2010 07:34 PM

Select Id from objectname__c where source__c = SF and lastmodifieddate <  2010-02-03T00:15:00.000Z

 

This query is working fine in eclipse, but I want the same query passing datetime to query in apex class dynamically.

 

 

Please let me know how to frame my query in apex class.

 

Thanks in Advance..

 

PK

 

I want to access some JS function defined in static resource java file from Javascript on custom button.

 

anybody knows how to do this? 

 

I have an Apex class that exposes a function through the WebServices interface. The function has a number of parameters that are based on the same type. When I call this function from Flex, the data that I am passing is being put into the wrong parameters. I am not sure if this is a bug in Salesforce, the Force.com toolkit, or Flex.

 

My flex code passes 2 Id values via the deletedEntitiesIds parameter. The other three collections are empty.

 

var deletedTeamMembersIds:Array = new Array; var deletedEntitiesIds:Array = new Array; var deletedTeamIntimacyIds:Array = new Array; var deletedRelationshipsIds:Array = new Array; deletedEntitiesIds.push( id1 ); deletedEntitiesIds.push( id2 ); var args:Array = [ new Parameter( "OpportunityId", _opportunityId ), new Parameter( "instanceNumber ", _instanceNumber ), new Parameter( "deletedIntimacies", deletedTeamIntimacyIds, true ), new Parameter( "deletedRelationships", deletedRelationshipsIds, true ), new Parameter( "deletedEntities", deletedEntitiesIds, true ), new Parameter( "deletedTeamMembers", deletedTeamMembersIds, true ) ]; _force.execute( "MSO_OrgChart_WebService", "updateOrgChart_Delete" , args, new AsyncResponder(SaveToSalesforce_DeleteHandler, SaveToSalesforceFaultHandler), "SalesMethods" );

 

 

The Apex function just writes the collections into the debug log:

 

 

global with sharing class MSO_OrgChart_WebService { WebService static UpdateResult updateOrgChart_Delete( Id OpportunityId, Integer instanceNumber, List<Id> deletedIntimacies, List<Id> deletedRelationships, List<Id> deletedEntities, List<Id> deletedTeamMembers ) { System.debug( deletedIntimacies ); System.debug( deletedRelationships ); System.debug( deletedEntities ); System.debug( deletedTeamMembers ); } }

 

 

As the debug log shows, the Id values are now in the deletedIntimacies collection rather than in the deletedEntities collection.

 

20091110211500.108:Class.SalesMethods.MSO_OrgChart_WebService.updateOrgChart_Delete: line 379, column 1: (a0X80000001v3n5EAA, a0X80000001v3omEAA) 20091110211500.108:Class.SalesMethods.MSO_OrgChart_WebService.updateOrgChart_Delete: line 380, column 1: () 20091110211500.108:Class.SalesMethods.MSO_OrgChart_WebService.updateOrgChart_Delete: line 381, column 1: () 20091110211500.108:Class.SalesMethods.MSO_OrgChart_WebService.updateOrgChart_Delete: line 382, column 1: ()

 

 

 

Am I doing something wrong or is this another Force/Flex bug?

 

 

Many thanks,

 

Andy

Is it possible to include custom object fields when searching using the lookup window?  I have a number of custom objects that use an auto-number for the object name, however searching for these objects is near impossible when I want to link them to another object by selecting the lookup magnifying glass.

 

I've found several different solutions that suggest that this could be done, however I am unable to get a successful result.  Any help would be appreciated

I have a javascript in static resource. How can I refer this from the onClick event of Custom Button.

I would like to refer this as external javaScript source and use the functions. Please help me. thank you.

How can  I upload my own .js file on salesforce.com and how to use it in Custom s-control.
I want to upload that .js file for displaying data in the grid from database.