Use Create with AI to plan reusable business logic. This example creates a Purchase Request Amount Calculator that takes supplied line items and returns calculated amounts or validation errors.
Before you begin
Prepare the following information:
Purpose: What the service should do.
Inputs: The values supplied when the service is called.
Processing rules: How to calculate, validate, or transform those values.
Outputs: The results the service should return.
Dependencies: Any application resources or external connections it needs.
The example in this article processes supplied line items only. It does not read or modify application records.
Describe your service
Open your application and click + in the top navigation to open New application resource.
In the Create with AI section:
Select Custom services. Click Show more if it is not visible.
Enter your requirements.
Click Start with AI.
Include specific rules and expected results so AI can propose a configuration that matches your business requirements.
Create a Purchase Request Amount Calculator. Accept line items with Description, Quantity, and Unit Price, plus an optional Tax Rate entered as a percentage. Return calculated lines, subtotal, tax, total, and validation errors. Use only the caller’s inputs.
Answer clarification questions
Specify whether the input can be empty, how to handle invalid rows, and when to round. In this example, an invalid item causes the service to return the item’s validation error without totals.
Review the Implementation Plan
AI generates an Implementation Plan after reviewing your requirements. Open it and check the proposed configuration.
For this example, review the following:
Item | Expected configuration |
Service name | Purchase Request Amount Calculator |
Line item inputs | Description, Quantity, and Unit Price |
Tax Rate | Optional percentage; defaults to 0 |
Line amount | Quantity × Unit Price, rounded to two decimal places |
Subtotal | Sum of the rounded line amounts |
Tax Amount | Subtotal × Tax Rate ÷ 100, rounded to two decimal places |
Total Amount | Subtotal + Tax Amount, rounded to two decimal places |
Validation | At least one item; Quantity and Unit Price must be non-negative numeric values |
Error handling | Return validation errors without calculated totals if any item is invalid |
Execution scope | Process supplied data only; no application record access or external calls |
Also review the proposed variable names and types. Make sure they will be easy to map when calling the service from a workflow, form action, or AI tool.
To request a change, reply in the conversation. For example:
Rename the total output to TotalAmount and include the item index in each validation error.
Review the updated plan before proceeding.
Approve the plan and create the service
When the plan matches your requirements, confirm in the conversation. For example:
Approve the plan and create the Custom Service.
AI then creates the service according to the approved plan.
Review the creation result and use the provided link to open the service.
Approving the plan authorizes creation. You should still review and test the generated logic before using it in a business process.
Review the generated configuration and code
In the code editor, compare the variables, defaults, validation, rounding order, and returned fields with the reviewed plan. Check that the generated logic follows the intended execution scope. Create and manage Custom Services
Test the service
Select Test run with sample data that is easy to verify manually.
For example, supply these line items and set Tax Rate to 9:
Description | Quantity | Unit Price | Expected line amount |
Office chairs | 2 | 150.00 | 300.00 |
Monitor stands | 3 | 40.00 | 120.00 |
The expected results are:
Output | Expected value |
Subtotal | 420.00 |
Tax Amount | 37.80 |
Total Amount | 457.80 |
Then test validation and boundary cases:
Test case | Expected behavior for this example |
Tax Rate is omitted | Calculate using 0% |
No line items are supplied | Return an error requiring at least one item |
Quantity is missing | Return a validation error identifying the item |
Unit Price is non-numeric | Return a validation error identifying the item |
Quantity or Unit Price is negative | Return a validation error |
Values contain additional decimal places | Apply the rounding rules defined in the plan |
If a result is incorrect, describe the input, actual result, and expected result to AI. Review the changes and test again.
For a rounding check with tax omitted, two lines of 0.336 each should total 0.68 after each line is rounded.
Publish and use the service
Use Save for an in-progress draft. After testing, publish the service version. Verify that the caller selects that published service and maps the inputs and outputs as intended. If you need to store the totals, add the record update to the calling process. Call a Custom Service from a workflow
Continue making changes with Ask AI
Use Ask AI to reopen the conversation. For example, add an optional discount that is subtracted before tax and must be between zero and the subtotal. Review the revised rules and rerun the affected tests before publishing the change.

