Skip to content

Commit f37f236

Browse files
feat: add optional target-org support to function run
Add optional --target-org flag to function run command
1 parent d3f8186 commit f37f236

3 files changed

Lines changed: 17 additions & 8 deletions

File tree

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,16 @@ FLAG DESCRIPTIONS
245245
246246
The path to the entrypoint file of your initialized Data Cloud custom code package.
247247
248-
--target-org=<value> Target Salesforce org to run against.
249-
250-
Optional username or alias for the target Salesforce org. If provided, the function will run with access to the org's data.
251-
252248
-t, --test-with=<value> Path to test.json file to test Data Code Extension function
253249
254250
Path to a JSON file that provides input request for the function.
255251
252+
--target-org=<value> Target Salesforce org to run against.
253+
254+
Optional The alias or username of the Salesforce org where you want to run the Data Cloud code extension package.
255+
Required for functions testing with callouts to generative and predictive models registered in your org. The org
256+
must have Data Cloud enabled and appropriate permissions.
257+
256258
--config-file=<value> Path to a config file.
257259
258260
Optional path to a JSON config file that provides input payload for the run. Defaults to the package's
@@ -569,7 +571,7 @@ EXAMPLES
569571
570572
Scan without updating the requirements.txt file:
571573
572-
sf data-code-extension script scan --entrypoint ./my-script-package/payload/entrypoint.py --no-requirements
574+
$ sf data-code-extension script scan --entrypoint ./my-script-package/payload/entrypoint.py --no-requirements
573575
574576
FLAG DESCRIPTIONS
575577
-d, --dry-run Preview changes without modifying any files.

messages/run.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@ Target Salesforce org to run against.
102102

103103
The alias or username of the Salesforce org where you want to run the Data Cloud custom code package. The org must have Data Cloud enabled and appropriate permissions.
104104

105+
# flags.targetOrg.summary.function
106+
107+
Target Salesforce org to run against.
108+
109+
# flags.targetOrg.description.function
110+
111+
Optional. The alias or username of the Salesforce org where you want to run the Data Cloud code extension package. Required for functions testing with callouts to generative and predictive models registered in your org. The org must have Data Cloud enabled and appropriate permissions.
112+
105113
# flags.testWith.summary
106114

107115
Path to test.json file to test Data Code Extension function

src/commands/data-code-extension/function/run.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,8 @@ export default class Run extends RunBase {
5454
}),
5555
'target-org': Flags.optionalOrg({
5656
char: undefined,
57-
summary: messages.getMessage('flags.targetOrg.summary'),
58-
description: messages.getMessage('flags.targetOrg.description'),
59-
required: false,
57+
summary: messages.getMessage('flags.targetOrg.summary.function'),
58+
description: messages.getMessage('flags.targetOrg.description.function'),
6059
}),
6160
};
6261

0 commit comments

Comments
 (0)