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
Santi Ram RaiSanti Ram Rai 

whether project is active, iactive or closed

Hi every body,

I have crated custom object called Project, and it has fields like; Project Name, Start Date, End Date. So, my question is, how to implemented functionality whether project is  active, iactive or closed.
Arun KumarArun Kumar
Hi Santi,

You can create a new custom field of checkBox type which by default is InActive.

Thanks,
Arun
salesforce mesalesforce me

Hi.
U can create custom field checkBox types 1)Active 2)InActive
If u want to Active select the Active
if u want to InActive select the InActive

Santi Ram RaiSanti Ram Rai
And how to implement closed? Can i create picklist instead of checkBox?
Arun KumarArun Kumar
Yes, If you want to have more than two option. Picklist would be the better option to go. with Active, inActive and closed values.
Maharajan CMaharajan C
Hi Santi,

Create a Checkbox with the Name Active or use the picklist field with the Values(Active,Closed).
use the default values to field as a Active in the Checkbox because when you create a project u have a start date and end date.
then by using the Workflow and the End date you can uncheck the Active Check Box or change picklist value.

Use the Formula in Workflow-: End date =TODAY()
Criteria-:Created And Everytime Its Edited

Then give the workflow Action as a Field Update.
In the Workflow Action you Can Upadte the Check box as a InActive Or a picklist Field As Closed.

Let Me Know Is that Helpful For You...

Thanks
Raj.
(Sweet Potato Tec)
Santi Ram RaiSanti Ram Rai
Can we create trigger,  when the project end date is ended? And if the status is active, then the change status to cloased?
Arun KumarArun Kumar
Hi Santi,

you can create WorkFlowRule for this.
Santi Ram RaiSanti Ram Rai
Do you have any example ?
 
Arun KumarArun Kumar
You can create a Workflow rule and in criteria you can check for 
end date and Status value. and then create Workflow Action, in your case you need to create Field update action which will be updating status = closed.

Follow: 
http://training.handsonconnect.org/m/customizing/l/36156-creating-a-workflow-rule-and-action-example-updating-a-field

http://resources.docs.salesforce.com/198/16/en-us/sfdc/pdf/salesforce_useful_workflow_rules.pdf
Santi Ram RaiSanti Ram Rai

With rhis Formula in Workflow-: End date =TODAY(). I got this error "Error: Incorrect parameter type for operator '='. Expected DateTime, received Date"
Arun KumarArun Kumar
Change your custom field type to date only.

OR

Use NOW() function. I think your custom field End date is of date/Time type.
Maharajan CMaharajan C
Hi Santi,

Dont use the End Date as a DATE/Time Field use As the Date Field Only then use the below Formula

Formula:End_Date__c = TODAY()

Because i got the proper answer Santi...And Must Activate the Workflow....

Thanks
Raj.
(Sweet Potato Tec)
Santi Ram RaiSanti Ram Rai
Why it doesn`t work with DATE/Time Field?

Date Field :End_Date__c = TODAY(), it work,
BUT
Date/Time Field :End_Date__c = NOW(), don`t work. Why?
 
Arun KumarArun Kumar
Today() is a function with Date.

And Now() is a function with date/Time.
Maharajan CMaharajan C
Hi Santi,

Look At this Link-:http://resources.docs.salesforce.com/198/16/en-us/sfdc/pdf/formula_date_time_tipsheet.pdf

 
Santi Ram RaiSanti Ram Rai
Yes, i got it. So, when this Criteria (End_Date__c = NOW()) is made, do the Workflow Rules utomatically change the status to clased or do we need to change manually?
Arun KumarArun Kumar
You need to create  "fieldUpdate" WorkflowAction
Santi Ram RaiSanti Ram Rai
Yes i have created  "fieldUpdate" WorkflowAction, but it is not firing the action. For eg: if the End Date was yeaterday, but still status is Active. It should automatically change the status to closed. Or not? 
Arun KumarArun Kumar
You need to update the record then it will fire.. and make sure Workflow rule should be active to which you have associated this Fieldupdate Actiom.
Santi Ram RaiSanti Ram Rai
Would it not fire automatically, when the criteria is made?
Arun KumarArun Kumar
No, it won't until you will associate it to any WorkFlowRule
Santi Ram RaiSanti Ram Rai
Then is there is some way, to fire it automatically, when the criteria is made?
Arun KumarArun Kumar
Share your credentials on arungoyal063@gmail.com, I will check .
Arun KumarArun Kumar
Hi Santi,

Please let me know if the helps.

As a common practice, if your question is answered, please choose 1 best answer.
Additionaly you can give every answer a thumb up if that answer is helpful to you.

Thanks,
Arun