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
Daniel MasonDaniel Mason 

Process builder vs Apex for this functionality

Hi All , 

I am hoping you can help me.

Once the Obligiations is  complete, the ‘Complete Obligiation’ button should be clicked by the User and the following should happen:
  1. The "Obligation Next Due" field should never fall on a weekend or any date which is referenced in the "business hours"
  2. The "Obligation Next Due" field  should calculate the next "date value" based on the Frequency and
    Deadline Date 
  3. Update the ‘Obligation Last Completed on" with the data of the button execution. 

Object Name    Client_Obligations
API Name    Client_Obligations__c

field: frequency
api : Frequency__c
data type : picklist 
value : Monthly_BD

Business hours name : Client Obligations
id :

Expected out come : 

frequency : Monthly_BD
Deadline Date 9/16/2016 (12th business day of september)
User pushes the button "Complete Obligiation’ the "Obligation Next Due" should be "10/17/2016" (12th business day of october)

Really appreciate your help and advice 

Hi Daniel,

As I unerstand, you will need Apex to complete this requirement. Since this activity is needed on click on Button, you will have to compelte this by creating a custom button which calls the Apex controller to implement the requirement.

Let me know if this helps to proceed ahead .

Daniel MasonDaniel Mason
Hi. That does indeed help. Now the question is how to begin to write this. I Was hoping it be simple
Hi Daniel,

How comfortable are you with Apex?

Check out the below mentioned link for creating Custom button and calling apex controller.
Daniel MasonDaniel Mason
Hi, I am not at all. I will read through the links and have a browse. Alternatively I see if I can find someone to help me and il ? them an amount
Ok. Let me know if you need any further help.

Daniel MasonDaniel Mason
Okay , I will read the guides and let you know. I have already created the button. I will see if I can build outvthe logic Random q, how much do you think this would cost ? for someone to write this
Not sure about it as would need to understand the exact requirement in detail. You can email me @
Parker EdelmannParker Edelmann
Hello Daniel,

Are you at all familiar with Visual Workflow? Visual Workflow can be fired from Process Builder, handle complex logic, lookup other records, use formulas, and many other things, and I believe the scenario that you're trying to accomplish. It can also be launched from a custom button.

Here's some good resources about Visual Workflow that may help you:

Daniel MasonDaniel Mason
Hi , I am familiar with visual flow and process builder/ however problem is I don't know how to write the apex class which needs to be called via the flow. Also we don't have a developer in house. So trying to find a developer who can help me out and I don't mind if there is a cost associated either