---
name: Opportunity Days Till Close Formula
description: Build an Opportunity formula that calculates days between CreatedDate and CloseDate.
tags: formula, opportunity, admin
---

Create a formula field on `Opportunity` named `Days till Close` that calculates the number of days between the `CreatedDate` and `CloseDate` fields, if `CloseDate` is not null. 

Deploy this class to my org using the Salesforce DX MCP Server.

Provide instruction on how to set field level security for my profile and add the new field to the page layout.