• Vinod
  • 0 Points
  • Member since 2008

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 9



I am having a standard salesforce page and a save button in it.


I want to do the following :-


a) raise a Popup window before the actual save is done with 'Continue' or 'Cancel' buttons in it.

b) Once continue is clicked it should save the record.


I tried using the saveurl, s-controls but not successful.





  • June 12, 2009
  • Like
  • 0



I just wanted to get a confirmation .

This is about territory Management standard feature in Salesforce.

I remember reading in the documentation that there can only be 500 territories.


Is it true?


For a global organization, it is very common to have more than 500 territories especially if you take Zip Codes into consideration.

US has some 40 K and India has more than 150 K zipcodes.


Please let me know if there is something i missed out.




Hi All,


I am trying to upload file through Rest API. i am able to upload and extract text files properly but if i upload any other file format (pdf,doc ,ppt or any image) , the file uploads fine but if i try to open that file it won't open( error message : file is broken , or the pdf is blank). It seems the file body i am sending is not properly encoded for other file formats.

Below is my code which i am using to upload files

String ObjectName = input.filename;
System.debug('ObjectName' + ObjectName);
Blob BodyContent=input.fileBody;
String DocBody = BodyContent.toString();
// String DocBody = EncodingUtil.base64Encode(BodyContent);
// String DocBody = EncodingUtil.urlEncode(bodyContent.toString(), 'UTF-8');
// String DocBody1 =
System.debug('DocBody' + DocBody);
Integer bodyLength =DocBody.length();
System.debug('bodyLength ------------->' + bodyLength );

String url6=input.StorageURL;
Http h6 = new Http();

HttpRequest req6 = new HttpRequest();
req6.setEndpoint(url6 + '/' + input.containerName + '/'+input.objectPath + '/' + ObjectName );//

// System.debug('Request object is----------->' + req6);
HttpResponse res6;
res6 = h6.send(req6);
if i upload a file directly to storage size is 15Kb but if i upload through API file size is showing 24 KB.

Please let me know do i need to encode the file body or am i missing any thing.

I have tried with encloding also but still no luck

Quick response would be appreciated!!

  • September 14, 2010
  • Like
  • 0
SFDC apps & bigmachines tool.. now we are trying to performLoad Simulation testing & performacnce testing  is there any such tool or we can use any tool to do that....
  • December 09, 2009
  • Like
  • 0

Hello everyone!!!


I have done an APEX class. If I use this query;


 Contact C=[select Name from Contact where Id not in ('a0U80000001p4TEEAY,a0U80000001p4T9EAI')];


 It works! It gives me the Contacts I want!


But if I do this;


string help='a0U80000001p4TEEAY,a0U80000001p4T9EAI';

Contact C=[select Name from Contact where Id not in (:help)];


It doesn't work!


How do I pass parameters correctly?!?!?


Thanks in advance!!

I work for a large multi-brnached organization and we have run out of custom fields on Contact and would like to use a corresponding custom object to hold more info. Before doing that, I want to make sure that there will be one and only one record on this new object for each Contact.  To that end, I've put together a very simple trigger to create a corresponding record in a custom object for each of our Contacts.


Everything works aside from populating the Contact__c lookup field on the custom object. I even repeated that command separately (not while making the new record) but it didn't work either. Any ideas on what's wrong?



trigger insertPIOPrec on Contact (before insert, before update) 
for(Contact c:Trigger.new)
If (c.PI_Ongoing_Participation__c == null){
PI_Ongoing_Participation__c p = new PI_Ongoing_Participation__c(Contact__c = c.Id);
p.Contact__c = c.Id;
insert p;
c.PI_Ongoing_Participation__c = p.Id;
else {}


Also, I'd like to upgrade the code to handle bulk inserts, but had a lot of difficulty figuring out how to do that.


Any help would be much appreciated.




I have two datatables in my page. One of them rerenders when the a new search occurs - rendering a table with the search results. I am also able to take the selected items in the table and render them in a new table.

Ths second table also has checkboxes and a button which should remove an item from the list, and rerender the table without that item - this does not work. 


Here's the code for the tables that work. This first part is for the Product Search and displaying the Product Search Results:



<!---PAGE---> ... <apex:form > <apex:pageBlock title="Product Search" id="ProductSearch"> <apex:outputPanel id="Search" title="Search Result" > Search for: <apex:inputText value="{!SearchString}" id="SearchString"/><p/> <apex:commandButton action="{!ProductSearch}" value="Search" id="theButton" rerender="errors,SearchResult"/> </apex:outputPanel> <apex:pageBlockSection title="Product Selections"> <apex:pageBlockTable id="SearchResult" value="{!prodRes}" var="PR" > <apex:column > <apex:facet name="header">Select</apex:facet> <apex:selectCheckboxes value="{!Selections}" > <apex:selectOption itemvalue="{!PR.ProductID}" /> </apex:selectCheckBoxes> </apex:column> <apex:column > <apex:facet name="header">Product Name </apex:facet> <apex:outputText value="{!PR.ProductName}"/> </apex:column> </apex:pageBlockTable> <apex:commandButton value="Add to Cart" action="{!processSelected}" rerender="ShoppingCart" id="AddButton"/> </apex:pageBlockSection> </apex:pageblock> <!-- CONTROLLER --> ... public pageReference ProductSearch(){ String mySearchString = '%' + SearchString + '%'; system.debug('SearchString is '+SearchString); prodQry = [SELECT id, Name, ProductCode, Description, Family, isActive, SVMXI__Product_Cost__c FROM Product2 WHERE Name like :mySearchString OR Description like :mySearchString OR ProductCode = :mySearchString]; ProductSearchResult(prodQry); return null; } public void ProductSearchResult(Product2[] prodQry){ prodRes.clear(); if (prodQry.size() > 0) for (Product2 prd :prodQry){ ProductResult newPR = new ProductResult(prd.id, prd.Name, prd.ProductCode, prd.Description, prd.Family, prd.isActive, prd.SVMXI__Product_Cost__c, '0'); prodRes.add(newPR); system.debug('Prodres size is '+prodres.size()); } }

 Selecting Checkboxes will render a new pageblocktable - Shopping Cart - in a new PageBlock using the {!ProcessSelected} method invoked by the 2nd command button in the page code above.Also, changing the Quantity in the top table will change the Quantity in the bottom table.


More to the point, after selecting products in the first rendering, I can search for products using a different searchstring, which will rerender the table with new products. Then, selecting one of those products and Adding to the cart will add that new line to the Shopping Cart table, keeping the other values intact. Here's the code for that.



<apex:pageBlock id="ShoppingCart" title="Shopping Cart"> <apex:pageBlockSection > <apex:pageBlockTable id="CartTable" value="{!prodCart}" var="PC" > <apex:column > <apex:facet name="header">Remove Item</apex:facet> <apex:selectCheckboxes value="{!selected}" > <apex:selectOption itemvalue="{PC.ProductID}" /> </apex:selectCheckBoxes> </apex:column> <apex:column > <apex:facet name="header">Line Number </apex:facet> <apex:outputText value="{!PC.LineNumber}"/> </apex:column> <apex:column > <apex:facet name="header">Product Name </apex:facet> <apex:outputText value="{!PC.ProductName}"/> </apex:column> </apex:pageBlockTable>

<apex:commandButton value="Remove Items" action="{!removeItems}" id="removeButton" rerender="ShoppingCart"/>

</apex:pageBlockSection> </apex:pageBlock> </apex:form> <!--CONTROLLER--> public PageReference ProcessSelected(){ if (Selections.size() > 0) for (String PS :Selections) for (ProductResult PR :prodRes) if (PS == PR.ProductID) if (!prodSel.isEmpty()){ for (integer i = 0; i < prodSel.size(); i++) if (prodSel[i].ProductID == PR.ProductID){ prodSel.remove(i); prodSel.add(PR); } else { prodSel.add(PR); } } else prodSel.add(PR); createProdCart(prodsel); return null; } CartProduct[] prodCart = new CartProduct[]{ get; set; } public pageReference createProdCart(ProductResult[] prodSel){ for (ProductResult PR :prodSel){ integer Qty = convQty(PR.Quantity); integer LineItem = LineItemGen(prodCart); decimal LineTotal = LineTotalGen(PR.ProductCost, Qty); CartProduct newCP = new CartProduct(PR.ProductID, PR.ProductName, PR.ProductCode, PR.Description, PR.Family, True, PR.ProductCost, Qty, LineItem, LineTotal); } return null; }

In bold font above is the 3rd button for removing items in the 2nd table, selecting the items for removal using another set of checkboxes.


The code for this, with the Selected definitions:

id[] selected = new String[]{}; public id[] getSelected(){ return Selected; } public void setSelected (id[] selected){ this.Selected.addall(selected); } public PageReference removeItems(){ for (integer i = 0; i < prodCart.Size(); i++) for (id S :Selected) if (S == prodCart[i].ProductID) prodCart.remove(i); return null; }

 This last method does absolutely nothing. I saw a Note in the VisualforceDevelopers Guide that says tables cannot be rerendered, yet both of the tables on this page do rerender - when adding Product Search Results, and when displaying selections from that table to the Shopping Cart table below. 


However, removing those Cart items, which would seem to be the easiest thing, doesn't work. Am I missing something obvious, or is this something that VisualForce/APEX just can't do - I cannot believe it is the latter. I do know I've tried it a lot of different ways, but haven't found the one that works yet. 


As always, thanks for any help you can provide. 













Does anyone know a way to have an inputText field take the action of the commandbutton when the user presses enter?

I have a simple form with one inputtext and one commandbutton. The button just does the action piece. Can I bind an user press on the input text to that action?

  • January 19, 2009
  • Like
  • 0

My apologies for the repost, but nobody seemed to have anything to say in "General Development"....

Despite the fact that we have access to the Enterprise WSDL, I've decided to use the Partner WSDL for a new project of mine. 

Basically what I've built is a dynamic form that uses an Object's Fields to populate a form on our webserver with the appropriate controls at runtime, collects the values and submits them back into SF.  I've got everything worked out the way I like: field type interpretation, field creation, list population, and even got field validation working... except that I can't think of a good way for my Salesforce Admins to indicate that a field should be required.

Take our Survey object, for example.  If they add a custom field to Surveys and make it required, then when a salesperson creates a new Survey object INSIDE Salesforce, they must supply a value.  I'm just looking for a way to indicate that it needs to be validated at the end-user.  Right now I'm using the Field's name to determine if the Field should be required by prepending "SFF_" to indicate the Field should be on the form, and not just in SF, and "VAL_" to indicate that the Field should be required. 

I'd really like to use each Field's Description property for keywords, like "Required" and "ShowOnForm" instead.  I don't like the idea of forcing a naming convention on custom Fields, and would much prefer they can modify the field more easily using it's description.  Unfortunately, I can't figure out where Object's Field's Descriptions are stored.   Apparently not as a property of the Field object itself?

Does anyone know where I can find the Description property of a custom Field?


PS - You're probably thinking that there are other ways to do some of this, but I've built this little framework in such a way where I can use either Salesforce or a SQL database to describe these dynamic forms and collect data, so there's a little bit of abstraction going on that might seem a little unnecessary on the surface.
  • April 15, 2008
  • Like
  • 0
What are my best options to synch data from SAP into SF ? I have found some info about this but my mind still has some doubts.
Can anyone provide my feedback from their own experience ?
Many thanks,