You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ff-concepts/adding-customization/code-file.md
+131-8Lines changed: 131 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -194,7 +194,67 @@ You can use custom class fields to display values directly in the UI, and call i
194
194
195
195
### Call In Action Flows
196
196
197
-
You can also add your custom class’s methods directly within an Action Flow. For example, you can trigger the `markHelpful()` method when a user taps a “Mark as Helpful” button to update a field or increment the helpful count of a review.
197
+
You can also set fields and call methods of your custom classes directly within an Action Flow. This is useful when you want to update data or trigger custom logic as part of your app's behavior.
198
+
199
+
#### Set Field [Action]
200
+
201
+
Use the **Set Field** action to update a specific property of a custom class instance. For example, you can set `order.status = 'shipped'` when a user confirms an order, allowing the UI to reflect the change immediately.
202
+
203
+
<div style={{
204
+
position: 'relative',
205
+
paddingBottom: 'calc(56.67989417989418%+41px)', // Keeps the aspect ratio and additional padding
Use the **Call Method** action to invoke a method defined in your custom class. For instance, if your `Comment` class has a `markHelpful()` method, you can trigger it when a user taps a “Helpful” button to record the interaction.
232
+
233
+
<div style={{
234
+
position: 'relative',
235
+
paddingBottom: 'calc(56.67989417989418%+41px)', // Keeps the aspect ratio and additional padding
You can interact with static classes directly in an Action Flow using both the **Set Field** and **Call Method** actions. Static methods and fields belong to the class itself, not to a specific instance, which makes them perfect for utilities, configuration helpers, or global logic.
260
323
324
+
#### Set Static Field [Action]
325
+
326
+
Use the **Set Static Field** action to update a static field on a custom class. For example, if you have a class `MathHelper` with a static field `amount`, you can set it using an input value when a user enters a price. This allows you to store that value globally and use it across different calculations.
327
+
328
+
329
+
<div style={{
330
+
position: 'relative',
331
+
paddingBottom: 'calc(56.67989417989418%+41px)', // Keeps the aspect ratio and additional padding
Use the **Call Static Method** action to run a static method of your class. For instance, you can call `Logger.logEvent('user_login')` from an analytics helper class when a login action is triggered, without needing to create an instance of the class.
358
+
359
+
<div style={{
360
+
position: 'relative',
361
+
paddingBottom: 'calc(56.67989417989418%+41px)', // Keeps the aspect ratio and additional padding
0 commit comments