• kpr
  • NEWBIE
  • 105 Points
  • Member since 2009

  • Chatter
    Feed
  • 4
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 52
    Replies

Hi

 

I am having two extensions for two different visualforce pages.

In extension class 1 i am having a list which I want to use in extnsion class 2.

How can i retrieve the values of that List in extension class 2?

 

I declared that list as global in extension 1 and tried to use it but it always comes null.

In what other ways can i get that values in extension 2?

 

Looking forward to your expert solutions.

My organization doesn't have a need for the "Assign using active assignment rule" button--is it possible to remove or hide it from the New Lead page?

Ok So I have 2 objects X and Y. When 2 fields on X are updated I want to Change 2 fields on Y and I am having a bit of trouble wrapping my head arround the code. Both X and Y have a field that is a unique Idenfier and they are the same for both objects. so X and Y may have a field "uniqueId" and if they are tied its = 123 for both. Heres what I am thinking but it seems to be failing can someone tell me whats wrong here. 

 

 

trigger UpdateYwhenXChanges on X__c (after update) { List<Y__c> yObj= new List<Y__c>(); for (X__c changeRec: Trigger.New) { yObj.update(y__c(field1=changeRec.field1, field2=changeRec.field2 where UniqueId=changeRec.UniqueId)); update yObj; } }

 

Any Help or just a code sample of something similar would be great.


Thanks

 

Hi,

I got a requirement to build a .NET client to query data from Salesforce.com. SSL is preferred for this.

 

I have experience with SSL when making callouts from Salesforce, which can be managed using the 'Certificate and Key Management' under Salesforce setup.

 

But if SSL needs to be used with Salesforce as a web service provider, how do we do it? Does it mean it can be used instead of the username/password authentication? Or would I still have to use username/password authentication with SSL?

 

Thanks in advance,

kpr

  • October 10, 2013
  • Like
  • 0

Hi all,

 

I saw this blog post about using forms in Salesforce:

http://wiki.developerforce.com/page/Adobe_XFDF

 

How do I figure out the field names for the forms? Say I download W2 form from the web, Is there a tool that tells me the field names from this form, so I could plug into the XFDF?

 

Also is it possible to generate a pdf form using visualforce? Not an attachment of an existing form, but a form from scratch, so it has certain editable fields and certain read-only values populated using data from Salesforce?

 

Thanks in advance,

kpr

  • January 15, 2013
  • Like
  • 0

Hi,

 

I'm trying to encode text a user would input in an inputtext field, so that it doesn't allow malicious characters.

 

This is the input field
<input type="text" id="custAttType" />

In my script tag, I use this:
var custType = $('#custAttType').val();             
var custTypeValue = {!JSINHTMLENCODE(custType)};

 

 

However I get this error:


Error: Unknown property 'MyTypes__cStandardController.custType'

 

I tried different ways, but with the same error:

var custTypeValue = "{!JSINHTMLENCODE(custType)}";

var custTypeValue = {!JSINHTMLENCODE(custType+'')};

 

Am I using the function right?

 

Thanks in advance

kpr

  • November 03, 2011
  • Like
  • 1

I'm trying to make a callout to an RPC style service. I get a 503 error saying connection refused. Is it something on my side or the web service issue?

 

Here's my code:

String requestBody;
requestBody =  '<soap:Envelope xmlns:soap=' + '\'' + 'http://schemas.xmlsoap.org/soap/envelope/'  + '\'' + ' xmlns:xsi=' + '\'';
requestBody += 'http://www.w3.org/2001/XMLSchema-instance'  + '>';//'\'' + ' xmlns:xsd=' + '\''+ 'http://www.w3.org/2001/XMLSchema' + '\'' + '>';
requestBody = '<soap:Body><GetAvailabilityRQ xmlns="http://www.passkey.com/apiSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">';
requestBody += '<Security><Login><UserName>username</UserName><Password>password</Password></Login><PartnerID>1111</PartnerID><Token>111111</Token></Security>';
requestBody += '<Message><Version>4.00.00</Version><Mode>S</Mode><OP>GetHousingAvailability</OP><Service>GetHousingAvailability</Service><Locale>EN_US</Locale></Message>';
requestBody += '<Data><GetAvailability><EventID>12333</EventID><AttendeeCode>att1</AttendeeCode><StartDate>2011-08-28</StartDate><EndDate>2011-08-30</EndDate></GetAvailability></Data>';
requestBody += '</GetAvailabilityRQ></soap:Body></soap:Envelope>';
 
Http h = new Http();
HttpRequest request = new HttpRequest();
request.setBody(requestBody);
request.setEndpoint('http://training-api.passkey.com/axis/services/HousingAvailabilityService');
request.setMethod('GET');
request.setHeader('Content-length', '1753' );
request.setHeader('Content-Type', 'text/xml;charset=UTF-8'); 
request.setHeader('SOAPAction','');

HttpResponse response = h.send(request);
 System.debug(response.getBody());    

 

 I get this error:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The requested URL could not be retrieved</TITLE>
<STYLE type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>
</HEAD><BODY>
<H1>ERROR</H1>
<H2>The requested URL could not be retrieved</H2>
<HR noshade size="1px">
<P>
While trying to retrieve the URL:
<A HREF="http://training-api.passkey.com/axis/services/HousingAvailabilityService">http://training-api.passkey.com/axis/services/HousingAvailabilityService</A>
<P>
The following error was encountered:
<UL>
<LI>
<STRONG>
Connection to 209.51.243.33 Failed
</STRONG>
</UL>

<P>
The system returned:
<PRE><I>    (111) Connection refused</I></PRE>

<P>
The remote host or network may be down.  Please try the request again.
<P>Your cache administrator is <A HREF="mailto:support@salesforce.com">support@salesforce.com</A>. 

<BR clear="all">
<HR noshade size="1px">
<ADDRESS>
Generated Thu, 04 Aug 2011 03:20:15 GMT by proxy-was.net.salesforce.com (squid)
</ADDRESS>
</BODY></HTML>

 It says the host or network might be down. But I've been trying since morning, so this is unlikely to be the case. Is there any issue with the way I'm calling this service?

 

Thanks in advance

kpr

  • August 04, 2011
  • Like
  • 0

I am trying to use the 'Login with Facebook' button on my visualforce, which will ultimately be used on sites.

But I get the following error:

Error: Unknown component fb:login-button

 

I already searched the forum and this is the only sample I found:

http://208.74.204.95/t5/Force-com-Sites/Integrating-with-facebook-a-pain-Visualforce-compiler-gets-in/m-p/198366

 

I tried using the methods in there too, but they didn't work.

 

Here's my code:

<apex:page >
  
  <div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({appId: 'my_app_id', status: true, cookie: true,
             xfbml: true});
    FB.getLoginStatus(function(response) {
      if (response.session) {
        console.log('logged in and connected user, someone you know');
      } else {
        console.log('no user session available, someone you dont know');
      }
   }); 
    
  (function() {
    var e = document.createElement('script'); e.async = true;
    e.src=document.location.protocol +
      '//connect.facebook.net/en_US/all.js';
    document.getElementById('fb-root').appendChild(e);
  }());
 

</script>

<div xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
 <fb:login-button show-faces="false" width="200" max-rows="1"></fb:login-button>
</div>
<script src="http://connect.facebook.net/en_US/all.js#appId=147159395362207&amp;xfbml=1"></script>

</apex:page>

 

Can anyone help me out please?

 

Thanks in advance

kpr

  • July 15, 2011
  • Like
  • 0

Hi,

 

I was able to develop a trigger to update the whatId of a Task associated with a Lead to that of an Account. The trigger works fine when I create a Task for a lead through the UI.(The trigger sets the whatId to that of an Account and executes successfully). But the same trigger fails when I try to invoke it using a test method. 

 

I even tried inserting Tasks using Dataloader and the trigger worked fine for this case too....only the test method wouldn't work. This is weird and I'm unable to develop a real test case for my trigger. Can anyone help please?  

  • March 29, 2010
  • Like
  • 0

I have overridden the 'Add Product' functionality in Opportunity and for this I have a visualforce page (using a controller extension) which has a few command buttons that invoke action methods to do the searching of products.

 

The issue is, 'sometimes' when I click on one of the action methods, the constructor of the extension is run and the id in the url is missing and so the query I have in the constructor returns no rows.

 

opportunityId = ApexPages.currentPage().getParameters().get('id');
thisOpp=[select id,Pricebook2Id,accountId,ownerId,Name,StageName,Approval_Status__c,Account.Channel__c,Account.BusinessUnit__c,Account.Cust_group__c,Account.Local_Currency__c,Account.Tier__c,Account.Pricebook_Id__c,Account.Slotting_SKUs__c,Meeting_Date__c,CloseDate,Probability,Type,Description,NextStep,CampaignId from Opportunity where id =:opportunityId];

 

This doesn't happen always---only sometimes

 

This also occurs sometimes when navigating from one page to another, whether the pages are using the same controller extension or a different one.

 

I am using the following syntax to navigate from one page to another:

 

Pagereference p = new Pagereference ('/apex/SelectOpportunityProducts?id='+opportunityId);

 

Can anyone help me out please?I have an  urgent production issue and I haven't seen this issue earlier while testing in sandbox or production.

 

 

 

 

Message Edited by kpr on 01-13-2010 07:49 AM
Message Edited by kpr on 01-13-2010 08:48 AM
  • January 13, 2010
  • Like
  • 0

Hi

I tried to use the SetController to pull up PricebookEntries from a Pricebook. I get the error “List controllers are not supported for PricebookEntry”.

 

I am trying to customize the 'Add Product' functionality to an Opportunity and am trying to select PriceBookEntries from a PriceBook to be displayed this way. The PriceBook has about 5000 products and I wanted to leverage the SetController functionality for this.

 

Is this functionality going to be added at all?

Meanwhile can anyone suggest me a work around for this?

 

Thanks

Message Edited by kpr on 10-21-2009 07:08 AM
  • October 21, 2009
  • Like
  • 0

Hi,

 

I have a use case, wherein, if an opportunity record is approved once, the user shouldn't be able to submit it again for approval.

 

Standard functionality allows resubmitting an approved record.

 

I know I can prevent it if I use Apex to submit the Approval. But then I'd have to develop custom page too. I want to leverage the standard page and functionality, but want this extra feature. 

 

Can anyone suggest a method with standard functionality to do it?

 

Thanks in advance

Message Edited by kpr on 09-23-2009 08:44 PM
  • September 24, 2009
  • Like
  • 0

Hi,

 

I am new to visualforce development. I am having an issue with fetching more than 1000 records from database to be displayed on a visualforce page.

 

I am getting the exception 'System.Exception: collection exceeds maximum size: 1001'

 

Can anyone help me?

Here is the code snippet:

 

public void getProductLists(){
//Each iteration of the outer for loop fetches 1000 records....There are about 10K records in total
for(List<PricebookEntry> allProducts : [Select p.Product2Id,p.Product2.Name,p.Product2.Description,p.Product2.Family From PricebookEntry p where p.Pricebook2Id =: chObj.PriceBook_Id__c])
{

for(PricebookEntry p:allProductsList){
if(recommendedProductMap.containsKey(p.Product2Id) ){
recommendedProductsList.add(new sProduct(p));
}
else{
//Now after filtering, this list should contain some 5K+ records.But I get the exception 'System.Exception: collection exceeds maximum size: 1001'
allOtherProductsList.add(new sProduct(p));

}

}

}

 

 

 

  • August 26, 2009
  • Like
  • 0

Hi,

 

Can anyone tell me where to find the complete schema for a visualforce page?I mean, which element can have which child elements,etc?

 

Message Edited by kpr on 08-16-2009 04:40 AM
  • August 16, 2009
  • Like
  • 0

Hi,

 

I'm trying to encode text a user would input in an inputtext field, so that it doesn't allow malicious characters.

 

This is the input field
<input type="text" id="custAttType" />

In my script tag, I use this:
var custType = $('#custAttType').val();             
var custTypeValue = {!JSINHTMLENCODE(custType)};

 

 

However I get this error:


Error: Unknown property 'MyTypes__cStandardController.custType'

 

I tried different ways, but with the same error:

var custTypeValue = "{!JSINHTMLENCODE(custType)}";

var custTypeValue = {!JSINHTMLENCODE(custType+'')};

 

Am I using the function right?

 

Thanks in advance

kpr

  • November 03, 2011
  • Like
  • 1

Hi,

I got a requirement to build a .NET client to query data from Salesforce.com. SSL is preferred for this.

 

I have experience with SSL when making callouts from Salesforce, which can be managed using the 'Certificate and Key Management' under Salesforce setup.

 

But if SSL needs to be used with Salesforce as a web service provider, how do we do it? Does it mean it can be used instead of the username/password authentication? Or would I still have to use username/password authentication with SSL?

 

Thanks in advance,

kpr

  • October 10, 2013
  • Like
  • 0

Hello , I have a big problem. When i try to make a query in the rest api from apex salesforce, the VF return me a error: Read timed out .

This is my code:

 

httprequest req = new httprequest();
        req.setEndpoint('https://cs4.salesforce.com/services/data/v22.0/query/?q=SELECT Id, (SELECT Id, StepStatus, Comments, OriginalActorId, CreatedDate FROM Steps where StepStatus!=\'Started\' AND StepStatus != \'Reassigned\' Order by CreatedDate Desc) FROM ProcessInstance Where TargetObjectId = \''+TargetObjectId+'\' Order by CreatedDate Desc');
        req.setMethod('GET');
        req.setHeader('Authorization', 'OAuth ' + token);
        req.setTimeout(60000);
 

 

If I try to do a next request, work fine:

 

https://cs4.salesforce.com/services/data/v22.0/sobject/Case/XXXXX

 

But if I try to make a query, return me the timeout error, WHY?

 

Thanks.

  • October 18, 2011
  • Like
  • 0

Is there a way to pass a LIST into a javascript array and be able to access the fields from the javascript array?

 

So the controller would have something like...

public LIST<Account> acct {get; set;}
acct = [SELECT Id, Name, Field1 FROM Account];

 

 

 

Then the visual force page will have something like..

<script> var result = [] </script>

<apex:repeat value="{!acct}" var="acctitem">
<script>
result[idx2++] = "{!acctitem}";
</script>    
</apex:repeat>

 

 

So that when the JavaScript array is initialized, I can do something like

 

 

result[0].Id

result[0].Name



result[1].Id

result[1].Name

I am  trying to upsert a salesforce by web service.

but I get the following error

UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService

 

Any ideas?

 

Detail Below

 
【Binding Operation Property】
<implementation xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" type="Invoke">
  <serverUri>※I wrote return message by login </serverUri>
  <soapaction>""</soapaction>
  <authenticationType>Anonymous</authenticationType>
  <userId>※ Iwrote userId</userId>
  <password>※ Iwrote password</password>
  <host>×.×.×.×</host>
  <port>80</port>
  <charset>UTF-8</charset>
</implementation>


【Soap Request】

<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP:Header>
    <DebuggingHeader xmlns="urn:enterprise.soap.sforce.com">
      <debugLevel>none</debugLevel>
    </DebuggingHeader>
    <DisableFeedTrackingHeader xmlns="urn:enterprise.soap.sforce.com">
      <disableFeedTracking>0</disableFeedTracking>
    </DisableFeedTrackingHeader>
    <PackageVersionHeader xmlns="urn:enterprise.soap.sforce.com">
      <packageVersions>
        <majorNumber>0</majorNumber>
        <minorNumber>0</minorNumber>
        <namespace></namespace>
      </packageVersions>
    </PackageVersionHeader>
    <AssignmentRuleHeader xmlns="urn:enterprise.soap.sforce.com">
      <assignmentRuleId></assignmentRuleId>
      <useDefaultRule>0</useDefaultRule>
    </AssignmentRuleHeader>
    <EmailHeader xmlns="urn:enterprise.soap.sforce.com">
      <triggerAutoResponseEmail>0</triggerAutoResponseEmail>
      <triggerOtherEmail>0</triggerOtherEmail>
      <triggerUserEmail>0</triggerUserEmail>
    </EmailHeader>
    <SessionHeader xmlns="urn:enterprise.soap.sforce.com">
      <sessionId>※I wrote return message by login </sessionId>
    </SessionHeader>
    <AllOrNoneHeader xmlns="urn:enterprise.soap.sforce.com">
      <allOrNone>1</allOrNone>
    </AllOrNoneHeader>
    <AllowFieldTruncationHeader xmlns="urn:enterprise.soap.sforce.com">
      <allowFieldTruncation>1</allowFieldTruncation>
    </AllowFieldTruncationHeader>
    <MruHeader xmlns="urn:enterprise.soap.sforce.com">
      <updateMru>false</updateMru>
    </MruHeader>
  </SOAP:Header>
  <SOAP:Body>
    <upsert xmlns="urn:enterprise.soap.sforce.com">
      <externalIDFieldName>Id</externalIDFieldName>
      <sObjects xsi:type="Account">
  <Fax>03-1111-1111</Fax>
  <Name>AAA</Name>
  <Phone></Phone>
  <Id></Id>
      </sObjects>
    </upsert>
  </SOAP:Body>
</SOAP:Envelope>

 

 

【Response Message】

 <data>
 <SOAP:Fault xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" >
<faultcode xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" >ns0:Server</faultcode>
<faultstring xml:lang="en-US" >UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService.</faultstring>
<faultactor>urn:enterprise.soap.sforce.com</faultactor>
 <detail>
 <cordys:FaultDetails xmlns:cordys="http://schemas.cordys.com/General/1.0/" >
 <cordys:LocalizableMessage xmlns:cordys="http://schemas.cordys.com/General/1.0/" >
<cordys:MessageCode xmlns:cordys="http://schemas.cordys.com/General/1.0/" >Cordys.UDDI.Messages.generalException</cordys:MessageCode>
<cordys:Insertion xmlns:cordys="http://schemas.cordys.com/General/1.0/" >UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService</cordys:Insertion>
</cordys:LocalizableMessage>
</cordys:FaultDetails>
<externalFaultCode>UNKNOWN_EXCEPTION</externalFaultCode>
 <sf:UnexpectedErrorFault xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xsi:type="sf:UnexpectedErrorFault" >
<sf:exceptionCode>UNKNOWN_EXCEPTION</sf:exceptionCode>
<sf:exceptionMessage>Destination URL not reset. The URL returned from login must be set in the SforceService</sf:exceptionMessage>
</sf:UnexpectedErrorFault>
</detail>
</SOAP:Fault>
</data>
 
 
Thanks.
  • August 25, 2011
  • Like
  • 0

I'm trying to make a callout to an RPC style service. I get a 503 error saying connection refused. Is it something on my side or the web service issue?

 

Here's my code:

String requestBody;
requestBody =  '<soap:Envelope xmlns:soap=' + '\'' + 'http://schemas.xmlsoap.org/soap/envelope/'  + '\'' + ' xmlns:xsi=' + '\'';
requestBody += 'http://www.w3.org/2001/XMLSchema-instance'  + '>';//'\'' + ' xmlns:xsd=' + '\''+ 'http://www.w3.org/2001/XMLSchema' + '\'' + '>';
requestBody = '<soap:Body><GetAvailabilityRQ xmlns="http://www.passkey.com/apiSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">';
requestBody += '<Security><Login><UserName>username</UserName><Password>password</Password></Login><PartnerID>1111</PartnerID><Token>111111</Token></Security>';
requestBody += '<Message><Version>4.00.00</Version><Mode>S</Mode><OP>GetHousingAvailability</OP><Service>GetHousingAvailability</Service><Locale>EN_US</Locale></Message>';
requestBody += '<Data><GetAvailability><EventID>12333</EventID><AttendeeCode>att1</AttendeeCode><StartDate>2011-08-28</StartDate><EndDate>2011-08-30</EndDate></GetAvailability></Data>';
requestBody += '</GetAvailabilityRQ></soap:Body></soap:Envelope>';
 
Http h = new Http();
HttpRequest request = new HttpRequest();
request.setBody(requestBody);
request.setEndpoint('http://training-api.passkey.com/axis/services/HousingAvailabilityService');
request.setMethod('GET');
request.setHeader('Content-length', '1753' );
request.setHeader('Content-Type', 'text/xml;charset=UTF-8'); 
request.setHeader('SOAPAction','');

HttpResponse response = h.send(request);
 System.debug(response.getBody());    

 

 I get this error:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The requested URL could not be retrieved</TITLE>
<STYLE type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>
</HEAD><BODY>
<H1>ERROR</H1>
<H2>The requested URL could not be retrieved</H2>
<HR noshade size="1px">
<P>
While trying to retrieve the URL:
<A HREF="http://training-api.passkey.com/axis/services/HousingAvailabilityService">http://training-api.passkey.com/axis/services/HousingAvailabilityService</A>
<P>
The following error was encountered:
<UL>
<LI>
<STRONG>
Connection to 209.51.243.33 Failed
</STRONG>
</UL>

<P>
The system returned:
<PRE><I>    (111) Connection refused</I></PRE>

<P>
The remote host or network may be down.  Please try the request again.
<P>Your cache administrator is <A HREF="mailto:support@salesforce.com">support@salesforce.com</A>. 

<BR clear="all">
<HR noshade size="1px">
<ADDRESS>
Generated Thu, 04 Aug 2011 03:20:15 GMT by proxy-was.net.salesforce.com (squid)
</ADDRESS>
</BODY></HTML>

 It says the host or network might be down. But I've been trying since morning, so this is unlikely to be the case. Is there any issue with the way I'm calling this service?

 

Thanks in advance

kpr

  • August 04, 2011
  • Like
  • 0

I am trying to use the 'Login with Facebook' button on my visualforce, which will ultimately be used on sites.

But I get the following error:

Error: Unknown component fb:login-button

 

I already searched the forum and this is the only sample I found:

http://208.74.204.95/t5/Force-com-Sites/Integrating-with-facebook-a-pain-Visualforce-compiler-gets-in/m-p/198366

 

I tried using the methods in there too, but they didn't work.

 

Here's my code:

<apex:page >
  
  <div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({appId: 'my_app_id', status: true, cookie: true,
             xfbml: true});
    FB.getLoginStatus(function(response) {
      if (response.session) {
        console.log('logged in and connected user, someone you know');
      } else {
        console.log('no user session available, someone you dont know');
      }
   }); 
    
  (function() {
    var e = document.createElement('script'); e.async = true;
    e.src=document.location.protocol +
      '//connect.facebook.net/en_US/all.js';
    document.getElementById('fb-root').appendChild(e);
  }());
 

</script>

<div xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
 <fb:login-button show-faces="false" width="200" max-rows="1"></fb:login-button>
</div>
<script src="http://connect.facebook.net/en_US/all.js#appId=147159395362207&amp;xfbml=1"></script>

</apex:page>

 

Can anyone help me out please?

 

Thanks in advance

kpr

  • July 15, 2011
  • Like
  • 0

I understand that salesforce can be an Oauth 'provider' in that they can respond to authentication requests which include a username and password, with a token response.  What I am looking for is to use Oauth to authenticate Customer Portal users against a 3rd party Oauth 'provider', in this case, Google.

 

I want anyone with a Google account to be able to create, and link a salesforce Customer Portal account with their Google account.  I don't want salesforce to create a username and password for them, but to accept the token that is returned from Google once the user logs in there.

 

Is that possible?  

 

On a side note... Once authenticated, I would like the user to be able to update force.com data about themselves.  Technically speaking I might not need authenticated site users, a.k.a. Customer Portal users to do this.

Is it possible to view the value of individual bytes in a blob? We are trying to store a series of values within a blob and then reference them by looking at a range of bytes in that blob. Any ideas? Thanks, Barry
  • January 30, 2011
  • Like
  • 0

I want to create a task within Apex, and want it to be associated with an opportunity. I'm using code as follows (assuming o is a reference to a valid Opportunity):

 

 

Task t = new Task(    
  Subject = 'Subject of task',
  WhatId = o.Id,
  Description = 'This is the description text',
  Status = 'Not Started');

insert t;

This works fine, the task is created. However, if I create an After Insert trigger on the task, the task's What.Type property is null, instead of "Opportunity". The WhatId property correctly references the opportunity's ID.

 

Am I missing a step?

 

 

Hi

 

I am having two extensions for two different visualforce pages.

In extension class 1 i am having a list which I want to use in extnsion class 2.

How can i retrieve the values of that List in extension class 2?

 

I declared that list as global in extension 1 and tried to use it but it always comes null.

In what other ways can i get that values in extension 2?

 

Looking forward to your expert solutions.

Hi,

 

We tried to implement a single sign on mechanism of a third party web solution using the Crypto.encrypt method. The third party solution requires that the initialization vector is XOR encoded into the first 16 bytes of the transmitted SSO Token. In java this would be done like this:

 

 

for (int i = 0; i < 16; i++) {
   data[i] ^= INIT_VECTOR[i];
}

 

 

where data and INIT_VECTOR would be byte arrays. In Apex there's nothing like a byte array and Blob has no methods at all. The XOR operator ^ does exist in Apex but it can only be used with Boolean expressions and Integers. So I can't just use the Strings and do some wild XOR character operations. Does anybody know how I can implement an XOR encryption like in Java or any other programming language using Apex?

 

Thanks for your help and best regards,

Henry

Hi,

 

I try to list all the account.Name, Opportunity.Name, CaseNumber, and Tasks that associated with the Case.

 

I did somethink wrong in my query which only list account.Name, Opportunity.Name, CaseNumber, but NOT tasks. 

 

select account.Name, (select Opportunity.Name from Account.Opportunities),  (Select CaseNumber from Cases), (select Task.Subject from Tasks)  from Account

 

Please help,

Hi,

 

I was able to develop a trigger to update the whatId of a Task associated with a Lead to that of an Account. The trigger works fine when I create a Task for a lead through the UI.(The trigger sets the whatId to that of an Account and executes successfully). But the same trigger fails when I try to invoke it using a test method. 

 

I even tried inserting Tasks using Dataloader and the trigger worked fine for this case too....only the test method wouldn't work. This is weird and I'm unable to develop a real test case for my trigger. Can anyone help please?  

  • March 29, 2010
  • Like
  • 0

Hi gurus..

 

I had a new requirement by my client the other day...

he had these PDF forms in which you can type in data. He wants the data in these PDF forms to be automatically populated when mailing to his customers. The data should be filled in on the basis of the Customer Record that he is in.

 

I have done similar implementation for Word Docs through Mail Merge. However, I am stuck on the PDF part. I can't run a mail merge on PDF forms.

 

Any ideas..??

 

Regards

I'm getting an errormessage in a livesystem like the following:

 

System.DmlException: Update failed. First exception on row 0 with id a0z20000000I9HGAA0; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record

 

This line which causes the error is doing an update to an objekt. This whole code is to complex to paste in here, but I can poste the progress:

 

This method is a future method: It's getting all data in a List, looping through every entry, change values, add to a new list, and after loop is closed it's updating to Database.

 

There is no trigger with before update or something else. 

 

Is there a special order to know for methods called as future?

 

 

 

Hi

 

I'm building in authentication using Customer Portal - and the Site class.  This provides methods for logging in, and registration.

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_sites.htm

 

However, I can't find out how to log out. There is no log out method.  How can I do that?

 

Thanks

Jon

Note : Following is a small development being carried out to demystify salesforce apex webservice and callout features, please correct me if you find my understanding to be incorrect.

 

I am trying to integrate two Salesforce Orgs using Apex. Apex supports both callouts and webservices, then why not leverage both to achieve a 360 connectivity between two Salesforce instances.

 

Org1 : Create a Apex Web Service, Generate its WSDL

global class AccountPlan {

webservice String area;
webservice String region;

//Define an object in apex that is exposed in apex web service
global class Plan {
webservice String name;
webservice Integer planNumber;
webservice Date planningPeriod;
webservice Id planId;
}

webservice static Plan createAccountPlan(Plan vPlan) {

//A plan maps to the Account object in salesforce.com.
//So need to map the Plan class object to Account standard object
Account acct = new Account();
acct.Name = vPlan.name;
acct.AccountNumber = String.valueOf(vPlan.planNumber);
insert acct;

vPlan.planId=acct.Id;
return vPlan;
}

}

 

Org2:  Consume above generated WSDL to generate following Apex Class viz.,AccountPlanClasses

public class AccountPlanClasses {
public class LogInfo {
public String category;
public String level;
private String[] category_type_info = new String[]{'category','http://soap.sforce.com/schemas/class/TCSSAAS/AccountPlan','LogCategory','1','1','false'};
private String[] level_type_info = new String[]{'level','http://soap.sforce.com/schemas/class/TCSSAAS/AccountPlan','LogCategoryLevel','1','1','false'};
private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/TCSSAAS/AccountPlan','true','false'};
private String[] field_order_type_info = new String[]{'category','level'};
}
public class AllowFieldTruncationHeader_element {
............................
............................

 

Now lets try to connect to Org1 from Org2

AccountPlanClasses.Plan plan = new AccountPlanClasses.Plan();
plan.name = 'Chirag';
plan.planNumber = 111;
AccountPlanClasses.AccountPlan a = new AccountPlanClasses.AccountPlan();
a.createAccountPlan(plan);

 

Execution of above code runs into following error

WebService returned a SOAP Fault: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session faultcode=sf:INVALID_SESSION_ID faultactor= 

 

I to feel that somewhere I am missing User Credentials to be supplied, but I dont know exactly where. Please guide me to complete this 360 connectivity between two orgs using Apex.

Message Edited by Chirag Mehta on 05-05-2009 06:13 AM
Message Edited by Chirag Mehta on 05-12-2009 07:52 PM
I need to create PDFs dynamically. Basically a PDF template is provided which is kind of a form. Based on the data filled by the User, the form should be populated. The template will reside in Document library of Salesforce or Intranet. Is there a way to do it?

There are tools which allow PDF creation on fly like iText. But they are based on .Net or Java or Com/ActiveX platform. Can this be done within Salesforce.

I have already considered the option of generating the pdf using Visualforce. But it doesnt seems feasible because of huge number of different forms with each form consisting of more than 20 pages.

It appears that the "RPC" WSDL style is not presently supported by Visualforce.  Can someone please point me to the documentation on WSDL models supported by Visualforce.  More importantly what is the guidance for incorporating RPC-based WSDLs ?

We are presently getting the following error message.

Error: Failed to parse wsdl: Unsupported WSDL style 'rpc'.  Only supports Dcoument/litteral/wrapped services.

A WSDL document describes a Web service. A WSDL binding describes how the service is bound to a messaging protocol, particularly the SOAP messaging protocol. A WSDL SOAP binding can be either a Remote Procedure Call (RPC) style binding or a document style binding. A SOAP binding can also have an encoded use or a literal use. This gives you four style/use models.  Add to this collection a pattern which is commonly called the document/literal wrapped pattern and you have five binding styles to choose from when creating a WSDL file.
1.    RPC/encoded
2.    RPC/literal
3.    Document/encoded
4.    Document/literal
5.    Document/literal wrapped

* Reference: http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/