• birdofprey
  • NEWBIE
  • 55 Points
  • Member since 2011

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 24
    Questions
  • 12
    Replies

Hello,

 

I'm having trouble with the following code. I'm fairly new to development so please bare with me.

 

private String abcd; 

private List <WorkReason__c> wrReason;

 

abcd = "Example"

 

wrReason = [Select Name from WorkReason__c where Name = abcd];

 

i''m getting an error where Name = abcd. Are we not allowed to use a varaible in place of      'string value' ?



 

So what I want for my visualforce page to do, depending on two cases:

  1. display the application form, with no apexPage.message.
  2. if  ApexPage.message is being call than it should only display that message and nothing else, such as the save button and tab and column headers.

Have a look at the attachment screeshot (http://i.imgur.com/gfcsJhs.jpg) and let know what you think. 

 

This is the controller that is doing all this:

        public AddLineItems(ApexPages.StandardController controller) {
            finID = ApexPages.currentPage().getParameters().get('CF00Ne0000000UEXy_lkid');
            finForm = [SELECT Id,Name,RecordTypeId,RecordType.Name, Approval_Status__c FROM Financial_Form__c WHERE Id = :finID];
            formName = finForm.Name;
            	
            String recApprovalStatus = finForm.Approval_Status__c;
            if (recApprovalStatus.contains('Processing') || recApprovalStatus.contains('Completed')){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'Approval is processing or completed, no new line items can be added.');
				ApexPages.addmessage(myMsg);
            }else{
     ...
//assign all variables to display.
            }

        } 

 

 

 

How are you guys iterating through the batch results?

 

Normally, if I want to insert it directly to SQL table using SOAP API, i can just do it directly by going through iteration of the array result and insert it each result directly (Ex. $record[0]->Id).

 

For a bulk, result is coming out like this as a single array.

 

Array
(
    [752f00000004CRH] => "Id","Name"
"003f0000001xx","First 1 Last 1"
"003f0000001xx","First 2 Last 2"
"003f0000001xx","First 3 Last 3"
}

 

I want to be able query starting 2 weeks ago and prior.

This example

Select Name From Contacts Where CreatedDate <= LAST_N_DAYS:14

This would query me everything from Today() till Today()-14Days.


What I really need is everything that is prior (Today()-14Days).

 

 

 

 

This is an example which comes directly from the doc. When i just set "size=1" to get my drop down, the "test" button doesn't get involve.

 

 public class sampleCon {

 	String countries;
...	
        public String getCountries() {
  	 	return countries;
 	}

 	public void setCountries(String countries) {
 	 	this.countries = countries;
 	}
}

 

public PageReference test() { system.debug('countries===>' + countries); return null; } public List<SelectOption> getItems() { List<SelectOption> options = new List<SelectOption>(); options.add(new SelectOption('US','US')); options.add(new SelectOption('CANADA','Canada')); options.add(new SelectOption('MEXICO','Mexico')); return options; } public String[] getCountries() { return countries; } public void setCountries(String[] countries) { this.countries = countries; } }

 

<apex:page controller="sampleCon">
 	<apex:form>
 	 	<apex:selectCheckboxes value="{!countries}" size="1">
 	 	 	<apex:selectOptions value="{!items}"/>
 	 	</apex:selectCheckboxes><br/>
 	 	<apex:commandButton value="Test" action="{!test}" rerender="out" status="status"/>
 	</apex:form>
 	<apex:outputPanel id="out">
 	 	<apex:actionstatus id="status" startText="testing...">
 	 	 	<apex:facet name="stop">
 	 	 	 	<apex:outputPanel>
 	 	 	 	 	<p>You have selected:</p>
 	 	 	 	 	<apex:dataList value="{!countries}" var="c">{!c}</apex:dataList>
 	 	 	 	</apex:outputPanel>
 	 	 	</apex:facet>
 	 	</apex:actionstatus>
 	</apex:outputPanel>
</apex:page>	

 

Since multipick is now false,  So figure that I have to change the set and get to accept string and not string[];

 

 

Now i get this error:

 

SampleCon Compile Error: The method void setCountries(LIST<String>) is referenced by Visualforce Page (sampleCon) in salesforce.com

I want to have a send email message in a function that gets executed whenever the button is press in VF. But nothing happens, I even put in a few system debug, but it doesn't seem to be called when I look into the developer console. Any Ideas?

 

...	
        public EasySendEmail(ApexPages.StandardController controller){
		this.con=(Contact)controller.getRecord();
	}
	
	
	public PageReference SendEmail(){
		Contact recipient = [SELECT id, firstname FROM Contact Where Id = '003f00000039EQcAAM'];
		
		system.debug('debug--->' + UserInfo.getUserId());
		Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();	
		mail.setTargetObjectId(recipient.Id);

		mail.setTemplateId('00Xf0000000DZTt');
        		system.debug('mail--->' + mail);
		Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
		
		return new PageReference('/' + con.id);

	}
...

 

    public List<SelectOption>  getContactItems(){
        
        List<SelectOption> options = new List<SelectOption>();
          options.add(new SelectOption('CANADA','Canada'));
        options.add(new SelectOption('MEXICO','Mexico'));
        return options;
    }

    public String[] getContactInfo() {
            return contact;
    }
            
    public void setContactInfo(String[] contact) {
            this.contact = contact;
    }

 

 

<apex:page standardcontroller="Contact" extensions="EasySendEmail">
   
    <apex:form >
           <apex:selectList value="{!ContactInfo}" size="1">
                <apex:selectOptions value="{!ContactItems}"/>
            </apex:selectList> 
              
            
            <br /><br />    
            <apex:commandButton value="Send Email!" action="{!SendEmail}" reRender="fake" />

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

 

So I have more than one row of record being diplay in VF where they can be edited, but I would only like to edit the record that has changes, as opposed to every record displayed.

 

Would I have to iterate through each record and do a search to see if each field is different and if so, then update the record of those that had a change?

 

here is sample  mock of what I currently have

 

public class manageEventController {
	List <Team__c> team, team2;
	
public List<Team__c> getTeam(){
	team = [SELECT Id, Name, Campaign__c, Account__c, Team_Type__c, Pre_Registration_Size__c, Recruiting_Goal__c, Annual_Event_Type__c 
	FROM Team__c LIMIT 3];
    return team;
}	
    
    public PageReference cancel() {
    	
      PageReference Page = ApexPages.currentPage();
      Page.setRedirect(true);
      
			return Page; 
    }
    
     public PageReference save() {
 
      update team;
   	  system.debug('debug--->' + team);
      PageReference Page = ApexPages.currentPage();
      Page.setRedirect(true);

      return Page;

   }
    
}

What I am trying to do is pull information from at least two different (standard and custom) objects similar to the examples seen here:

http://www.salesforce.com/docs/developer/cookbook/Content/vf_multi_record_edit.htm

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

 

So, what I want to do is have one button to save the chances of both objects at the same time. Is that feasable? 

 

I have a hard time figuring out how the data is being set as the save method is being called.

I run into a problem where in one PHP page where I create a contact record and use that created record Id to assigned it to campaign record which it is updated.

 

Sometimes, it seems that it does an update of the campaign ahead of the create contact record.

 

The campaign then does not update the record with the newly contact record attach to it, because it seems as if record is still being process while the update to the campaign record is called.

 

example mockup of my code.

function createcontact(){
.....
  $sObject = new stdclass();
  $sObject->FirstName = 'Smith';
  $sObject->LastName = 'John';
  $createResponse = $mySforceConnection->create(array($sObject), 'Contact');

 return $createResponse->id;
}


  $sObject2 = new stdclass();
  $sObject2->Id = 111111111111;
  $sObject2->Contact__c = createcontact();
$response = $mySforceConnection->update(array ($sObject2), 'Campaign');


 

 

 

 

I have a newly created custom object. I am not able to query any of the fields; however, in the debug logs, it shows that it is there. Could this be a server thing that some of you may have run into?

 

sample of what I mean.

 

            [__last_request] => 
00D400000007acp!AQMAQAA12iCiJNm8v780ecdcQzhADnzc7h3EF_XBLUetNgJ6ZVPRKsbsE1dhVj7FB5i_120UDuxL.uWtb2_ebV4G.ZXtRxpsSELECT Id, Name, email__c From test_object__c

            [__last_response] => truea0j40000002aVLqAAMtesttest@test.org1

 

 

I even delete the wsdl cache in the server's tmp dir and  disable cache to see if it works

 

    ini_set('soap.wsdl_cache', 0);
    ini_set('soap.wsdl_cache_enabled', 0);

 this is the entire debug code : 

 

stdClass Object
(
    [done] => 1
    [queryLocator] => 
    [records] => Array
        (
            [0] => stdClass Object
                (
                    [Id] => a0j40000002aVLqAAM
                )

        )

    [size] => 1
)
SforceEnterpriseClient Object
(
    [sforce:protected] => SoapClient Object
        (
            [trace] => 1
            [compression] => 32
            [_encoding] => utf-8
            [_soap_version] => 1
            [sdl] => Resource id #14
            [__last_request_headers] => POST /services/Soap/c/24.0/00D400000007acp/0DF40000000Cf6J HTTP/1.1
Host: na2-api.salesforce.com
Connection: Keep-Alive
User-Agent: PHP-SOAP/5.3.3
Accept-Encoding: gzip, deflate
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Content-Length: 532


            [__last_response_headers] => HTTP/1.1 200 OK
Server: 
Content-Encoding: gzip
Content-Type: text/xml; charset=utf-8
Content-Length: 333
Date: Wed, 27 Jun 2012 16:37:47 GMT

            [location] => https://na2-api.salesforce.com/services/Soap/c/24.0/00D400000007acp/0DF40000000Cf6J
            [httpsocket] => Resource id #17
            [_use_proxy] => 0
            [httpurl] => Resource id #19
            [__default_headers] => Array
                (
                    [0] => SoapHeader Object
                        (
                            [namespace] => urn:enterprise.soap.sforce.com
                            [name] => SessionHeader
                            [data] => Array
                                (
                                    [sessionId] => 00D400000007acp!AQMAQAA12iCiJNm8v780ecdcQzhADnzc7h3EF_XBLUetNgJ6ZVPRKsbsE1dhVj7FB5i_120UDuxL.uWtb2_ebV4G.ZXtRxps
                                )

                            [mustUnderstand] => 
                        )

                )

            [__last_request] => 
00D400000007acp!AQMAQAA12iCiJNm8v780ecdcQzhADnzc7h3EF_XBLUetNgJ6ZVPRKsbsE1dhVj7FB5i_120UDuxL.uWtb2_ebV4G.ZXtRxpsSELECT Id, Name, email__c From test_object__c

            [__last_response] => truea0j40000002aVLqAAMtesttest@test.org1
        )

    [sessionId:protected] => 00D400000007acp!AQMAQAA12iCiJNm8v780ecdcQzhADnzc7h3EF_XBLUetNgJ6ZVPRKsbsE1dhVj7FB5i_120UDuxL.uWtb2_ebV4G.ZXtRxps
    [location:protected] => https://na2-api.salesforce.com/services/Soap/c/24.0/00D400000007acp/0DF40000000Cf6J
    [version:protected] => 11.0
    [namespace:protected] => urn:enterprise.soap.sforce.com
    [callOptions:protected] => 
    [assignmentRuleHeader:protected] => 
    [emailHeader:protected] => 
    [loginScopeHeader:protected] => 
    [mruHeader:protected] => 
    [queryHeader:protected] => 
    [userTerritoryDeleteHeader:protected] => 
    [sessionHeader:protected] => SoapHeader Object
        (
            [namespace] => urn:enterprise.soap.sforce.com
            [name] => SessionHeader
            [data] => Array
                (
                    [sessionId] => 00D400000007acp!AQMAQAA12iCiJNm8v780ecdcQzhADnzc7h3EF_XBLUetNgJ6ZVPRKsbsE1dhVj7FB5i_120UDuxL.uWtb2_ebV4G.ZXtRxps
                )

            [mustUnderstand] => 
        )

    [client_id:protected] => 
)

 

I always update the wdsl file and do a clear of the cache using "sudo rm wsdl*" so that I can use any newly created custom fields.

 

But one of the server we have it doesn't seem to be seeing the new fields.  How do I know where and if cache got refresh or cleared? Any suggestion?

 

I try doing a Where IN CLause from php where my $campaignID is a 1-dem array, any ideas if thise works?

 

SELECT Id FROM Campaign WHERE Id IN ('$campaignID')

 

So I have this trigger, which makes a call to a Apex class, which makes a SOQL whenver the function/method is called

 

Apex:

		for(Integer x = 0; x < Trigger.new.size(); x++){
....
			if (ZipCode != NULL && PriBoro == NULL){
				ZipCodeList fillPriBoro = new ZipCodeList();
				fillPriBoro.ZipCode = ZipCode;
				trigger.new[x].Primary_Borough__c = fillPriBoro.getBorough();
			}	
....

 In the ZipCodeList:

public with sharing class ZipCodeList {
...
public ZipCodeList(){}

	public string getBorough (){
		if (ZipCode.length()>=5)
			ZipCode = ZipCode.substring(0, 5);
		
		Borough = [SELECT Borough__c FROM Address__c WHERE Zip_Code__c = :ZipCode];
		
		if (Borough.size()>=1){
			return Borough[0].Borough__c;
		}else {
			return NULL;
		}
	}
	
...
}

 So i read somewhere that in my case everytime that for loop is called from the trigger, it makes soql query call.

 

How would i approach this when each time i call this apex class, I alway need it to return that one Borough data.

 

So I have this trigger, but i have no idea how to write a test code for assignment within a trigger. Any pointers?

All the private strings and instatiation of the object goes untested.

 

the code is below:

 

trigger ZipBoroughContact on Contact (after insert, before update) {

	private String PriBoro;
	private String SecBoro;
	private String ZipCode;	
	private String ZipCodeSecondary;
	private List <Contact> getRecords;
	Contact Rec = trigger.new[0];
	
		getRecords = [SELECT Primary_Borough__c, Secondary_Borough__c, MailingPostalCode, OtherPostalCode From Contact Where Id IN :Trigger.old];
	
		PriBoro = getRecords[0].Primary_Borough__c;	
		SecBoro = getRecords[0].Secondary_Borough__c;
		ZipCode = getRecords[0].MailingPostalCode;
		ZipCodeSecondary = getRecords[0].OtherPostalCode;
		
		if (ZipCode != NULL && PriBoro == NULL){
			ZipCodeList fillPriBoro = new ZipCodeList();
			fillPriBoro.ZipCode = ZipCode;
			Rec.Primary_Borough__c = fillPriBoro.getBorough();
		}	
		
 		
}

 

In my apex i have serveral catches, which I can't seem to be able to get an test method to cover it durning my test

And the Exception it would throw and catch is an "QueryException" Error.

trigger Signer on Form__c (before insert, before update) {
	
	Form__c F = trigger.new[0];
            ...
	try{     
	    ...

	}catch (Exception e) {
		Trigger.new[0].Signer__c.addError('Error : Check Setting');
	}


    

 

 

Someone please help me in my first attempt at a test class.

I have a apex class that only contain two functions that only returns data not set.

global class ItemsApprove {
private final string UserID = UserInfo.getUserId();
private List<ProcessInstance> ProcessInstanceID  {get; set;}
public String getUserID() {return UserID;}

        public ItemsApprove(){}

        public List<Form__c> getFSData() {
        Set<ID> getID = new Set<Id>();
             .
             .
             .   
             return FSData;
        }
          
        public List<ProcessInstance> getProcessInstance() {
             ...
           return ProcessInstanceID;
        }                                                   
}

 and this is my poor attempt on the test class, which doesn't save to the server.

 

  	PageReference pageRef2 = Page.success;
      	Test.setCurrentPage(pageRef2);
      
      	ItemsToApprove Itemcontroller = new ItemsApprove ();
      	
       
        Itemcontroller = new ItemsApprove();
      	Itemcontroller.getFFData();
      	Itemcontroller.getProcessInstance();

 

I have a button in SF that execute a javascript that then execute a apex code like this.

 

sforce.apex.execute("SFA.Operations", "AuthorizeOpportunity_Click", {OpportunityId: "{!Opportunity.Id}" });

 

I want to know if there is a way to also to execute that apex and pass those parameter through the API?

I want to be able to parse strings base on tags in PHP.

 

So, I have a long text area field that text like this.

 

abc </p> def

abc123

 

When i do a select, the tags are automatically remove the "</p>".

 

Any ideas?

I have a trigger I just created, I didn't create a test class for it because it passed with 100% coverage, and all the test classes were written by someone else

 

When It comes to deploying it, I get failures from classes that is not touch by the trigger.

 

Here is the log:

   File Name:    triggers/TotalRecruitingGoal.trigger
   Full Name:  TotalRecruitingGoal
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a
# Test Results:
Run Failures:
  MyProfilePageController.testSave System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Please enter a first name: [FirstName]
  TestManagement5.DeleteTeam System.DmlException: Delete failed. First exception on row 0 with id a0240000007jGFKAA2; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, TotalRecruitingGoal: execution of BeforeDelete
caused by: System.NullPointerException: Attempt to de-reference a null object
Trigger.TotalRecruitingGoal: line 30, column 17: []

 

Any ideas?

In my VF page i am using these two calls.


<apex:relatedList list="Applications__r"/> <apex:relatedList list="Registrations__r"/>

 

For some reason any records that is listed in the related list Registrations, under the Details column where the "View" link is, has the path to that record in the relative format to the VF page

 

ex "https://c.na2.visual.force.com/apex/a0040000xxxxx"

 

Where as in the Applications records they are correct where they are in this format

 

ex "https://na2.salesforce.com/a0940xxxxxxxxx"

 

 

Any ideas as to why?

 

 

I have an Apex class that returns a SOQL Set List, where it is display by VF page.

 

I even tried setting the "Enable Profile Access for Apex Class", and enabling that profile the non System Administrator profile, still till I get nothing.

 

The data is only showing if I change the profile of that user to a "System Administrator", but  not for users who are not of System Administrator  profile.

 

below is my code if it helps, let me know:

 

private final string UserID = UserInfo.getUserId();
private List<ProcessInstance> ProcessInstanceID  {get; set;}
public String getUserID() {return UserID;}

        public ItemsToApproveFF(){  
        
        }

        public List<Financial_Form__c> getFFData() {
        Set<ID> getID = new Set<Id>();
                
                for(ProcessInstance a : getProcessInstance()){
                        getID.add(a.TargetObjectId);
                }

                
                List<Financial__c> FFData = [SELECT getReceiptDocLink__c, Name, Company__c, Form_Type_del__c 
                                    FROM Financial__c
                                        Where Id IN :getID];

             return FFData;
        }
          
        public List<ProcessInstance> getProcessInstance() {
           ProcessInstanceID = [SELECT TargetObjectId 
                                    FROM ProcessInstance 
                                        Where Id IN (SELECT ProcessInstanceId 
                                                        FROM ProcessInstanceWorkitem 
                                                            Where ActorId = :UserID)];
           return ProcessInstanceID;
        }
                                                            

 


 


I want to be able query starting 2 weeks ago and prior.

This example

Select Name From Contacts Where CreatedDate <= LAST_N_DAYS:14

This would query me everything from Today() till Today()-14Days.


What I really need is everything that is prior (Today()-14Days).

 

 

 

 

I want to have a send email message in a function that gets executed whenever the button is press in VF. But nothing happens, I even put in a few system debug, but it doesn't seem to be called when I look into the developer console. Any Ideas?

 

...	
        public EasySendEmail(ApexPages.StandardController controller){
		this.con=(Contact)controller.getRecord();
	}
	
	
	public PageReference SendEmail(){
		Contact recipient = [SELECT id, firstname FROM Contact Where Id = '003f00000039EQcAAM'];
		
		system.debug('debug--->' + UserInfo.getUserId());
		Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();	
		mail.setTargetObjectId(recipient.Id);

		mail.setTemplateId('00Xf0000000DZTt');
        		system.debug('mail--->' + mail);
		Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
		
		return new PageReference('/' + con.id);

	}
...

 

    public List<SelectOption>  getContactItems(){
        
        List<SelectOption> options = new List<SelectOption>();
          options.add(new SelectOption('CANADA','Canada'));
        options.add(new SelectOption('MEXICO','Mexico'));
        return options;
    }

    public String[] getContactInfo() {
            return contact;
    }
            
    public void setContactInfo(String[] contact) {
            this.contact = contact;
    }

 

 

<apex:page standardcontroller="Contact" extensions="EasySendEmail">
   
    <apex:form >
           <apex:selectList value="{!ContactInfo}" size="1">
                <apex:selectOptions value="{!ContactItems}"/>
            </apex:selectList> 
              
            
            <br /><br />    
            <apex:commandButton value="Send Email!" action="{!SendEmail}" reRender="fake" />

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

 

What I am trying to do is pull information from at least two different (standard and custom) objects similar to the examples seen here:

http://www.salesforce.com/docs/developer/cookbook/Content/vf_multi_record_edit.htm

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

 

So, what I want to do is have one button to save the chances of both objects at the same time. Is that feasable? 

 

I have a hard time figuring out how the data is being set as the save method is being called.

So I have this trigger, which makes a call to a Apex class, which makes a SOQL whenver the function/method is called

 

Apex:

		for(Integer x = 0; x < Trigger.new.size(); x++){
....
			if (ZipCode != NULL && PriBoro == NULL){
				ZipCodeList fillPriBoro = new ZipCodeList();
				fillPriBoro.ZipCode = ZipCode;
				trigger.new[x].Primary_Borough__c = fillPriBoro.getBorough();
			}	
....

 In the ZipCodeList:

public with sharing class ZipCodeList {
...
public ZipCodeList(){}

	public string getBorough (){
		if (ZipCode.length()>=5)
			ZipCode = ZipCode.substring(0, 5);
		
		Borough = [SELECT Borough__c FROM Address__c WHERE Zip_Code__c = :ZipCode];
		
		if (Borough.size()>=1){
			return Borough[0].Borough__c;
		}else {
			return NULL;
		}
	}
	
...
}

 So i read somewhere that in my case everytime that for loop is called from the trigger, it makes soql query call.

 

How would i approach this when each time i call this apex class, I alway need it to return that one Borough data.

 

Hello,

 

I'm having trouble with the following code. I'm fairly new to development so please bare with me.

 

private String abcd; 

private List <WorkReason__c> wrReason;

 

abcd = "Example"

 

wrReason = [Select Name from WorkReason__c where Name = abcd];

 

i''m getting an error where Name = abcd. Are we not allowed to use a varaible in place of      'string value' ?



 

I want to be able to parse strings base on tags in PHP.

 

So, I have a long text area field that text like this.

 

abc </p> def

abc123

 

When i do a select, the tags are automatically remove the "</p>".

 

Any ideas?

I have an Apex class that returns a SOQL Set List, where it is display by VF page.

 

I even tried setting the "Enable Profile Access for Apex Class", and enabling that profile the non System Administrator profile, still till I get nothing.

 

The data is only showing if I change the profile of that user to a "System Administrator", but  not for users who are not of System Administrator  profile.

 

below is my code if it helps, let me know:

 

private final string UserID = UserInfo.getUserId();
private List<ProcessInstance> ProcessInstanceID  {get; set;}
public String getUserID() {return UserID;}

        public ItemsToApproveFF(){  
        
        }

        public List<Financial_Form__c> getFFData() {
        Set<ID> getID = new Set<Id>();
                
                for(ProcessInstance a : getProcessInstance()){
                        getID.add(a.TargetObjectId);
                }

                
                List<Financial__c> FFData = [SELECT getReceiptDocLink__c, Name, Company__c, Form_Type_del__c 
                                    FROM Financial__c
                                        Where Id IN :getID];

             return FFData;
        }
          
        public List<ProcessInstance> getProcessInstance() {
           ProcessInstanceID = [SELECT TargetObjectId 
                                    FROM ProcessInstance 
                                        Where Id IN (SELECT ProcessInstanceId 
                                                        FROM ProcessInstanceWorkitem 
                                                            Where ActorId = :UserID)];
           return ProcessInstanceID;
        }
                                                            

 


 


Is it possible to display a visualforce page, such as a pie chart, outside of salesforce (like on a website)?

 

What are the constraints?

We would like to include parent fields to the "items to approve" dashboard component. Right now it is only possible to add fields which are related to the approval process itself. Apparantly the only way to do this is by using Visualforce.

 

 

 

Problem is that my knowledge of Visualforce is very limited. Could someone give me a little hand with this, try to push me in the right direction? Really appreciated!

 

 

Thanks!

I'm passing in a SalesForce session ID and session URL to an Intranet page as a means of authenticating the current user.

 

This is the code I am using for that:

 

 

require_once (SALESFORCE_SOAPCLIENT_BASEDIR.'/SforceEnterpriseClient.php'); $mySforceConnection = new SforceEnterpriseClient(); $mySoapClient = $mySforceConnection->createConnection(SALESFORCE_SOAPCLIENT_URL.'/enterprise.wsdl.xml'); $mySforceConnection->setSessionHeader($sessionId);

$mySforceConnection->setEndpoint($sessionUrl);

 

That successfully logs in the current user, now I want to try to pull some contact records from the database, so I use this code:

 

$contactResult = $mySforceConnection->query("SELECT Formula_Field_Name__c, Name, Id FROM Contact LIMIT 50"); if (count($contactResult->records)) { foreach ($contactResult->records as $record) { echo '<pre>'; print_r($record); echo '</pre><hr>'; } }

 

 In the print_r output, I'll get Name and Id -- but the Formula field is no where to be found. At first I thought maybe I didn't spell it correctly, so I tried adding random characters to the fieldname to ensure it would create an error, which id did. So I know I am spelling the field correct, I just can't get it to show up in the results.

 

The host I am on is using PHP 5.2.6, can someone exaplain what I need to do to fix this? Any help is much apprciated.