Skip to main content
Solved

Calculate Base Price with LLM Prompts

  • March 23, 2026
  • 5 replies
  • 83 views

RaphaelPfaff12
Semi-Pro III

Hello everyone,

I’m trying to calculate the selling price of my stock items (IN202500) using LLM prompts.

Specifically, I want to multiply the field AvgCost (INItemCost) by a factor of 1.72, which accounts for the following costs:

  • 10% Storage costs

  • 2% Transport costs

  • 20% Personnel costs

  • 5% Marketing costs

  • 5% Miscellaneous costs

  • 30% Profit margin

Unfortunately, I’m struggling to get the correct price calculated. Do you have any tips or advice?

Here’s one of my test prompts: 

## Context Instructions
You are an AI assistant working with ERP data.

## Instructions with Input Data
Calculate the field ((InventoryItemCurySettings.BasePrice)) based on the following input data and formula.

Input Data:
- Average Cost: $((INItemCost.AvgCost))

Calculation formula:
BasePrice = AvgCost × (1 + 0.10 + 0.02 + 0.20 + 0.05 + 0.05 + 0.30)
BasePrice = AvgCost × 1.72

The following surcharges are applied to the average cost:
- 10% Storage costs
- 2% Transport costs
- 20% Personnel costs
- 5% Marketing costs
- 5% Miscellaneous costs
- 30% Profit margin

Total surcharge: 72%

## Output Data Field
@((InventoryItemCurySettings.BasePrice)): the calculated base price based on the average cost plus 72% total surcharge. ## Output Format Example:
{
  "((InventoryItemCurySettings.BasePrice))": "24,99"
}

## Important Note:
The output must contain only the JSON object, without additional text, explanations, or comments. Make sure that the JSON object is properly formatted: Use double quotes for keys and string values, and place commas and braces correctly.

Any guidance would be greatly appreciated!

Best answer by Irina

Hello everyone,

The issue was addressed,, please see 

Why did my AI Automation not update the expected fields? 

  1. Verify that the automation is active, and the fields are eligible for update or deletion.
  2. Verify the prompt instructions are correctly defined. Make sure to use correct input data field notation. When some fields not presented in the Ouput Data Field/Input Data Field dialogs on the Prompt form, use Element Properties fucntionality on the source form to identify correct ViewName.DataField to use in prompt instructions.

     

  3. Use Trace... to review actual values ERP sends to LLM. If you see there unexpected or missing values, refer to the guidelines above.

5 replies

Samvel Petrosov
Jr Varsity III
Forum|alt.badge.img+9

Is the AI using the wrong price for calculating or returning the wrong value calculated with the correct base price?
 


lauraj46
Captain II
Forum|alt.badge.img+9
  • Captain II
  • March 23, 2026

Hi ​@RaphaelPfaff12 ,

Interesting use case to use the AI Studio and LLM for this.  I haven’t tested this, but perhaps you could simplify the prompt since the LLM really only needs the total markup % to do the calculation, not the breakdown. 

You could also consider using the Sales Price Worksheet to update the base price programatically, based on the average cost plus markup.  

Hope this helps!

Laura


RaphaelPfaff12
Semi-Pro III

Is the AI using the wrong price for calculating or returning the wrong value calculated with the correct base price?
 

I have a feeling that the AI can't handle the AVGCost field.


Ed Goodman
Acumatica Employee
Forum|alt.badge.img+4
  • Acumatica Employee
  • April 17, 2026

@RaphaelPfaff12 

Here is information on mass-updating sales prices in core Acumatica.

https://help.acumatica.com/Help?ScreenId=ShowWiki&pageid=7d0a1afd-77f9-4a05-9f6a-5c4cba2871e7

Hope this helps.

Ed


Irina
Community Manager
Forum|alt.badge.img+8
  • Acumatica Platform Analyst
  • Answer
  • April 29, 2026

Hello everyone,

The issue was addressed,, please see 

Why did my AI Automation not update the expected fields? 

  1. Verify that the automation is active, and the fields are eligible for update or deletion.
  2. Verify the prompt instructions are correctly defined. Make sure to use correct input data field notation. When some fields not presented in the Ouput Data Field/Input Data Field dialogs on the Prompt form, use Element Properties fucntionality on the source form to identify correct ViewName.DataField to use in prompt instructions.

     

  3. Use Trace... to review actual values ERP sends to LLM. If you see there unexpected or missing values, refer to the guidelines above.