Skip to content

Commit 8420cf0

Browse files
committed
Fix date field extra credit
1 parent c626068 commit 8420cf0

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed
6.25 KB
Loading
22.8 KB
Loading
97.2 KB
Loading

exercises/extra-credit/README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,31 @@ For now, we won't give all the detailed instructions, but we will give you an ou
3131

3232
![Marketplace](DateField/date4.png)
3333

34-
5. Bind the **Selected value** property to the following formula:
34+
5. Now we have to get the selected value into our data variable. We will not set the **Selected value** property but do this through an event.
35+
36+
Select the Date field. Select the event **Property 'Selected value' changed** and attach to it a **Set data variable** flow function.
37+
38+
![Create event](DateField/setdate1.png)
39+
40+
Click on the **Set data variable** flow function.
41+
42+
![Create event](DateField/setdatavariable.png)
43+
44+
For the **Data variable name**, select our data variable.
45+
46+
For the **Record properties**, click on **Custom object** to reveal a single binding for the `salesorderdetails` field.
47+
48+
![Create event](DateField/setdate2.png)
49+
50+
Set binding to the following formula:
3551

3652
```JavaScript
37-
data["Trigger Workflow1"].salesorderdetails.expectedDeliveryDate
53+
SET_KEY(DEFAULT(data["Trigger Workflow1"].salesorderdetails, {}),"expectedDeliveryDate", FORMAT_DATETIME_LOCAL(self.value,"YYYY-MM-DD"))
3854
```
3955

56+
>**QUESTION:** What does the formula do? And why does the formula editor show an error?
4057

58+
At this point you could get rid of the old input box for the date field, and stylize the UI.
4159

4260
## Summary
4361

0 commit comments

Comments
 (0)