• Joseph Ferraro
  • NEWBIE
  • 130 Points
  • Member since 2008
  • CTO
  • Mavens Consulting


Badges

  • Chatter
    Feed
  • 5
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 20
    Questions
  • 35
    Replies

Trying to mess around with the Enterprise API and I can't seem to get my XML request setup correctly.

 

Here is my XML update request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com" xmlns:urn1="urn:sobject.enterprise.soap.sforce.com">
      <soapenv:Header>
            <urn:SessionHeader>
                  <urn:sessionId>tricks</urn:sessionId>
            </urn:SessionHeader>
      </soapenv:Header>
      <soapenv:Body>
            <urn:update>
                  <urn:sObjects xsi:type="urn1:Account">
                        <urn1:Id>0015000000Lij8E</urn1:Id>
                        <Name>test</Name>
                  </urn:sObjects>
            </urn:update>
      </soapenv:Body>
</soapenv:Envelope>

 

And here is the response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>soapenv:Client</faultcode>
         <faultstring>The prefix "xsi" for attribute "xsi:type" associated with an element type "urn:sObjects" is not bound.</faultstring>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>

What am I messing up? I was using this as a guideline but it is very old and may be outdated: http://wiki.developerforce.com/index.php/Enterprise_Update

 

Thanks,

Jason

 

Hello Friends,

 

My requirement is that, i need to generate an XML out of my VF page. For this, i specified the "ContentType="application/xml" on my page header and then included the DOCTYPE tags to generate a standard XML out of it.

 

But somehow, i am not able to get the XML styling in the generated page and it shows me the shole page elements intead of just showing me the data.

 

Can you please let me know where i am going wrong or is this possible in VF? Pasting my VF page code below:

 

 

<apex:page cache="true" Controller="TestController" contentType="application/xml" showHeader="false">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/html" xml:lang="en" lang="en">
<body>
<apex:form >
<apex:pageblock id="exportDocs">
<apex:pageBlockTable value="{!exportValues}" var="actual">
<apex:column headerValue="Id" value="{!actual.Id}"/>
<apex:column headerValue="Act Name" value="{!actual.Name}"/>
<apex:column headerValue="MType" value="{!actual.A_Type__c}"/>
<apex:column headerValue="Country" value="{!actual.Country__c}"/>
<apex:column headerValue="B" value="{!actual.B__c}"/>
<apex:column headerValue="Actual C" value="{!actual.C__c}"/>
<apex:column headerValue="Actual G" value="{!actual.G__c}"/>
<apex:column headerValue="Actual I" value="{!actual.I__c}"/>
</apex:pageBlockTable>
</apex:pageblock>
</apex:form>
</body>
</html>
</apex:page>

 

Any help/guidance would be highly appreciated!!

 

Many Thanks,

Cool_D

Hi there,

 

This is my code, and I am only trying to make a Trigger that will update/insert the value TSK in the Type_Task field each time a new task is created or updated.

 

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
trigger UpdateTaskType on Task (before insert, before update) {

for (Task ta:trigger.new)
{
    if(ta.Type_Task1__c != 'TSK'){
       ta.Type_Task1__c == 'TSK');
      
}

}
}

 

//////////////////////////////////////

 

 

I have created this using Eclipse but it show red cross, which means there is an error with the code. Can some one advice how to get this working?

 

Thanks

I'm trying to create a Visualforce page that allows a user to choose a Lead Queue form a picklist. I see the QueueSobject object but it appears to only contain the SobjectType and QueueId; not the Queue Name. Any idea how I can get both the Queue's Id and Name?

 

Thanks

 

Jeff Douglas
Informa Plc
http://blog.jeffdouglas.com

I'm trying to populate a UL with LI elements via a repeater, but it's not working well for me because the repeater automatically injects div elements that wrap my LIs.  Is there a particular reason Siteforce is intervening on my explicit custom code?  Any way it can be avoided?

 

Cheers

Is it possible for a portal user to have the same username in two separate orgs.  For example, Company A has a portal and Mike Smith chose msmith@gmail.com as the username.  Company B also has a portal and Mike Smith needs to be a portal user in Company B as well and wants to choose msmith@gmail.com as the username.  Is this possible?  The reason I ask is that we're getting the following error message in one of our customer's portals, even though we have check the user table before registration to catch the error if the user tries to use a username that already exists in the user table.

 

There was an error in registering a user in site <PORTAL_NAME_HERE>. The error message is: Duplicate Username.<br>Another user has already selected this username.<br>Please select another.

We're getting the error message: "Your organization has most likely exceeded the portal role limit. Registration from [site name]  is not able to create portal users"

 

We have a Force.com Site with High Volume Portal users self registering to Customer portal.  Any ideas on how we can fix this?

Hi, we're building a customer portal where users will be registering as Person Accounts.  The issue is that the Person Accounts most likely already exist in our org.  So we want them to self-register on our portal and have their Custom Portal User associated to the Person Account that already exists in our org.  Is this possible with the Site.createPersonAccountPortalUser() method?  If not, how can we achieve this?

 

Thanks much

 

EDIT: is the solution to simply use Site.createPortalUser() with the id of the Person Account id?

 

 

Has anyone run into either of these errors while using the Metadata API/Migration tool for deployment?

 

objects/Object_Name__c.object(499,16):Could not resolve list view column: NAME <-- NAME is a standard field, why am I getting an error?

 

[sf:retrieve] unpackaged/package.xml - Entity of type 'Profile' named 'My profile name' not found <-- I know a profile named "My profile name" exists in my org, but the Metadata API doesn't seem to find it

 

 

Any help is greatly appreciated!

 

Thanks 

 

 

 

I'm doing a query to pull a few hundred thousand records from a custom object and I'm noticing duplicate rows being pulled down.  I'm sure this is something I'm doing wrong, but I'm using the queryMore sample code provided in the wiki

 

 

QueryResult queryResult = this.stub.query("Select name From lead"); do { for(sObject lead : queryResult.getRecords()) { System.out.println(lead.get_any()[0].getValue()); } if(queryResult.isDone()) break; queryResult = this.stub.queryMore(queryResult.getQueryLocator()); } while(true);

 

 I am performing a few different queries within my class, so I'm repurposing queryResult, but I'm setting it to null before every query.

 

Any help is appreciated!

 

Mavens Consulting is expanding rapidly and is looking to augment its development practice.  Dev 401 and 501 certifications are a plus.

 

Please email joe [at] mavensconsulting.com for more information.

  

http://www.mavensconsulting.com 

Message Edited by joe ferraro on 01-28-2010 08:13 AM
Message Edited by joe ferraro on 01-28-2010 08:13 AM

I can write a subset of profile permissions to a profile via the metadata api without overwriting the whole profile definition, right?

 

Thanks in advance! 

I'm testing a lead distribution application in sandbox by uploading leads via the Import Wizard.  I turn on the debug log for my license and start the import, but my apex @future method doesn't seem to fire.  I check the apex job monitor and there's no sign of any calls to my @future method.  

 

Also: when I use the data loader, it works fine....any ideas?? 

 

 

for (lead l : trigger.new) {

leadids.add(l.id);

}

 

if (leadids.size() > 0) {

system.debug('routing leads now!!!!');

LeadAssignment.routeLeads(leadids);

}

 

 

EDIT: also, I'm receiving an email with the following content (which doesn't make any sense because the leads table is empty when I'm attempting to upload via the wizard):

 

Force.com Sandbox

Alert: All information in the import file was already in Salesforce.

Result: No data was created or modified in Salesforce.

44 values: unexpected errors. Line number(s): 2, 3, 4, 5, 6, 7, 8, 9, 10

If you encounter any problems or have any questions, please contact us by clicking Help & Training at the top right of any Salesforce page and choosing the My Cases tab.

 

Thank you!

Customer Support

salesforce.com 

 

Message Edited by joe ferraro on 02-25-2009 08:54 PM
I'm attempting to set a visualforce page as the content of a custom opportunity detail button in a sandbox, but when i select content source as "visualforce page", the picklist that's supposed to contain the list of visualforce pages is empty.

any ideas?

thx
In version 14 of the force.com IDE, I noticed that using the standard /* */ for multi-line commenting no longer changes the font color of the code to a dark red the way it used to. Is this simply an oversight, a bug in my eclipse instance, or is there a new way to do multi-line commenting?

Thanks!
I'm rewriting a flex control to be able to handle namespace prefixing, however I'm having trouble parsing the describeSObjects call.  How do I rewrite the line below to handle a dynamic "type__c" (could be xyz__type__c or abc__type__c, etc.) field name.  I tried casting result[0].fields as an array and iterating that way, but when I trace the values, they come up as "undefined".

Code:
var myPicklistValues:ArrayCollection = result[0].fields.type__c.picklistValues;

 
thanks in advance!
We're receiving the following error when making a webservice callout:

16:05:08 ERROR - Evaluation error: System.CalloutException: IO Exception: DerInputStream.getLength(): lengthTag=75, too big.
16:05:08 ERROR - Evaluation error: Class.wsFiberlinkCom.EspWebServiceImpl.checkIfValidMaas360UserName: line 58, column 13
AnonymousBlock: line 4, column 1

Any idea what the source is?

Thanks in advance.
I'm sure these questions have been covered somewhere on this board, but I could not find them via search...

1. Is the limit for @future calls 200 per org per 24 hours OR 200 per license per 24 hours?

2. If it's 200 per org per 24 hours, can this limit be raised?

3. Lastly, I have a trigger on leads that calls an @future class after insert and when I check the apex job queue, hundreds of jobs show up in the queue even when we load a list of 500 or so leads via the import wizard. For a list of 500 or so leads, wouldn't that only generate 3 @future calls, assuming the batch size is 200? (and yes, I've written the aforementioned trigger for bulk processing)

Thanks in advance!!
How do I accomplish what I'm trying to do below (notice I'm trying to get a calculated value in the third column)?

Thanks in advance.

Code:
<apex:page controller="myController" action="{!init}" showHeader="false" sidebar="false" tabStyle="Account">
 <apex:pageBlock title="Calls">         
        <apex:pageBlockTable value="{!calls}" var="c" columns="3">
            <apex:column value="{!c.Date__c}" headervalue="Call Date"/>
            <apex:column value="{!c.Percent__c}" headervalue="Percent"/>
            <apex:column value="{!c.Percent__c} * {!another binded value}" headervalue="Amount"/>
        </apex:pageBlockTable> 
    </apex:pageBlock> 
</apex:page>

 

All:

I moved one of our apex classes to the @future keyword to alleviate some issues we were having with governor limits. However, now I'm receiving script exceptions referencing the INSUFFICIENT_ACCESS_OR_READONLY error. Does the @future keyword ignore object access/security like regular apex classes?

Thanks in advance.

Joe
Hi, i'm building a custom report wizard using VF and I need to generate the list of fields for an object.  ive been reading up on apex's describe/sobject methods, but I haven't found a piece of sample code that shows how to iterate the describe result of fields, so that I could add them to a vf selectoptions component.  Can someone point me in the right direction?

Thanks in advance.
I have a trigger that runs when a child record of an opportunity is created. it takes the ownerid of the opportunity and queries for the owner's "Sales Administrator" (which is a user hierarchy field), and assigns a task to this "Sales Administrator". For some reason, when the system admin is the owner of the opportunity, i get an invalid cross reference on the ownerid (saying it can't be left blank) when trying to insert the tasks.

is this expected behavior?

thanks in advance

Message Edited by joe ferraro on 06-26-2008 09:22 PM
hey everyone, just wanted to give a heads up that i've started a new site with Force.com development as the main focus.

www.joe-ferraro.com

Thanks!

Message Edited by joe ferraro on 05-26-2008 06:21 PM
i know an apex method doesn't currently exist for calculating the iso week number, but does anyone have an algorithm i could use?

thanks in advance

I was wondering what tools you guys have used to migrate assets from your current site to Siteforce.  Is Data Loader the recommended tool?  I found another tool on Developerforce.com that made mention to a tool called HTTrack that could be used.  Has anybody used this tool?  Did it work well for you?  What are some other tools available?

 

Thanks!

  • February 08, 2012
  • Like
  • 0

Trying to mess around with the Enterprise API and I can't seem to get my XML request setup correctly.

 

Here is my XML update request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com" xmlns:urn1="urn:sobject.enterprise.soap.sforce.com">
      <soapenv:Header>
            <urn:SessionHeader>
                  <urn:sessionId>tricks</urn:sessionId>
            </urn:SessionHeader>
      </soapenv:Header>
      <soapenv:Body>
            <urn:update>
                  <urn:sObjects xsi:type="urn1:Account">
                        <urn1:Id>0015000000Lij8E</urn1:Id>
                        <Name>test</Name>
                  </urn:sObjects>
            </urn:update>
      </soapenv:Body>
</soapenv:Envelope>

 

And here is the response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>soapenv:Client</faultcode>
         <faultstring>The prefix "xsi" for attribute "xsi:type" associated with an element type "urn:sObjects" is not bound.</faultstring>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>

What am I messing up? I was using this as a guideline but it is very old and may be outdated: http://wiki.developerforce.com/index.php/Enterprise_Update

 

Thanks,

Jason

 

We're getting the error message: "Your organization has most likely exceeded the portal role limit. Registration from [site name]  is not able to create portal users"

 

We have a Force.com Site with High Volume Portal users self registering to Customer portal.  Any ideas on how we can fix this?

I'm noticing issues with the new plugin related to syntax highlighting when editing VisualForce .page files. It intermittently stops highlight part of the text in the document. I haven't found a pattern when it occurs. 

 

It is also rendering squiggly yellow lines under my <apex:page> tag, and my first  <script> tag. Any ideas why? These are the first 2  items in my page.

 

<apex:page standardController="SR__c" 
	extensions="HSRControllerExtension" 
	showHeader="true" 
	sidebar="true" 
	tabStyle="SRt__c" 
	title="Entry Page" >
  
  <script type="text/javascript" src="{!URLFOR($Resource.jQuery142, 'js/jquery-1.4.2.min.js')}" />

 

 

Thanks,

 

Rich C. 

 

 

  • April 21, 2010
  • Like
  • 0

I'm doing a query to pull a few hundred thousand records from a custom object and I'm noticing duplicate rows being pulled down.  I'm sure this is something I'm doing wrong, but I'm using the queryMore sample code provided in the wiki

 

 

QueryResult queryResult = this.stub.query("Select name From lead"); do { for(sObject lead : queryResult.getRecords()) { System.out.println(lead.get_any()[0].getValue()); } if(queryResult.isDone()) break; queryResult = this.stub.queryMore(queryResult.getQueryLocator()); } while(true);

 

 I am performing a few different queries within my class, so I'm repurposing queryResult, but I'm setting it to null before every query.

 

Any help is appreciated!

 

Mavens Consulting is expanding rapidly and is looking to augment its development practice.  Dev 401 and 501 certifications are a plus.

 

Please email joe [at] mavensconsulting.com for more information.

  

http://www.mavensconsulting.com 

Message Edited by joe ferraro on 01-28-2010 08:13 AM
Message Edited by joe ferraro on 01-28-2010 08:13 AM

Hello Friends,

 

My requirement is that, i need to generate an XML out of my VF page. For this, i specified the "ContentType="application/xml" on my page header and then included the DOCTYPE tags to generate a standard XML out of it.

 

But somehow, i am not able to get the XML styling in the generated page and it shows me the shole page elements intead of just showing me the data.

 

Can you please let me know where i am going wrong or is this possible in VF? Pasting my VF page code below:

 

 

<apex:page cache="true" Controller="TestController" contentType="application/xml" showHeader="false">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/html" xml:lang="en" lang="en">
<body>
<apex:form >
<apex:pageblock id="exportDocs">
<apex:pageBlockTable value="{!exportValues}" var="actual">
<apex:column headerValue="Id" value="{!actual.Id}"/>
<apex:column headerValue="Act Name" value="{!actual.Name}"/>
<apex:column headerValue="MType" value="{!actual.A_Type__c}"/>
<apex:column headerValue="Country" value="{!actual.Country__c}"/>
<apex:column headerValue="B" value="{!actual.B__c}"/>
<apex:column headerValue="Actual C" value="{!actual.C__c}"/>
<apex:column headerValue="Actual G" value="{!actual.G__c}"/>
<apex:column headerValue="Actual I" value="{!actual.I__c}"/>
</apex:pageBlockTable>
</apex:pageblock>
</apex:form>
</body>
</html>
</apex:page>

 

Any help/guidance would be highly appreciated!!

 

Many Thanks,

Cool_D

Hi there,

 

This is my code, and I am only trying to make a Trigger that will update/insert the value TSK in the Type_Task field each time a new task is created or updated.

 

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
trigger UpdateTaskType on Task (before insert, before update) {

for (Task ta:trigger.new)
{
    if(ta.Type_Task1__c != 'TSK'){
       ta.Type_Task1__c == 'TSK');
      
}

}
}

 

//////////////////////////////////////

 

 

I have created this using Eclipse but it show red cross, which means there is an error with the code. Can some one advice how to get this working?

 

Thanks

I'm trying to create a Visualforce page that allows a user to choose a Lead Queue form a picklist. I see the QueueSobject object but it appears to only contain the SobjectType and QueueId; not the Queue Name. Any idea how I can get both the Queue's Id and Name?

 

Thanks

 

Jeff Douglas
Informa Plc
http://blog.jeffdouglas.com

Please help.

I am trying to use the Google Spreadsheets API with a list feed. This works fine with a handful of rows.
 
However, with more than a handful of rows (approx 7 or 8), any other rows never get inserted/updated.
 
I think this might be because Apex will only make 10 callouts and just seems to 'stop working' without reporting any errors (I guess I use a couple of callouts to get the spreadsheet etc).
 
From the debug log:      Number of callouts: 10 out of 10 ******* CLOSE TO LIMIT
Is it the case that I can only make 10 callouts when working with a Google spreadsheet? If so, that's a pretty serious limitation.
 
In version 14 of the force.com IDE, I noticed that using the standard /* */ for multi-line commenting no longer changes the font color of the code to a dark red the way it used to. Is this simply an oversight, a bug in my eclipse instance, or is there a new way to do multi-line commenting?

Thanks!
I'm rewriting a flex control to be able to handle namespace prefixing, however I'm having trouble parsing the describeSObjects call.  How do I rewrite the line below to handle a dynamic "type__c" (could be xyz__type__c or abc__type__c, etc.) field name.  I tried casting result[0].fields as an array and iterating that way, but when I trace the values, they come up as "undefined".

Code:
var myPicklistValues:ArrayCollection = result[0].fields.type__c.picklistValues;

 
thanks in advance!
I'm sure these questions have been covered somewhere on this board, but I could not find them via search...

1. Is the limit for @future calls 200 per org per 24 hours OR 200 per license per 24 hours?

2. If it's 200 per org per 24 hours, can this limit be raised?

3. Lastly, I have a trigger on leads that calls an @future class after insert and when I check the apex job queue, hundreds of jobs show up in the queue even when we load a list of 500 or so leads via the import wizard. For a list of 500 or so leads, wouldn't that only generate 3 @future calls, assuming the batch size is 200? (and yes, I've written the aforementioned trigger for bulk processing)

Thanks in advance!!
I can't get either the dataTitle or the labelTitle attributes in the pageBlockSectionItem settings to actually display in the rendered VF page. Has anyone else had this problem or have a sample where those attributes do work that I can model my code off of?
  • September 30, 2008
  • Like
  • 0
How do I accomplish what I'm trying to do below (notice I'm trying to get a calculated value in the third column)?

Thanks in advance.

Code:
<apex:page controller="myController" action="{!init}" showHeader="false" sidebar="false" tabStyle="Account">
 <apex:pageBlock title="Calls">         
        <apex:pageBlockTable value="{!calls}" var="c" columns="3">
            <apex:column value="{!c.Date__c}" headervalue="Call Date"/>
            <apex:column value="{!c.Percent__c}" headervalue="Percent"/>
            <apex:column value="{!c.Percent__c} * {!another binded value}" headervalue="Amount"/>
        </apex:pageBlockTable> 
    </apex:pageBlock> 
</apex:page>

 

All:

I moved one of our apex classes to the @future keyword to alleviate some issues we were having with governor limits. However, now I'm receiving script exceptions referencing the INSUFFICIENT_ACCESS_OR_READONLY error. Does the @future keyword ignore object access/security like regular apex classes?

Thanks in advance.

Joe
I have a trigger, which has been working fine for several months in our production org and the last two days I recieved the following error message:
 
setCriticalAccountTrue: execution of AfterUpdate
caused by: System.Exception: Too many DML statements: 21
Class.CriticalAccount.setCriticalAccountTrue: line 16, column 9
Trigger.setCriticalAccountTrue: line 2, column 5
 
Is the error getting caused because the trigger is not handling bulk updates?
 
Here is the trigger code and class:
 
Code:
trigger setCriticalAccountTrue on Case (after update) {
 CriticalAccount.setCriticalAccountTrue(Trigger.new);
}



public class CriticalAccount {
 
 public static void setCriticalAccountTrue(Case[] cases) {
  
  List<Account> acctList = new List<Account>();
  
  for (Case c : cases) {
   
   if(c.Priority == 'Critical') {
   
   Account a = new Account( Id = c.AccountId );
      a.Critical_Account__c = true;

      acctList.add(a);
  }
  update acctList;
  }
 }
 
 public static testMethod void testCriticalAccountClass() {
  // Create a new case to test
  Case c = new Case(RecordTypeId='01230000000DCKS',
Type='Remediation',Reason='Miscellaneous',Subject='test',
Status='New',Priority='High',Origin='Email',ContactId='0033000000J6B9Y',
AccountId='0013000000BfAg4',Description='test'); insert c; // Update the case status to 'Working' and case priority to 'Critical' c.Status='Working'; c.Priority='Critical'; update c; // Check if critical account field has been set to true System.assert(true, [Select a.Critical_Account__c from Account a WHERE a.Id = '0013000000BfAg4'].Critical_Account__C); } }

 
Thanks for any help.
 
  • September 07, 2008
  • Like
  • 0