• OdedHarniv
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 25
    Questions
  • 63
    Replies

Hello all

 

I'm building a public portal where one of the things a user can request is to be sent an email with some info.

I'm using an APEX code with Messaging.SingleEmailMessage.

 

The problem is that I'm getting NO_MASS_MAIL_PERMISSION which might be because a Guest User Profile has no Send Email feature.

 

Is that correct?

What is the right way to send and email from APEX in such a case?

 

Thanks

 

Oded

Hello

 

I need some expert advice...

 

I want to have some code to be executed once the user leaves a VF page.

My case is that I want to save some changes the user makes to the page only when the user leaves the page to avoid multiple database calls.

 

Is there any way I can do that?

 

Thanks

 

Oded

Hello

 

I have a case where I have a public portal VF page and I want to show an image on this page.

 

Initially I wanted to use the Attachment object (I attached the image to the object showing on the page) but when I did that I got an unauthorized access error, which I assumed is because the Attachment object is not accessible to a Guest user.

 

Same think happened if I use the Document object to store the image.

 

Can someone advise what is the right way to achieve this apart from using a Static Resource?

 

Many thanks

 

Oded

Hello

 

I need some expert advice.

 

I have an object representing an Article; an Article has 4 Author fields which initially I made text fields.

But then cam the requirement to make these fields selectable from a picklist or lookup.

 

These lists are of course dynamic as more articles are added to the DB.

 

I thought of implementing Bob Buzzard's VF lookup (http://bobbuzzard.blogspot.com/2010/09/visualforce-lookup.html), but I then realized that a VF page cannot be added to an edit layout (only details).

 

I thought of using a Custom setting but I don't think this will help answer the requirement.

 

Any ideas how can I add an option to select from list or lookup on the edit layout?

 

Many thanks

 

Oded

Hello

 

I have a relatively large SOQL query (I'm filtering according to about 10 different fields) and three of the fields I'm filtering are Long Text Areas.

I'm getting the following error (this is for one of the fields):

 

querySystem.QueryException: field 'Abstract__c' can not be filtered in query call

 

I assume that Long Text Areas cannot be filtered and I wonder if anyone has a workaround for this limitation?

 

Thanks 

 

 

Oded

 

Hello

 

I have this code:

<apex:panelGrid columns="2" id="bottomGrid">       

	<apex:repeat value="{!Campaign.Campaign_Selection_Options__r}" var="cso">
	  <apex:commandButton rendered="{!showButtons}" onclick="buttonClick('{!cso.Name}')" styleClass="buttonStyle" action="{!doAction}" value="{!cso.Name}" id="button1" >           
  </apex:commandButton>					    
</apex:repeat>
      
</apex:panelGrid>   

 

I have 3 or 4 buttons depending on the specific record and I hopped the buttons would be arranged in the grid in two rows.

In practice the buttons get arranged in one row.

 

Does any one know how can I force them to be arranged according to my grid?

 

Thanks

 

Oded

Hello

 

I have a situation which I hope to find a better solution that I currently have.

 

My case is that I have four command buttons on my VF page.

I want to have only one method on my controller which all the button actions will reference and the logic will differ based on the specific button that called it.

 

Is there any way to know which button called the method or I must write four different methods?

 

Thanks

 

Oded

Hello

 

I'm straggling with something I expected to be simple and I can use some help to figure it out.

 

I have an image as an attachment to a Campaign.

I have a VF page that should display this image but can't get it right.

 

I thought putting the Attachment ID in the image src parameter but this seems to be the wrong way.

 

Any advice on how this should be done?

 

Thanks

 

Oded

Hello

 

I could really use some expert advice.

 

I have a Home Page Component that only includes a VF page.

I defined it as a custom component with (HTML area).

This is my code:

<br><iframe src="/apex/SubscriberCard?core.apexpages.devmode.url=1" width="100%&quot;" height="100%"></iframe><br>

I can see the page when I'm in the component Edit mode.

But when I go to the Homepage I see nothing but an horizontal line at the top.

 

I can't figure out what is wrong and why it is not working.

 

Thanks

 

Oded

Hello

 

I have this case which I can't figure out:

 

I have two pages each with a different custom controller.

I want to access variables on PageA controller from PageB controller.

 

Is there anyway to achieve this?

 

Thanks

 

Oded

 

Hello everyone

 

I have a follow up issue for my previous problem (http://boards.developerforce.com/t5/REST-API-Integration/Updating-records-from-REST-API/m-p/291815#M585).

 

I have this code from my JAVA application running on Google app engine:

 

 

HTTPRequest httpRequest = new HTTPRequest(url, HTTPMethod.POST, FetchOptions.Builder.withDeadline(10));

...

JSONObject update = new JSONObject();
update.put("my_txt", mTxt);			
			httpRequest.setPayload(update.toString().getBytes());

log.severe("payload: " + update.toString());		
			
HTTPResponse response = urlFetchService.fetch(httpRequest);

 

 

When I print out the text before sending it I see the spaces, new lines and format are kept and appear OK.

 

But when I look in my Force.com Org in the relevant Rich Text field I see on long line of text (with not spaces, new lines or any formatting).

 

Any advice on why is that happening and what am I doing wrong?

 

Thanks

 

Oded

 

Hello everyone

 

I'm using JAVA to extract text from MS docs and update a text filed in my force.com Org.

The JAVA code is hosted on google application engine.

The code works OK but the update doesn't change anything in my Org.

 

This is my code:

 

	public void updateCVtxt(String candidateID, String cvTxt){

		log.severe("updateCVtxt for:" + candidateID);		
	      
                public static final String PATCH_METHOD = "?_HttpMethod=PATCH";

		String restURI = instanceURL + "/services/data/v" + sfdcApiVersion +
						 "/sobjects/SocialRecruite__Candidate__c/" + candidateID;
		try{
			
			URL url = new URL(restURI + PATCH_METHOD);
			URLFetchService urlFetchService = URLFetchServiceFactory.getURLFetchService();
			HTTPRequest httpRequest = new HTTPRequest(url);

			httpRequest.setHeader(new HTTPHeader("Authorization", "OAuth "+ accessToken));
			httpRequest.setHeader(new HTTPHeader("Content-Type", "application/json"));
			
			JSONObject update = new JSONObject();
			update.put("SocialRecruite__Resume_CV__c", cvTxt);
			
			httpRequest.setPayload(update.toString().getBytes());
			
			HTTPResponse response = urlFetchService.fetch(httpRequest);
			log.severe("HTTP code:"+response.getResponseCode());
		}
		catch(JSONException e){
		    log.severe("updateCVtxt JSONException:"+ e.getMessage());
			e.printStackTrace();
		}
		catch(Exception e){
		    log.severe("updateCVtxt Exception:"+ e.getMessage());
	    	e.printStackTrace();
	    }
	}

 

 

I have two questions:

1) Where can I see the log of what happens on the Force.com side when it gets this request?

2) Maybe I'm doing something wrong.  Is my code correct?

 

Thanks a lot

 

Oded

 

 

Hi

 

Can anyone help me find which jar includes the javax.servlet.annotation.WebServlet class and where I can download this jar?

 

Many thanks

 

 

Hi

 

I'm trying to apply an external CSS to a table but whatever I tried did no work.

This is my code:

 

<apex:page Controller="SearchCheckedOutBooksController" showHeader="false" Tabstyle="Library_Order__c">
<apex:stylesheet value="{!URLFOR($Resource.tableStyles, 'source/style.css')}"/> 
  <apex:sectionHeader subtitle="ECI Information Center Portal"/>
   <style>
      .activeTab {background-color: #2369FF; color:white; background-image:none}
      .inactiveTab { background-color: lightgrey; color:black; background-image:none}
   </style>

   <apex:form >

	   <apex:tabPanel switchType="client" selectedTab=" tabCard" id="InfoCenterTabPanel" tabClass="activeTab" inactiveTabClass="inactiveTab">   
	
	      <apex:tab label="News" name="News" id="tabnews">
	         <apex:detail relatedList="false" title="true"/>
	      </apex:tab>
	      <apex:tab label="My Library Card" name="Card" id="tabCard">
	         
	          <apex:pageBlock title="Search My Library Orders" mode="edit">         
	               <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Subscriber ID to query&nbsp;</label>
	               <apex:inputText value="{!subscriberId}"/>
	        
	               <apex:commandButton action="{!searchOrders}" value="Search" rerender="orderResults"/>                  
	          </apex:pageBlock>
	                    
	           <!-- The results for each call are handled here. -->              
	               
	            <apex:outputPanel layout="block" id="orderResults">
	                <apex:outputPanel rendered="{!IF(hasError == false,true,false)}"> 
	                    <apex:pageBlock title="Search Results">
	                        <apex:pageBlockButtons >
	
	                                <apex:commandButton value="Cancel Selected Orders" action="{!cancelOrder}" rerender="orderResults"/>
	
	                        </apex:pageBlockButtons>
	                        
	                        <apex:pageBlockSection title="Pending Orders">
								<apex:dataTable value="{!myPendingOrders}" var="entry" id="pendingTable" 
								 				styleClass="#newspaper-a">

	                                <apex:column headerValue="Select">
	                                    <apex:inputCheckbox id="orderCheckedone" value="{!entry.isSelected}" disabled="{!entry.disable}"/>
	                                </apex:column>
	                                <apex:column value="{!entry.order.Name}" headerValue="Order ID"/> 
	                                <apex:column value="{!entry.order.Type__c}" headerValue="Type"/> 
	                                <apex:column value="{!entry.order.Status__c}" headerValue="Order Status"/> 
	                                <apex:column value="{!entry.title}" headerValue="Title"/>
	                                <apex:column value="{!entry.order.Order_Date__c}" headerValue="Order Date"/>
	                                <apex:column value="{!entry.order.Fulfillment_Date__c}" headerValue="Checkout Date"/>
	                                <apex:column value="{!entry.order.Return_By__c}" headerValue="Return By"/>
								</apex:dataTable>
	                        </apex:pageBlockSection>

The styles looks like this:

 

 

#newspaper-a
{
	font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
	font-size: 12px;
	margin: 45px;
	width: 480px;
	text-align: left;
	border-collapse: collapse;
	border: 1px solid #69c;
}
#newspaper-a th
{
	padding: 12px 17px 12px 17px;
	font-weight: normal;
	font-size: 14px;
	color: #039;
	border-bottom: 1px dashed #69c;
}
#newspaper-a td
{
	padding: 7px 17px 7px 17px;
	color: #669;
}
#newspaper-a tbody tr:hover td
{
	color: #339;
	background: #d0dafd;
}


#newspaper-b
{
	font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
	font-size: 12px;
	margin: 45px;
	width: 480px;
	text-align: left;
	border-collapse: collapse;
	border: 1px solid #69c;
}

 

 

What am I dong wrong?

 

Thanks

 

Oded

 

Hi

 

I'm trying to increase the width of the columns but am not able to make it happen.

I tried both width on the pageBlockTable and on the column but nothing works.

 

What am I doing wrong?

 

 

	                    <apex:pageBlockSection title="Pending Orders">
		                    <apex:form >        
		                        <apex:pageBlockTable width="80%" value="{!mySearchResults}" var="entry">
		                            <apex:column headerValue="Select"> 
		                                <apex:inputCheckbox id="checkedone" value="{!entry.isSelected}"/>
		                                <apex:actionSupport event="onclick" />
		                            </apex:column>
		                            <apex:column value="{!entry.libTitle.Type__c}" headerValue="Type"/>
		                            <apex:column width="500px" value="{!entry.libTitle.Name}" headerValue="Name"/> 
		                            <apex:column value="{!entry.authors}" headerValue="Autors"/> 
		                            <apex:column width="5000px" value="{!entry.libTitle.Abstract__c}" headerValue="Abstract"/> 
		                            <apex:column value="{!entry.libTitle.Publication__c}" headerValue="Publication"/>
		                            <apex:column value="{!entry.libTitle.Publish_Date__c}" headerValue="Publish Date"/>
		                        </apex:pageBlockTable>
		                    </apex:form>                     
	                    </apex:pageBlockSection>
					</apex:pageBlock>

 

Thanks

 

 

 

Hi

 

I have a table with the first column being a checkbox.

When checked this checkbox causes a refrash of the page and I want to avoid it.

I'm using the onclick event (with no call to the controller) but when I remove it the check is not saved to the controller and my logic is not working properly.

 

Need help, This is my code:

 

 

<apex:page Controller="SearchCheckedOutBooksController" showHeader="false" Tabstyle="Library_Order__c">
  <apex:sectionHeader subtitle="ECI Information Center Portal"/>
   <style>
      .activeTab {background-color: #2369FF; color:white; background-image:none}
      .inactiveTab { background-color: lightgrey; color:black; background-image:none}
   </style>
   <apex:tabPanel switchType="client" selectedTab=" tabCard" id="InfoCenterTabPanel" tabClass="activeTab" inactiveTabClass="inactiveTab">   
      <apex:tab label="News" name="News" id="tabnews">
         <apex:detail relatedList="false" title="true"/>
      </apex:tab>
      <apex:tab label="My Library Card" name="Card" id="tabCard">
         
            <apex:pageBlock title="Search My Library Orders" mode="edit">         
                <apex:form >                       
                    <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Subscriber ID to query&nbsp;</label>
                    <apex:inputText value="{!subscriberId}"/>
        
                    <apex:commandButton action="{!searchOrders}" value="Search" rerender="orderResults"/>                  
                </apex:form>                     
            </apex:pageBlock>
                    
           <!-- The results for each call are handled here. -->              
               
            <apex:outputPanel layout="block" id="orderResults">
                <apex:outputPanel rendered="{!IF(hasError == false,true,false)}"> 
                    <apex:pageBlock title="Search Results">
                        <apex:pageBlockButtons >
                            <apex:form >        
                                <apex:commandButton value="Cancel Selected Orders" action="{!cancelOrder}"/>
                            </apex:form>
                        </apex:pageBlockButtons>
                        
                        <apex:pageBlockSection title="Pending Orders">
                        <apex:form >        
                            <apex:pageBlockTable width="50%" value="{!myPendingOrders}" var="entry">
                                <apex:column headerValue="Select">
                                    <apex:inputCheckbox id="checkedone" value="{!entry.isSelected}" disabled="{!entry.disable}"/>
                                    <apex:actionSupport event="onclick" />
                                </apex:column>
                                <apex:column value="{!entry.order.Name}" headerValue="Order ID"/> 
                                <apex:column value="{!entry.order.Type__c}" headerValue="Type"/> 
                                <apex:column value="{!entry.order.Status__c}" headerValue="Order Status"/> 
                                <apex:column value="{!entry.title}" headerValue="Title"/>
                                <apex:column value="{!entry.order.Order_Date__c}" headerValue="Order Date"/>
                                <apex:column value="{!entry.order.Fulfillment_Date__c}" headerValue="Checkout Date"/>
                                <apex:column value="{!entry.order.Return_By__c}" headerValue="Return By"/>
                            </apex:pageBlockTable>
                        </apex:form>                     
                        </apex:pageBlockSection>
                     
		   </apex:pageBlock>
                    
                </apex:outputPanel>
 

   </apex:tabPanel>  

</apex:page>

 

 

 

 

Hi


My problem is that all the fields on my object are not visible.


Overview:

This is probably due to a mistake I made when forgetting to include the Profile in the change set when updating my work from the sandbox to the production.

Before I realized the mistake I refreshed my sandbox with the data in the production and now in both I can't see the objects' fields when creating a new one.


The only way I know to fix this is by going into each and every object and field and changing it's Field Level Security and sometimes also it's Field Accessibility but this is a lot of manual labor.


I did save my old src directory in my Forec.com IDE but I'm not sure how can I use the Profile, Layout and Object files to help me resolve this problem and reconstruct the old visibility definitions for the profiles.

I couldn't find where these settings are referenced in the files.

Is there any easy way to change all the files without going into each one or even better apply my old setting from the files I saved?

 

Help much appreciated...

 


Hi

 

I would like to post (share) a message on my Facebook Wall from my Application.

Does anyone know if it is doable?

 

If it is what is the right way to do so?

 

Thanks

 

 

Hi

 

I'm trying to deploy a change set I've uploaded from my sandbox.

 

The change set includes only one custom object.

 

The validation fails with the following message:

 

Position__c Custom Object Definition The sharing model cannot be updated through the API.

 

I can't find the reason for this.

 

Please help...

Hi

 

I'm facing a problem which I haven't found how to overcome:

 

I have two custom objects, these objects have a lookup relationship and therefore can be created from the corresponding related list on the lookup object object.


My problem is that for custom object AAA, when I create new (through the Related List) the save action takes me back to the Related List (on the Object page) but for the custom object BBB, after save I get the page showing me the object I just created (Details Page).

 

I want to achieve the first behavior, and I was told that because object BBB has a Recod Type (which I select first thing when I create the object) I get the second behavior.

 

Its really importent for me to achive the first behavior for both.

Any idea how to work around this?

 

Thanks

Hello

 

I'm looking for advice on how to approach this case I have:

 

I need to process thousands of objects when a user clicks on a button and for each object I have to do one HTTP callout.

 

I know there is a limit of 10 callouts per request and 1 callout per batch execution.

Also there is a Maximum timeout for all callouts request.

 

I thought of two options:

 

  1. split my objects to groups of 10 using javascript and call my apex class for each group. It this case, in the extreme case there might be hundreds of such groups.
  2. use batch apex (I haven't done it before but I know there such an option) when each batch iteration will process 1 object. In this case thousands of iterations will be needed.

I'm not sure what is the best solution for my case and which will not hit the Limits.

 

Thanks

 

Kruvi

 

  • August 11, 2011
  • Like
  • 0

Hello all

 

I'm building a public portal where one of the things a user can request is to be sent an email with some info.

I'm using an APEX code with Messaging.SingleEmailMessage.

 

The problem is that I'm getting NO_MASS_MAIL_PERMISSION which might be because a Guest User Profile has no Send Email feature.

 

Is that correct?

What is the right way to send and email from APEX in such a case?

 

Thanks

 

Oded

Hello

 

I need some expert advice...

 

I want to have some code to be executed once the user leaves a VF page.

My case is that I want to save some changes the user makes to the page only when the user leaves the page to avoid multiple database calls.

 

Is there any way I can do that?

 

Thanks

 

Oded

Hello

 

I have a case where I have a public portal VF page and I want to show an image on this page.

 

Initially I wanted to use the Attachment object (I attached the image to the object showing on the page) but when I did that I got an unauthorized access error, which I assumed is because the Attachment object is not accessible to a Guest user.

 

Same think happened if I use the Document object to store the image.

 

Can someone advise what is the right way to achieve this apart from using a Static Resource?

 

Many thanks

 

Oded

Hello

 

I need some expert advice.

 

I have an object representing an Article; an Article has 4 Author fields which initially I made text fields.

But then cam the requirement to make these fields selectable from a picklist or lookup.

 

These lists are of course dynamic as more articles are added to the DB.

 

I thought of implementing Bob Buzzard's VF lookup (http://bobbuzzard.blogspot.com/2010/09/visualforce-lookup.html), but I then realized that a VF page cannot be added to an edit layout (only details).

 

I thought of using a Custom setting but I don't think this will help answer the requirement.

 

Any ideas how can I add an option to select from list or lookup on the edit layout?

 

Many thanks

 

Oded

Hey guys-

 

I could really use some help with a VisualForce page I need to create.  Since Salesforce does not give the standard capability to create new Lookup page layouts (only can modify the columns on the standard layouts), I need to create one that looks and acts like a standard Lookup layout.

 

The reason why I need to do this is because the Lookup page layout URL will be used in an external application.  The user will search for the Account name, and the search results would display the Account Name, and Account ID (custom field).

 

Any help would be greatly appreciated!!

 

 

 

 

  • July 08, 2011
  • Like
  • 0

Hello

 

I have a relatively large SOQL query (I'm filtering according to about 10 different fields) and three of the fields I'm filtering are Long Text Areas.

I'm getting the following error (this is for one of the fields):

 

querySystem.QueryException: field 'Abstract__c' can not be filtered in query call

 

I assume that Long Text Areas cannot be filtered and I wonder if anyone has a workaround for this limitation?

 

Thanks 

 

 

Oded

 

Hello

 

I could really use some expert advice.

 

I have a Home Page Component that only includes a VF page.

I defined it as a custom component with (HTML area).

This is my code:

<br><iframe src="/apex/SubscriberCard?core.apexpages.devmode.url=1" width="100%&quot;" height="100%"></iframe><br>

I can see the page when I'm in the component Edit mode.

But when I go to the Homepage I see nothing but an horizontal line at the top.

 

I can't figure out what is wrong and why it is not working.

 

Thanks

 

Oded

I have a VF page that calls a controller extension...when I place the VF page on a standard page and layout, it appears when the standard page is in view mode.  When the standard page goes to edit mode, the VF page section no longer renders.

 

I have tried exposing properties on the controller extension to set the "rendered" property of pageBlocks, but have not been successful.

 

Can someone explain the best way to show a VF page on a standard page when the standard page is in edit mode?

 

Thanks

Message Edited by Clifford on 03-28-2009 05:23 PM