Auto-populate Expected Shipping date in SO and IF using a script.
Proposal summary
Expected ship date will be copied from the SO to the IF upon creation and thus to the print. The body level ship date of the SO will also be updated based on the latest ship date from the line level upon the save action of SO.
Requirement
- A line item field for expected ship date on the SO
- This line item field should be editable from the SO
- On IF creation, copy the current SO values for the estimated ship date, but it doesn’t need to be editable.
- Add a column to print the Estimated Ship Date on the SO and the IF on the PDF printouts
or the expected ship date we would like the expected ship date to be editable in the SO, but not editable in the IF. There does not need to be any scripting to update ship dates in the IF if ship dates on the SO change. As for the body level expected ship date, if you could include a script that looks at the line item ship dates and fills the body-field expected ship date with the latest one, that would be ideal. We would want the Expected Ship Date e-mail to trigger anytime one of the line item ship dates changed, which would sometimes also include a change in body-level expected ship date.
Our Solution
- A line-item field for the expected ship date on the SO will create (This will be blank, so the user can set the necessary value in each line)
- This line item field should be editable from the SO.
- On IF creation, copy the current SO values for the estimated ship date, but it doesn’t need to be editable. We will copy both body level and line level ship date to the IF. For that we will create one body level and another column field in IF to store the values.(If standard sourcing not possible at creation, then we will update the same using the script scripting)
- line level Estimated Ship Date will be added to the SO and the IF PDF printout.
- Upon the save action of the SO, we will set the body level ship date, with the latest ship date in the line level. We will only set the latest date to the body level. The remaining line item fields will remain as intact with its values. And also the email will send using the template “SO – Estimated Ship Date”
- The Expected Ship Date e-mail will trigger anytime one of the line item ship dates changed, which would sometimes also include a change in body-level expected ship date. Email will be sent using the template “SO – Estimated Ship Date”.
Do we need to send the email if the user set the date to null in any of the item lines? Will there be a chance to update the line item ship date to empty from the user.
Skyler: No, the e-mail does not need to trigger on setting the date to null.
Assumptions
- The ship date will be copied to the IF only upon the IF creation. The updates in the ship dates in the SO(both body and line)will not be reflected in IF after its creation.
- Value on the Item level ship date in the SO will be provided by the user. We are not using any script to update the line level ship date in SO.
- We’re taking the field EXPECTED SHIP DATE (ship date) in the SO as the body level field.
- We assume that the user will not make empty the line level ship date all together. So there would be at least one ship date, will exist in any of the lines.
- We cannot include the formatting on the PDF as it is using basic templates. But limited formatings are available for the email template. SO we will check that possibility and get back to you.
Risks
- The save action of SO can be slow, if there are many lines in the SO.