function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shiva RajendranShiva Rajendran 

Advantages of using salesforce for complete custom development project instead of using java and heroku?

The salesforce if it involves too much coding ,then i noticed lot of complexities in the code whenever the salesforce updates some of its featues, i would like to know why would someone go for hardcore customization in salesforce instead of choosing  java and heroku? In this case ,their are quite a lot of advantages like
1: no limits as in salesforce
2: licenses are cheap so if the user count is high , it will profitable in the long run
3: No need to have dependency on the existing functionality which may mess with the functionality required.( i have personally been through this, where an existing functionality completely complicated the custom development required)
4: And also need not concern the code breaking because of any standard functionality changes in salesforce ( i have been through this when creating the dynamic thread id in salesforce ,it crashes at some time and no guarante will it work later)

Do share your thoughts to it.

Thanks and Regards,
Shiva RV
Best Answer chosen by Shiva Rajendran
Paul Fayle 9Paul Fayle 9
My thoughts are - different horses for different courses.
  • Force.com using the base level licences (e.g. Employee Apps Starter for internal, and maybe Customer Community for external) is what I call a Platform as a Service + (PaaS+). Note the +. As opposed to Service Cloud (a SaaS). With basic Force.com you get limited use of an object model, and most importantly a whole bunch of declarative frameworks to accelerate an application build (most importantly the whole access control model - a major advanatage of the platform, and very complex if you has to build it yourself). But if you aren't making use of an authenticated paradigm, and you don't need to really leverage the Salesforce data model it makes less sense... if it is mainly a website for the general public - high traffic and low contextual data interaction then maybe not...
  • Heroku is a PaaS - giving you the tools to quickly develop your own applications or sites. Key word "develop". Sure - there are some accelerators here, but not like Force.com - and not declarative in nature. It can work brilliantly for a public/end-consumer overlay to a Force.com framework (internal app and community) - e.g. in a eCommerce paradigm for instance.
  • The assumption that Heroku is a cheaper option than Force.com is not necessarily valid (you need to assess Total Cost of Ownership - and this should take into account development costs, upgrade and maintenance considerations, etc.). It really depends on whether tha value you get from Force.com is enough to offset the cost differential in licences (because arguably the build effort would normally be more in Heroku - depending on what you are delivering).
  • In terms of code breaking - typically if you follow best practices this should never be the case (I have never seen upgrades break build in Force.com except in one instance where there were multiple triggers on a single object and they were processed in a different order post upgrade... you shouldn't have multiple triggers on a single object - so that was the real issue).

All Answers

Paul Fayle 9Paul Fayle 9
My thoughts are - different horses for different courses.
  • Force.com using the base level licences (e.g. Employee Apps Starter for internal, and maybe Customer Community for external) is what I call a Platform as a Service + (PaaS+). Note the +. As opposed to Service Cloud (a SaaS). With basic Force.com you get limited use of an object model, and most importantly a whole bunch of declarative frameworks to accelerate an application build (most importantly the whole access control model - a major advanatage of the platform, and very complex if you has to build it yourself). But if you aren't making use of an authenticated paradigm, and you don't need to really leverage the Salesforce data model it makes less sense... if it is mainly a website for the general public - high traffic and low contextual data interaction then maybe not...
  • Heroku is a PaaS - giving you the tools to quickly develop your own applications or sites. Key word "develop". Sure - there are some accelerators here, but not like Force.com - and not declarative in nature. It can work brilliantly for a public/end-consumer overlay to a Force.com framework (internal app and community) - e.g. in a eCommerce paradigm for instance.
  • The assumption that Heroku is a cheaper option than Force.com is not necessarily valid (you need to assess Total Cost of Ownership - and this should take into account development costs, upgrade and maintenance considerations, etc.). It really depends on whether tha value you get from Force.com is enough to offset the cost differential in licences (because arguably the build effort would normally be more in Heroku - depending on what you are delivering).
  • In terms of code breaking - typically if you follow best practices this should never be the case (I have never seen upgrades break build in Force.com except in one instance where there were multiple triggers on a single object and they were processed in a different order post upgrade... you shouldn't have multiple triggers on a single object - so that was the real issue).
This was selected as the best answer
Shiva RajendranShiva Rajendran
Hi Paul,
Firstly thank you so much for the response, Looks very well explained.
Actually i worked on an emailmessage draft functionality on email to case , where if a email is sent to a customer from case , some emails has to be submitted for approval for quality check.Here i used beforeinsert trigger  because the email already go when it comes to afterinsert trigger handling.
So what i did there was, in before trigger i changed the toAddress to the manager's  email , so an email goes to manager. while i copy the emailmessage data into a new emailmessage record in draft mode and submit it for approval to the manager .
Once the draft emailmessage is  approved  by the manager, email is sent to the user using afterupdate trigger
Here i noticed a strange behaviour , if the user enters the toAddress in email action from case record , the code is working fine.
But instead if the user is choosing contact record in the toAddress lookup , the email is already sent and only then the before trigger is fired.
I hope it will be fixed by salesforce soon , i hope if salesforce made changes on the functionality the code impacts. 
Also in the code ,  we calculated the custom thread id  for the record and used the thread id creation given in the internet and few times that custom thread id creation also throws an error so handled that currently , not sure will this be safe either in the future.
ref:00D"&MID(Id,4,1)&RIGHT($Organization.Id, 4) &"."& LEFT(Id,4)&RIGHT(Id,5) &":ref




Thanks ,
Shiva RV
Paul Fayle 9Paul Fayle 9
If I understand what you are trying to do here correctly, then I would look to a more OOTB approach instead. See here for approvals on draft emails:
https://help.salesforce.com/articleView?id=case_interaction_approval_processes.htm&type=5
https://help.salesforce.com/articleView?id=case_interaction_enabling_email_drafts.htm&type=5
Depends what you are using, But if this is not an option, I would instead drive the custom functionality off a custom action (one using VF/LC depending on what is more appropriate for your org) - rather than a trigger. That way you'll have full control over what is initated and how.
Shiva RajendranShiva Rajendran
Hi Paul,
The draft email functionality is not working as that in lightning. 
Morever our requirement had every user having certain percentage of value for quality check means only those percent of records should be submitted for approval.
Yeah exactly that's what even we initally thought of using a custom action which makes more sense , but the standard send email button couldnt be hidden from the layout on case in lightning , so there will be two actions on the page which would be misleading.
Hope their will be some new features  in the salesforce new release which helps in the functionality.
You have any thoughts on the below behaviour by salesforce
If the user is choosing contact record in the toAddress lookup and click sent on email action in case record , the email is already sent and only then the before trigger is fired  else the email is sent after the before trigger for emailmessage is fired but before the after trigger is fired.
Basically the email should be sent post of after trigger, not sure why salesforce behaves this way.
Thanks ,
Shiva RV
Shiva RajendranShiva Rajendran
I remember in lightning Draft Email will function as email will be sent and then be submited for approval.I remember there were notes regarding that functionality not fully developed for lightning not sure.
Thanks,
Shiva RV
Paul Fayle 9Paul Fayle 9
You can remove the email action from lightning. It all depends whether you are using feed layout or not how you'd do it, but it is 100% possible.
Shiva RajendranShiva Rajendran
Yeah Paul, You are 100% right, i could remove it from the case feed layout. We initally tried in the case layout and that's why i didn't work.It was a knowledgable info you have shared.
Also in the current implementation , it has been made using the trigger only , awaiting some salesforce upgrades which can help in fullfilling the requirement, because currently my lead suggested that to recreate the full email action with ui is complex and time consuming since we have to include attachment features and other icons on the ui as well :(  
Paul Fayle 9Paul Fayle 9
Customising an email action is actually really easy... all with prebuilt stuff: https://developer.salesforce.com/docs/atlas.en-us.case_feed_dev.meta/case_feed_dev/case_feed_dev_guide_email_publisher.htm I would go down that path.
Shiva RajendranShiva Rajendran
Hi Paul, this sounds interesting ,wasn't aware of it before.
In the current <apex:emailPublisher> , there is little support for attaching to a apex action which is crucial for the code.
they have showSendButton attribute which can be enabled and if it's enabled then standard email functionality will happen onclick of  a send button.
Now in this case, i may have to create a new button which will do the funcationality needed at the backend by attaching it to a controller and do the processing at the backend
<apex:page standardController="Case" >
  <apex:emailPublisher entityId="{!case.id}" 
      fromVisibility="selectable"
      subjectVisibility="readOnly" 
      subject="Your Cirrus support request"
      toVisibility="readOnly"
      toAddresses="{!case.contact.email}"
      emailBody=""/>
<!-- i may have to have a custom send button here -->
</apex:page>

But if i create a new button ,then ui will also be  a challenge i guess .
Not sure , i will try to dig deep into this practically and check it out.
Thanks Paul for the help.
 
waleed sheikhwaleed sheikh
you can check out for more detail
https://supermashflash2online.com/