• Chirag Mehta
  • NEWBIE
  • 205 Points
  • Member since 2006
  • Founder & Chief Executive Officer
  • Satrang Technologies


  • Chatter
    Feed
  • 4
    Best Answers
  • 4
    Likes Received
  • 0
    Likes Given
  • 66
    Questions
  • 283
    Replies
Hello All,

               I have two apex web service methods and am unable to call these methods in java.
can any body suggest me how can use with java client program?

Thanks,
--bdr_09
  • December 12, 2008
  • Like
  • 0
Lets say I've a Force.com Site page https://ms.satrangtech.com/file?id=XXXX that is a CNAME mask for https://satrangtech.secure.force.com/file?id=XXX. 

On this page, when the user clicks the delete icon next to a file, the file should be deleted from Salesforce via a method on this page. The method works fine, when this page shows as satrangtech.secure.force.com but it does not work (and throws CORS error) when the page shows as ms.satrangtech.com.

> Failed to load https://satrangtech.secure.force.com/file?id=XXXX: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://ms.satrangtech.com' is therefore not allowed access.

I've already added CORS in Salesforce set-up for https://*.satrangtech.com
If we need to do build a portal for lets say 5K+ users, need to consider COST as primary criteria for determination, which of below option is recommended or even allowed (wrt salefsorce contract etc) ?
  1. Salesforce Customer Portal : As this involves license fee per customer, hence this solution ends up to be too costly
  2. Force.com Site with Portal : This is similar to option1, here instead first login page is branded website page and behind this page is customer portal.
  3. Force.com Site with Custom Portal : This is like we build a portal, authentication, user management etc. This will not need any extra license but this is violation to salesforce agreement  (is it?) where they dont allow creating complete login mechanism. Hence doing this in hidden manner is not recommended.
  4. Communities
  5. Pay to Salesforce based on Number of Logins per month :  instead of paying per user per month, there's one concept of paying based on logins per month.
  6. Force.com (Public) Site with CustomerId/Token mechanism (no password) :  Here user enters some unique user-id/customer-id to login, no password simply a username. This option can be selected only if customer detail are not very sensitive as its unauthenticated or you can say authenticated just baed on some unique-id. There is one work around to make it more secure by sending a token to customer email address when they enter their email address as username and then entering the token (which they will receive in email) as password.
Shouldn't there be a cost effective solution which allows  to prepare portal for users where-in the functionality to be provided is read-only or number of portal users is too high.

Thanks,
Chirag Mehta | Satrang Technologies | http://www.satrangtech.com

When trying to search a string using SOSL, it behaves differently for one search parameter vs two search parameters with logical operator.

 

Search String 1 : FIND '"com"' => No of Records Returned : 910

Search String 2 : FIND '"com" or "net"' => No of Records Returned : 762

 

Shouldn't result two also be 910 or above. Logical operator is OR statement, so theoretically it should give us more results or at least at minimum 910. Right?

 

Please help me if I'm missing on something.

 

Please note :

  • I'm using FOR SOSL (ie loop over SOSL with limit of 20 SOSL to run at max) to return more than 200 records.
  • Only one sublist is returned in my SOSL
If you navigate to account/contact/custom object we do have a related list "related content" (if content is enabled and related list is added to page layout).  My question is were are these "related content" records stored? in which object?
Using apex I'm able to upload file to content version, but not able to create or find the object which stores the "related content" information.

I'm trying to upload photo using chatter rest api, and its working great for test.salesforce.com and login.salesforce.com.

 

I'm able to login using OAUTH, do get in response instance_url, acess_token etc, and I set the instance_url in my photo upload request and its works great only when my instance_url is a nxxx.salesforce.com or c**.salesforce.com (ie it works for valid salesforce production and sandbox instances).

 

However when I try to login against *.cloudforce.com (a salesforce org), login is successful, instance_url returned is xxx.cloudforce.com, but when I use that instance url for photo upload request its says "Destination URL not reset". Is it something to do with this exception type org of *.cloudforce.com ? 

There are no triggers available on EntitySubscription and FeedLike objects, so there's no way available to log deletion of these objects. 

 

Is there a way to determine the deleted entity subscription and feedlike records for a specific period of time ie say a api call that gives last xhrs deleted records.

 

I tried using ALL ROWS and Isdeleted=true clause with  EntitySubscription to retrieve deleted records, but it's not working. 

 

 

Hi,

 

I have requirement to fetch comment likes. I'm not able to figure out on how to retrieve commentlikes.

 

FeedLike object represents likes. You can't query FeedLike records directly. They can only be queried via the parent NewsFeedUserProfileFeed, or entity feed, such as AccountFeed.

 

So to query FeedPost likes, use following:

SELECT Id, (SELECT Id, CreatedById, CreatedDate, FeedItemId, FeedEntityId FROM FeedLikes) FROM UserFeed

 

to query group post likes, use following:

SELECT Id, (SELECT Id, CreatedById, CreatedDate, FeedItemId, FeedEntityId FROM FeedLikes) FROM CollaborationGroupFeed

 

How to retrieve comment likes?

 

 

Salesforce announced PermissionSet feature in its recent release, and I'm loving it. 

 

The Winter ‘12 Salesforce release has introduced Permission Sets as a new way to manage security within the application. Each user continues to have a Profile, but Permission Sets can now be given to individual users to extend their permissions beyond what is described in their Profile. One of the current limitations is that there is no way to manage assignments of Permission Sets for more than one user at a time, which makes administration tedious.

 

So I'm trying to build visualforce page for a System Administrator to manage (assign and remove) Permission Sets for more than one user at a time i.e., Develop a tool  to assign or remove one or more permission sets to or from one or more users.

 

However, I'm caught with error "Save error: DML not allowed on PermissionSetAssignment" when trying to make INSERT DML call on PermissionSetAssignment object. API version of my apex class is 23.0 and Docs too says that this object is Createable. 

 

What is that I'm missing or is it something not released yet?

Sort of confused on how to find top most item from a group in SOQL.

 

Below requirement is around Chatter objects.

 

User status update fires user trigger as it updates status field on user. It dosen't fire FeedItem trigger. However, internally corresponding FeedItem record is also inserted with Type='UserStatus'

 

So If i need to get FeedItemId for the UserStatus update, then the only way possible to get feeditemid for corresponding user status update is to query and get it. But as we are building a bulk trigger, so we would need to group feeditem table by userid(ie parentid), sort by createddate and just pick first one. However, in SOQL I'm having hard time to write a query which gives me top item from every group.


So I've currently made code to fetch all user statuses and then create a map with most recent status's feeditemid per user (But this will not work if there are 200 user status update and each user already having 100s of status update. Any advice?)

 

Map<Id,Id> userFeedItemId = new Map<Id,Id>();    	
		for(FeedItem f : [Select Id,ParentId from FeedItem where Type='UserStatus' and ParentID IN :userIDs order by CreatedDate desc,Id desc]) {
            if(!userFeedItemId.containsKey(f.ParentId)){
            	userFeedItemId.put(f.ParentId,f.Id);	
            }
        } 

 

I'm trying to build the "JavaClientExample" as described @ http://wiki.developerforce.com/index.php/Getting_Started_with_the_Force.com_Streaming_API

 

I am able to successfully connect to salesforce, but post that I get following error: (Any idea or help will be really appreciated)

Waiting for handshake
2011-10-20 11:29:24.779:INFO:org.cometd.client.BayeuxClient@229902:
java.net.ProtocolException: Unexpected response 401: TransportExchange@21375057=POST//na1.salesforce.com:443/cometd/handshake#7
	at org.cometd.client.BayeuxClient$PublishTransportListener.onProtocolError(BayeuxClient.java:969)
	at org.cometd.client.transport.LongPollingTransport$TransportExchange.onResponseComplete(LongPollingTransport.java:291)
	at org.eclipse.jetty.client.HttpExchange$Listener.onResponseComplete(HttpExchange.java:920)
	at org.eclipse.jetty.client.HttpExchange.setStatus(HttpExchange.java:263)
	at org.eclipse.jetty.client.HttpConnection$Handler.messageComplete(HttpConnection.java:622)
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:862)
	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:214)
	at org.eclipse.jetty.client.HttpConnection.handle(HttpConnection.java:269)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:515)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:529)
	at java.lang.Thread.run(Unknown Source)

 

I want to add a button on edit page of a record (say button which opens an external URL in a new window, may be a a url for reference). How do I achieve so?


There's always option of overriding with visualforce page, but there's lot of pitfalls around that approach (say a new recordtype or field is added, you need to create new visualforcce page or update the page respectively etc)

Any idea on how to achieve this? 

 

Chirag

 

 

PageReference pr = Site.login(emailAddress,p.regPassword,'/PersonalDetails');

 

 

Above piece of code generates following URL

 

 

https://zebra.force.com/asia/secur/frontdoor.jsp?cshc=0000000xrYf0000000HGIN&portalId=060T00000004f1h&refURL=https%253A%252F%252Fzebra ....

 

 

On debugging, I found that an extra "25" is added at multiple locations. If I remove all the instances of "25", it works perfectly fine and I am able to login to customer portal

Correct URL

https://zebra.force.com/asia/secur/frontdoor.jsp?cshc=0000000xrYf0000000HGIN&portalId=060T00000004f1h&refURL=http%3A%2%2Fzebra...                                    

 

What can be the reason for this extra "25"?
Anything specific to user locale? (Current Locale : United Kingdom)

 

I am working on aVisualforce-Customer Portal based Eventforce application development. Part ofthis application includes a flex calendar embedded inside a visualforcepage. This calendar shows user's event attendance details.

 

Flex being a non nativelanguage to Salesforce, to interact with salesforce we either need to hard-codethe username password or pass in the session id. Both the approaches haveattached con to it, of opening security to certain extent. So in best interestof security we made the interaction between flex and Salesforce possible usingfollowing approach  

 

  1. Create a Force.com Site
  2. Expose a VF page which accepts userid as input and returns his/her attendance details in JSON format
  3. Now, flex makes a HTTPRequest to above site url with userid as input, gets the JSON response back and parses the response and displays the attendance in graphical format inside flex.  

 

During this interactionwe are facing a security hurdle .... on accessing visualforce pagehttps://c.cs0.visual.force.com/apex/myCalendar which hosts the flex file"CMScheduleFlex", i recieve following error ...

 

Error #2048: Security sandbox violation: https://c.cs0.visual.force.com/resource/1269610884000/CMScheduleFlexFile cannot load data from https://qlikview.qonnect.cs0.force.com/mycalendar/scheduleService

 

Here https://qlikview.qonnect.cs0.force.com/mycalendar/scheduleService is a site URLbeing HTTPRequested from Flex to retrieve in return JSONresponse.

 

This seems like a crossdomain problem. I read on net that this has something to do with crossdomain file, what I know is that it's an xml file located in the root of theweb server, with something like this 

 

<?xml version="1.0"?><cross-domain-policy><allow-access-from domain="*" to-ports="*"secure="true" /></cross-domain-policy>

 

 

Also, few forums mentionthese instructions:

 

Security.allowDomain()Security.allowInsecureDomain()

 

But the question is where do we place the crossdomain.xml file in case of Salesforceor where do we write the lines Security.AllowDomain.  Any help or suggestions? 

 

Please note that 

There exists a cross domain xml located on each salesforce instance for eg 

https://qlikview.qonnect.cs0.force.com/mycalendar/services/Soap/cross-domain.xml 

 

Both the url's are being served from same domain, but not same sub-domain. In that case how can datatransfer between two different sub-domains be allowed?

Message Edited by Chirag Mehta on 03-29-2010 11:32 AM

Command links with param are not working inside "repeat inside repeat" code. The action method attached to the command link is not getting invoked.

 

Any suggestions?

 

 

<apex:repeat value="{!listData}" var="l" rendered="{!NOT(ISNULL(listData))}">

<apex:repeat value="{!l.Items}" var="c"><tr>

<td>{!l.Title}</td>

<td>{!c.Description}</td>

<td>{!c.Name}</td>

<td>

<apex:commandLink value="View" action="{!viewId}">

<apex:param assignTo="{!selectedId}" name="selectedId" value="{!c.Id}" />

</apex:commandLink>

</td>

</tr>

</apex:repeat>

Message Edited by Chirag Mehta on 03-10-2010 10:36 AM

Apex Governor limit document states "In a SOQL query with parent-child relationship sub-queries, each parent-child relationship counts as an additional query. These types of queries have a limit of three times the number for top-level queries."

 

1) Referring to "In a SOQL query with parent-child relationship sub-queries, each parent-child relationship counts as an additional query." If i execute following query, the no of SOQL executed needs to be Three. Yet debug log shows me 1 Query (and not 3). Am I missing anything?

List<Account> a =[Select Id, (Select Id from Contacts),(Select Id from Cases) from Account];


2) Can someone elaborate more on what does "These types of queries have a limit of three times the number for top-level queries." means?

Is there any method in Apex which allows to move a selected opportunity to next stage.

 

Something like

opportunity o = [Select Id from Opportunity where Id ='asdsdasd' limit 1]; o.StageName = o.nextStage(); update o;

 

There's a trigger on Lead which creates case for every inserted lead. This trigger creates case without any contact information (i.e., ContactId field is kept blank).  Now consider following 2 scenarios ...

  1. If i create the lead using salesforce.com interface, the trigger executes without any error and results in creation of a case.
  2. Anyhow, if i create the lead using Web2Lead form, the  trigger results in error "Creation of Case record failed: [FIELD_INTEGRITY_EXCEPTION] No selected contact: Contact ID"

Can someone state what might be the reason or what are the possible workarounds to stop this strange behaviour ...

Message Edited by Chirag Mehta on 12-07-2009 05:02 AM

scheduledApexClassName m = newscheduledApexClassName();

//Seconds Minutes Hours Day_of_monthMonth Day_of_week optional_year

String sch = '0 10,20,30,40,50 * * 11 ?2009';

system.schedule('Registration Report', sch, m);

 

Read more at http://www.chiragmehta.info/chirag/2009/11/12/salesforce-schedule-apex-to-run-at-any-time-interval/

 

 

I am using ActionSupport event On Change for a TEXTBOX (Textbox value is read by Barcode Reader). The onchange event fires and redirects to another page. This is working perfectly in Chrome but it is not working in IE and FF. 

 

Any reasons for the onchange event not working in IE and FF for a text box. 

I am trying to provide direct access to Workbench application from right inside of Salesforce Org in form or Web-Tab or Home Page link. I tried creating URL of following sorts, but neither helped me to successfully login or at least pre-populate the sessionid

http://workbench/login.php?login_type=adv&usernameStd=&passwordStd=&actionJumpStd=select.php&sessionId={!API.Session_ID}&inst=login&endp=17.0&actionJumpAdv=select.php&loginClick=Login http://workbench/login.php?sessionId={!API.Session_ID}

 
It seem's something something tricky and trivial is missing.
Message Edited by Chirag Mehta on 11-05-2009 05:25 PM
If we need to do build a portal for lets say 5K+ users, need to consider COST as primary criteria for determination, which of below option is recommended or even allowed (wrt salefsorce contract etc) ?
  1. Salesforce Customer Portal : As this involves license fee per customer, hence this solution ends up to be too costly
  2. Force.com Site with Portal : This is similar to option1, here instead first login page is branded website page and behind this page is customer portal.
  3. Force.com Site with Custom Portal : This is like we build a portal, authentication, user management etc. This will not need any extra license but this is violation to salesforce agreement  (is it?) where they dont allow creating complete login mechanism. Hence doing this in hidden manner is not recommended.
  4. Communities
  5. Pay to Salesforce based on Number of Logins per month :  instead of paying per user per month, there's one concept of paying based on logins per month.
  6. Force.com (Public) Site with CustomerId/Token mechanism (no password) :  Here user enters some unique user-id/customer-id to login, no password simply a username. This option can be selected only if customer detail are not very sensitive as its unauthenticated or you can say authenticated just baed on some unique-id. There is one work around to make it more secure by sending a token to customer email address when they enter their email address as username and then entering the token (which they will receive in email) as password.
Shouldn't there be a cost effective solution which allows  to prepare portal for users where-in the functionality to be provided is read-only or number of portal users is too high.

Thanks,
Chirag Mehta | Satrang Technologies | http://www.satrangtech.com
 
Find More on it @ SFDC Community
 
 
How does it works .... Its really  simple thing
 
There a  function called CreateButtons which does simply creation of a button using the CSS of SFDC
thats why it looks like SFDC Button
 
function CreateButtons() {
 for (Button = 1; Button < 5; Button++){
  var ButtonId = "button" + Button + "text";
  var ConstructedButtonId = "button" + Button
  var buttontext = document.getElementById(ButtonId).value;
  if (buttontext != "") {  
   var constructedbuttontext = "<INPUT class=btn type=button title=Create value='";
   constructedbuttontext+= buttontext;
   constructedbuttontext+= "'>";
   document.getElementById(ConstructedButtonId).value = buttontext;
   document.getElementById(ConstructedButtonId).style.display = "inline";
  }
 }
}
Hello frnds i want to retrieve data from SFDC on basis of list of ID's
 
I tried two ways but both are not working
 
1)using retrieve method
String fieldList="Id,Website_Unique_ID__c,ConvertedContactID,IsConverted";

sObjects=sfdc.retrieve(fieldList,"Lead",idArray);

An unexpected error has occurred.; nested exception is:

java.lang.IllegalArgumentException: array element type mismatch

2)using Query method

String fieldList="Id,Website_Unique_ID__c,ConvertedContactID,IsConverted";

String query1 = "Select "+fieldList+" from Lead where "+idList;

System.out.println(query1);

QueryResult qr=sfdc.query(query1);

Output:-

Select IsConverted from Lead where Id='00Q3000000E47VJEAZ' OR Id='00Q3000000E47V9EAJ' OR Id='00Q3000000E47VBEAZ' OR Id='00Q3000000E2Vs1EAF' OR Id='00Q3000000E47VZEAZ'

- Exception:

org.xml.sax.SAXException: Invalid element in com.sforce.soap.enterprise.sobject.SObject - type

at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:258)

at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)

at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)

at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)

at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)

at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)

at org.apache.axis.client.Call.invoke(Call.java:2467)

at org.apache.axis.client.Call.invoke(Call.java:2366)

at org.apache.axis.client.Call.invoke(Call.java:1812)

at com.sforce.soap.enterprise.SoapBindingStub.query(SoapBindingStub.java:1656)

at brsfdc.BRSFDCDatabase.retrieveFromSFDC(BRSFDCDatabase.java:107)

at brsfdc.BRSFDCIntegrationProcess.main(BRSFDCIntegrationProcess.java:77)

An unexpected error has occurred.; nested exception is:

org.xml.sax.SAXException: Invalid element in com.sforce.soap.enterprise.sobject.SObject - type

 
 
Hi,
What is the best way to offer this type of support functionality to users?
We are a Salesforce Partner and we have a number of clients using our app. We would like for those users to have the option to open a chat to get in contact with our support team.

Intercom recommendation:
"Ultimately the most important factor would be whether you're able to place a Javascript snippet on the page that can communicate with us and to send information and have the Messenger appear. "

Is that possible?

Thanks.
Emeric.
  • September 21, 2018
  • Like
  • 0
Hi all,

everybody writes about how to migrate a change set from a Sandbox to Production, but nobody about how to migrate or export from a Sandbox environment in one organization to a Sandbox organization in another environment.
I have read about using the ANT migration tool, but for the ones who are newbie using ANT there aren't detailed descriptions how to export a change set or to use ANT to migrate the change set from Sandbox to Sandbox in differente orgs.

Does somebody here knows how to do it?
I think my syntax is correct, but attachments are empty even for Accounts with attachments.
 
<apex:page StandardController="Account" readOnly="true" recordSetVar="Accounts" showHeader="false" sidebar="false" cache="false">
    
    <apex:variable var="forceDomain" value="http://districtbridges.force.com" />
    
    <apex:repeat value="{!Accounts}" var="account" rows="1">
        <h3>Account: {!account.name}</h3><br />
        Attachments:<br />
        <apex:repeat value="{!account.Attachments}" var="att">
            - {!att.id} {!att.name}<br />
        </apex:repeat>
        EndAttachments<br />
    </apex:repeat>
</apex:page>



 
I'm looking into being able to call the Google Play Developer API from APEX through Google's OAuth 2.0 for Server to Server implementation using service accounts. I understand that there is existing integration of SalesForce with the Google Data APIs through the Google Data API Toolkit but this doesn't seem to extend to a number of Google's other APIs. I was wondering if anyone has tried previously to integrate with this API or has any information about if it’s possible or how I might go about it.
Many thanks.
 
Hi
I am trying to use braintree payment system in salesforce and I want to checkout in salesforce using the braintree payment gateway, Is there any SDK for salesforce?. Can anyone pls help to integrate salesforce with braintree? 
  • November 26, 2015
  • Like
  • 0
Hi,
I'm trying to use the integration API in a Canvas application hosted in a 3rd party server, and shown in console mode. As per https://developer.salesforce.com/docs/atlas.en-us.api_cti.meta/api_cti/sforce_api_cti_connecting.htm (https://developer.salesforce.com/docs/atlas.en-us.api_cti.meta/api_cti/sforce_api_cti_connecting.htm), I'm including the following javascript in my server:
    <script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
    <script type="text/javascript" src="https://emea.salesforce.com/canvas/sdk/js/34.0/canvas-all.js"></script>
    <script  type="text/javascript"src="https://emea.salesforce.com/canvas/sdk/js/34.0/controller.js"></script>
    <script src="https://emea.salesforce.com/support/api/34.0/interaction.js" type="text/javascript"></script>
    <script src="https://emea.salesforce.com/support/console/34.0/integration.js" type="text/javascript"></script>

When I try to use the integration API, nothing happens (no error, no outgoing requets). Digging a bit, during the page initialization, I've found in the console the message: "Service Cloud Toolkit API cannot be used with your browser.". This message can be found in line 323 in integration.js, in a method that tries to initialize crossdomain communication, and in my case, fails.

Am I missing something? Isn't this 'scenario' (canvas in 3rd party server in console mode) supposed to works?
Thanks in advance,

José
 
I'm following the example shown on Peter Knolle's post here: https://developer.salesforce.com/blogs/developer-relations/2015/03/lightning-component-framework-custom-events.html

When creating the contactSearch Component, I'm getting the following error:

"Failed to save undefined: No CONTROLLER named apex://mynamespace.ContactSearchController found: Source"

I'm not sure what I've missing - any thoughts?
For the past 3 months i have been  using the eclipse forece.com IDE and MavensMate plugin for sublime text to work with costume apex classes on my sandbox (cs14.salesforce.com)
I can't connect using either of these IDEs to saleforce. 
I get a connection time out error
I have not changed any configuration on my sandbox form what i am aware of 
Both IDE's use the tooling API so i assume the issue is connecting with the tooling API
I have tried the following
1) 2 different networks form different service providers. So its not the network
2) 2 different laptops. So its not the local computer and any setting on it
3) 2 different IDES, force.com IDe and mavensMate. So its not the IDE or their configuration
4) 2 different sandbox instances  (cs14 and cs15). So its not the sandbox
After all this the only constant and clear suspect is the tooling API
I opened a case with sale force and as usual they say everything seems fine on there end and they can't help     
  

Recently come across this request from management, that they want put up the dashboard on a wall mounted monitor.

 

I have went through lots of posts regarding this topic, however the approach of using javascript cross site scripting on a visualforce page that never worked for me

until Google Developer Tools (F12) gave me something very interesting.

 

After I click Refresh button, in the Developer Tools window, under Network tab, a page file named dashboardRefresh.apexp is shown immediately.

If you click on it, under Header tab in the righthand side window, you see Request URL:https://[Domain].salesforce.com/dash/dashboardRefresh.apexp 

Inside "FormData" section in the lower paragraph, you can see id:[DashboardID]

 

If you put them together like this: https://[Domain].salesforce.com/[DashboardID] and paste into your browser, you get a page with only a line of string on it,

which a says something like below: 

{"lastRefreshRelativeTime":"Today at 12:13 PM","lastRefreshTime":"As of 19/08/2013 12:13 PM","needsUpdate":true}

 

Now if you reopen your dashboard or if you haven't close it down, just by refreshing the dashboard page, what you will see is the time showing next to the Refresh button is updated.

 

So this actually makes what the business wanted is possible and to be done in a very easy way.

Since it is only for using on a wall mounted monitor, it only requires a full-screen page pretty much all the time.

You need to two taps, with the http://[Domain].salesforce.com/[DashboardID] running kinda behind the scene when the dashboard page is on fullscreen mode.

And install a page auto refresh addon for your browser and configurate the time interval for both tabs.

 

For example

 

 

Chrome

 

Auto Refresh Plus

 

 

 

FireFox

 

Auto Refresh

 

 

 

Safari

 

Safari Tab Reloader

 

 

Note: I am not quite sure about the the possibility of having a time lag, it might be better to configruate to have the dashboard page refreshed a little bit late than the "dashboardRefresh.apexp" page.

 

 

In summary, it gives me what I wanted, and no code needed, works on most broswer as long as you can find addon does the refresh for you and

also everyone who has a credential can do it, and this is case, by having tabs openning doesn't seems affect user experience.

 

 

 

  • August 19, 2013
  • Like
  • 1

Dear Members,

 

I came accross a very surprising(annoying as well) problem when i tried to send the EMail using SingleEmailMessage.

 

I used setTargetObjectId(User.Id) and send near about 800 emails from my development org. My Email Limit remained as it is.

But when I used setTargetObjectId(Contact.Id) and tried to send the emails then i came Accross SINGLE_EMAIL_LIMIT_EXCEEDED.

 

Can anybody suggest and Provide input on this as salesforce documentation provide contradictory info in below Link:

 

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

 

"There’s no limit on sending
individual emails to contacts, leads, person accounts, and users in your organization directly from account, contact,
lead, opportunity, case, campaign, or custom object pages.
"

 

"You can send an unlimited amount of email to your organization’s
internal users, which includes portal users.
"

 

Thanks In Advance,

 

Ghanshyam Bhatt

 

 

We send numerous emails to numerous internal Salesforce users for things like job failures in Apex.  We always assumed that setting the toAddresses() field to the email address of an internal user (ie. first.last@mycompany.com) would qualify as an internal email.  After hitting some limits, I'm questioning that assumption. It appears that sending an email like this will still qualify as an external email even though there is a internal Salesforce user with that email.  Can someone please confirm?

 

Should we instead use setTargetObjectId(internalUserId) to guarantee the email as counted as an internal address and will not count against our limit?  If so, how do we send to numerous internal users at the same time?  Messaging.SingleEmailMessage only has the singular method setTargetObjectId() and not the plural version setTargetObjectIds().

 

Any clarification is appreciated.

 

Andrew

 

Messaging.SingleEmailMessage emailMsg = 
     new Messaging.SingleEmailMessage();  
emailMsg.setTargetObjectId(internalUserId);
//must be false if sending to internal user    
emailMSg.saveAsActivity = false; 
emailMsg.setSenderDisplayName('sender name');  
emailMsg.setSubject('some subject');  
emailMsg.setBccSender(false);  
emailMsg.setUseSignature(false);  
emailmsg.setPlainTextBody('email body');  
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { emailMsg });

 

I'm trying to upload photo using chatter rest api, and its working great for test.salesforce.com and login.salesforce.com.

 

I'm able to login using OAUTH, do get in response instance_url, acess_token etc, and I set the instance_url in my photo upload request and its works great only when my instance_url is a nxxx.salesforce.com or c**.salesforce.com (ie it works for valid salesforce production and sandbox instances).

 

However when I try to login against *.cloudforce.com (a salesforce org), login is successful, instance_url returned is xxx.cloudforce.com, but when I use that instance url for photo upload request its says "Destination URL not reset". Is it something to do with this exception type org of *.cloudforce.com ? 

Hello. When I execute Url. getSalesforceBaseUrl().toExternalForm() in the system console, the returned URL uses https:// However, when I execute this in the finish() method of Batch Apex, it returns http:// 

Is this a bug? I need https:// returned in the Batch Apex. 

Thanks 
David
 

Apex constructors seem to be being called twice (on cs9).... Is this normal? Anyone know anything about this?

  • September 15, 2011
  • Like
  • 0

I would like a command like to look like a command button. I was once told that I could to that with using the style but I am having trouble figureing out how to do it. Can anyone give me a hand. Thanks

Is it possible to use apex:param as a child of actionpoller so that more than one action poller can be used on a single page, each calling a controller method with a specific variable value being set, eg, nest an actionpoller inside an apex:repeat, and pass the controller a variable that's different for each, and have the rerendered section (also in teh repeat) use this set variable to show a different set of items?

 

Practical use, populating multiple lists of items from multiple web services API calls, all on teh same page, and all via AJAX.

I have been going around with Salesforce for a while about an "Undocumented Feature".  They stand behind the viewpoint that thie issue in question is by design and not a bug.  I however feel it is otherwise.  Wanted to get other's views on this.

 

 


Issue is that if you send an email out, it generates an activity log (task).  This is what we want.Salesforce uses batch processing, so whether you insert 1 record or 100 records, the associated trigger should be called only once.Problem is, when sending out 100 emails it generates 100 activity logs, but each is created individually, thus the trigger is called 100 times.

If the Task trigger were to perform any action, such as reading from the database, you just hit your limit due to the email api not working in batch mode when creating activity logs!  If everything is Salesforce is setup to work in batches, why not the SendEmail function, which takes a list of email objects to send in batch?

 

 

Code to reproduce this is as follows (look at log file to see Task Trigger is being called for every email sent). 

 

 

trigger SalesforceEmailIssue_Task on Task (before insert) { System.debug('********** SalesforceEmailIssue_Task *****************'); } public class SalesforceEmailIssue { public static void GenerateEmails(List<Contact> listContacts){ System.debug('********** SalesforceEmailIssue *****************'); System.debug('# of contacts: ' + listContacts.size()); List<Messaging.SingleEmailMessage> listMessages = new List<Messaging.SingleEmailMessage>(); // Build list of messages for(Contact c : listContacts){ Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); mail.setSaveAsActivity (true); mail.setHtmlBody('Test'); mail.setSubject('Test'); mail.setTargetObjectId (c.Id); listMessages.add(mail); } // Send emails try{ Messaging.sendEmail(listMessages); } catch(Exception ex){ System.debug('Exception occured: ' + ex); System.Assert(false, ex); } } //######################################## // TEST //######################################## public static testMethod void test(){ integer numOfEmails = 10; string emailAddress = 'claytond@axiumae.com'; try{ System.debug('********* CREATE ACCOUNTS ******************'); List<Account> listAccounts = new List<Account>(); for(Integer i = 0; i < numOfEmails; i++) listAccounts.add(new Account(name='Test' + i, BillingState = 'OR', Type='Prospect')); insert listAccounts; System.debug('********* CREATE CONTACTS FOR EACH ACCOUNT ******************'); List<Contact> listContacts = new List<Contact>(); for(Account a : listAccounts){ //Contact c = AxTestRecords.createContact(a.Id, true); listContacts.add(new Contact( FirstName = 'John' , LastName = 'Doe' , AccountId = a.Id , MailingState = 'OR' , Contact_Role__c = 'Billing Contact' , Email = emailAddress) ); } insert listContacts; GenerateEmails(listContacts); } catch(Exception ex){ System.debug('Exception occured: ' + ex); System.assert(false, ex); } } }

 

Hi experts,
I found a Salesforce object named OpportunityContactRole by using the IDE (Eclipse) and I want to add a new trigger for this object but I got the following Error message when try to save the new created trigger:
    Save error: SObject type does not allow triggers: OpportunityContactRole
I really need to add the special processing to this object before updating, do any experts have any idea how to fix this issue?
Best regards!
Boi Hue


Message Edited by boihue on 12-09-2008 11:02 AM

Message Edited by boihue on 12-09-2008 11:02 AM
  • December 09, 2008
  • Like
  • 0
I created a package and uploaded it to App Exchange, but I later realized that I should have chosen something else for the name of my namespace.  How do I now edit my namespace?  By clicking on the "Help on this page" link on I read this (on "Setup" -> "Exchange" -> "Shared Apps"):
 
"This [edit] button does not appear if you have already configured your developer settings"
 
So, that answers my original question of where the "edit" button went, but now I want to edit my developer settings.  How do I do so?
 
-Chris
  • January 23, 2007
  • Like
  • 0