From 6dd9a21d2a2fa9f6b8f7c039e5c8946d1a629acb Mon Sep 17 00:00:00 2001 From: RupertBarrow Date: Mon, 16 Jan 2023 19:39:10 +0100 Subject: [PATCH 01/12] Fixed inclusion of env-var-reference in the Reference chapter --- docs/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference.md b/docs/reference.md index be688a4590..c3646eaa11 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -8,5 +8,5 @@ maxdepth: 1 cheat-sheet tasks flows -env_var_reference +env-var-reference ``` From 192cadaa60c94cc4ac1333121a790918c5fb8b0e Mon Sep 17 00:00:00 2001 From: RupertBarrow Date: Mon, 16 Jan 2023 19:59:43 +0100 Subject: [PATCH 02/12] org_config reference chapter of documentation --- docs/org_config-reference.md | 30 ++++++++++++++++++++++++++++++ docs/reference.md | 1 + 2 files changed, 31 insertions(+) create mode 100644 docs/org_config-reference.md diff --git a/docs/org_config-reference.md b/docs/org_config-reference.md new file mode 100644 index 0000000000..35089cd6b2 --- /dev/null +++ b/docs/org_config-reference.md @@ -0,0 +1,30 @@ +# org_config Object Reference + +The `org_config` object can be used in the `cumulusci.yml` file to read a large number number of attributes of the Salesforce org currently used. For example, in a [custom flow step](https://cumulusci.readthedocs.io/en/stable/config.html#add-a-flow-step), you can use a `when`clause to adapt the behavior of the new step to the type of org (scratch org or not) by referencing the `org_config.scratch` attribute. + +## org_config Object Attributes + +- `scratch` : true indicates the org is a scratch org. False indicates it is a persistent org +- `is_person_accounts_enabled` : `true` or `false` +- `installed_packages` : comma-separated list of package names +- `org_id` : orgid of the Salesforce org +- `namespace` : namespace of the org +- `namespaced` : `true` if the org has a namespace +- `instance_url` : eg https://crazy-demo.scratch.my.salesforce.com +- `access_token` : access token currently used to authenticate with Salesforce +- `username` : username of the current Salesforce user +- `user_id` : user id of the current Salesforce user +- `is_multiple_currencies_enabled`: `true` or `false` +- `is_advanced_currency_management_enabled` : `true` or `false` +- `org_type` : eg "Enterprise Edition" or "Developer Edition" +- `is_sandbox` : `true` if the org is a sandbox +- `organization_sobject` : whole Organization SObject (see the [Salesforce documentation for the Organization SObject](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_organization.htm)) + +Also : + +- `name` +- `start_url` +- `sfdx_alias` +- `config_file` +- `lightning_base_url` +- `latest_api_version` diff --git a/docs/reference.md b/docs/reference.md index c3646eaa11..4da0d31842 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -9,4 +9,5 @@ cheat-sheet tasks flows env-var-reference +org_config-reference ``` From 9b5aa4fda0be6dbee451fec66fc1a293d9f69cae Mon Sep 17 00:00:00 2001 From: RupertBarrow Date: Mon, 16 Jan 2023 20:08:02 +0100 Subject: [PATCH 03/12] Added myself to the list of authors --- AUTHORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index 1ac2d6bda3..2c1502872a 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -36,3 +36,4 @@ For example: * Ed Rivas (jerivas) * Gustavo Tandeciarz (dcinzona) +* Rupert Barrow (rupertbarrow) From 66ad3b1fa7e079324904c531d384131d03bad226 Mon Sep 17 00:00:00 2001 From: RupertBarrow Date: Wed, 16 Oct 2024 10:51:57 +0200 Subject: [PATCH 04/12] fix: updated org_info reference after reading about has_minimum_package_version() in https://trailhead.salesforce.com/fr/trailblazer-community/feed/0D54V00007erukZSAQ --- docs/org_config-reference.md | 59 +++++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/docs/org_config-reference.md b/docs/org_config-reference.md index 35089cd6b2..9ba93147fd 100644 --- a/docs/org_config-reference.md +++ b/docs/org_config-reference.md @@ -2,29 +2,58 @@ The `org_config` object can be used in the `cumulusci.yml` file to read a large number number of attributes of the Salesforce org currently used. For example, in a [custom flow step](https://cumulusci.readthedocs.io/en/stable/config.html#add-a-flow-step), you can use a `when`clause to adapt the behavior of the new step to the type of org (scratch org or not) by referencing the `org_config.scratch` attribute. +The following information is documented here in the application's source code : +https://github.com/SFDO-Tooling/CumulusCI/blob/main/cumulusci/core/config/org_config.py + ## org_config Object Attributes -- `scratch` : true indicates the org is a scratch org. False indicates it is a persistent org +- `access_token` : access token currently used to authenticate with Salesforce +- `installed_packages` : comma-separated list of package names; a dict mapping a namespace or package Id (033\*) to the installed package version(s) matching that identifier. All values are lists, because multiple second-generation packages may be installed with the same namespace. Beta version of a package are represented as "1.2.3b5", where 5 is the build number. +- `instance_url` : eg `https://crazy-demo.scratch.my.salesforce.com` +- `instance_name` : eg `crazy-demo` +- `is_advanced_currency_management_enabled` : `true` or `false` +- `is_multiple_currencies_enabled`: `true` or `false` - `is_person_accounts_enabled` : `true` or `false` -- `installed_packages` : comma-separated list of package names -- `org_id` : orgid of the Salesforce org +- `is_sandbox` : `true` if the org is a sandbox +- `is_survey_advanced_features_enabled`: `true` or `false` +- `lightning_base_url` : base url ending with `.lightning.force.com` - `namespace` : namespace of the org - `namespaced` : `true` if the org has a namespace -- `instance_url` : eg https://crazy-demo.scratch.my.salesforce.com -- `access_token` : access token currently used to authenticate with Salesforce -- `username` : username of the current Salesforce user -- `user_id` : user id of the current Salesforce user -- `is_multiple_currencies_enabled`: `true` or `false` -- `is_advanced_currency_management_enabled` : `true` or `false` +- `org_id` : orgid of the Salesforce org - `org_type` : eg "Enterprise Edition" or "Developer Edition" -- `is_sandbox` : `true` if the org is a sandbox - `organization_sobject` : whole Organization SObject (see the [Salesforce documentation for the Organization SObject](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_organization.htm)) +- `scratch` : true indicates the org is a scratch org. False indicates it is a persistent org +- `start_url`: the frontdoor URL that results in an instant login, like `https://mydomain.my.salesforce.com/secur/frontdoor.jsp?sid=...` +- `user_id` : user id of the current Salesforce user +- `userinfo`: user OAuth2 information (see https://help.salesforce.com/s/articleView?id=sf.remoteaccess_using_userinfo_endpoint.htm) +- `username` : username of the current Salesforce user -Also : +## Other org_config Object Attributes -- `name` -- `start_url` -- `sfdx_alias` - `config_file` -- `lightning_base_url` +- `config_name` - `latest_api_version` +- `name` +- `salesforce_client` +- `sfdx_alias` + +## org_config Object Methods + +- `has_minimum_package_version(package_identifier, version_identifier)`: True if the org has a version of the specified package that is equal to or newer than the supplied version identifier. + The package identifier may be either a namespace or a 033 package Id. + The version identifier should be in "1.2.3" or "1.2.3b4" format. + + `when` expressions can use the `has_minimum_package_version` method to check if a package is installed with a sufficient version. + + For example: + `when: org_config.has_minimum_package_version("namespace", "1.0")` + + See a real-life example here : https://trailhead.salesforce.com/fr/trailblazer-community/feed/0D54V00007erukZSAQ + +- `get_community_info(community_name, force_refresh=False)`: Returns the community information for the given community (see https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_responses_community.htm) + + An API call will be made the first time this method is used, + and the return values will be cached. Subsequent calls will + not call the API unless the requested community name is not in + the cached results, or unless the force_refresh parameter is + set to True From ce5e4d9f19feb61e5a26efcafc4d3d436a8ca882 Mon Sep 17 00:00:00 2001 From: Rupert Barrow <48629751+RupertBarrow@users.noreply.github.com> Date: Fri, 13 Dec 2024 17:04:02 +0100 Subject: [PATCH 05/12] typo Co-authored-by: James Estevez --- docs/org_config-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/org_config-reference.md b/docs/org_config-reference.md index 9ba93147fd..b8c531a8a7 100644 --- a/docs/org_config-reference.md +++ b/docs/org_config-reference.md @@ -1,6 +1,6 @@ # org_config Object Reference -The `org_config` object can be used in the `cumulusci.yml` file to read a large number number of attributes of the Salesforce org currently used. For example, in a [custom flow step](https://cumulusci.readthedocs.io/en/stable/config.html#add-a-flow-step), you can use a `when`clause to adapt the behavior of the new step to the type of org (scratch org or not) by referencing the `org_config.scratch` attribute. +The `org_config` object can be used in the `cumulusci.yml` file to read a large number number of attributes of the Salesforce org currently used. For example, in a [custom flow step](https://cumulusci.readthedocs.io/en/stable/config.html#add-a-flow-step), you can use a `when` clause to adapt the behavior of the new step to the type of org (scratch org or not) by referencing the `org_config.scratch` attribute. The following information is documented here in the application's source code : https://github.com/SFDO-Tooling/CumulusCI/blob/main/cumulusci/core/config/org_config.py From b50e65c1558ec9e3d4fa1d77d5fe6e2ac8d3a7a7 Mon Sep 17 00:00:00 2001 From: Rupert Barrow <48629751+RupertBarrow@users.noreply.github.com> Date: Fri, 13 Dec 2024 17:04:33 +0100 Subject: [PATCH 06/12] More precise wording Co-authored-by: James Estevez --- docs/org_config-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/org_config-reference.md b/docs/org_config-reference.md index b8c531a8a7..beb872dba4 100644 --- a/docs/org_config-reference.md +++ b/docs/org_config-reference.md @@ -8,7 +8,7 @@ https://github.com/SFDO-Tooling/CumulusCI/blob/main/cumulusci/core/config/org_co ## org_config Object Attributes - `access_token` : access token currently used to authenticate with Salesforce -- `installed_packages` : comma-separated list of package names; a dict mapping a namespace or package Id (033\*) to the installed package version(s) matching that identifier. All values are lists, because multiple second-generation packages may be installed with the same namespace. Beta version of a package are represented as "1.2.3b5", where 5 is the build number. +- `installed_packages` : comma-separated list of package names; a `dict` mapping a namespace or metadata package ID (starts with `033`) to the installed package version(s) matching that identifier. All values are lists, because multiple second-generation packages may be installed with the same namespace. The beta version of a package is represented as "1.2.3b5", where 5 is the build number. - `instance_url` : eg `https://crazy-demo.scratch.my.salesforce.com` - `instance_name` : eg `crazy-demo` - `is_advanced_currency_management_enabled` : `true` or `false` From 2111515f79103090cb2ce31262e249a68eb2ca36 Mon Sep 17 00:00:00 2001 From: Rupert Barrow <48629751+RupertBarrow@users.noreply.github.com> Date: Fri, 13 Dec 2024 17:05:13 +0100 Subject: [PATCH 07/12] More precise wording Co-authored-by: James Estevez --- docs/org_config-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/org_config-reference.md b/docs/org_config-reference.md index beb872dba4..106eb1dfda 100644 --- a/docs/org_config-reference.md +++ b/docs/org_config-reference.md @@ -21,7 +21,7 @@ https://github.com/SFDO-Tooling/CumulusCI/blob/main/cumulusci/core/config/org_co - `namespaced` : `true` if the org has a namespace - `org_id` : orgid of the Salesforce org - `org_type` : eg "Enterprise Edition" or "Developer Edition" -- `organization_sobject` : whole Organization SObject (see the [Salesforce documentation for the Organization SObject](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_organization.htm)) +- `organization_sobject` : The Organization object (see the [Salesforce documentation for the Organization SObject](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_organization.htm)) for the org. - `scratch` : true indicates the org is a scratch org. False indicates it is a persistent org - `start_url`: the frontdoor URL that results in an instant login, like `https://mydomain.my.salesforce.com/secur/frontdoor.jsp?sid=...` - `user_id` : user id of the current Salesforce user From 64230b6e41615642104fff62a5b947bebc112152 Mon Sep 17 00:00:00 2001 From: James Estevez Date: Fri, 17 Jan 2025 13:10:01 -0800 Subject: [PATCH 08/12] Update docs/org_config-reference.md --- docs/org_config-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/org_config-reference.md b/docs/org_config-reference.md index 106eb1dfda..d26327e4ae 100644 --- a/docs/org_config-reference.md +++ b/docs/org_config-reference.md @@ -19,7 +19,7 @@ https://github.com/SFDO-Tooling/CumulusCI/blob/main/cumulusci/core/config/org_co - `lightning_base_url` : base url ending with `.lightning.force.com` - `namespace` : namespace of the org - `namespaced` : `true` if the org has a namespace -- `org_id` : orgid of the Salesforce org +- `org_id` : Organization ID of the Salesforce org - `org_type` : eg "Enterprise Edition" or "Developer Edition" - `organization_sobject` : The Organization object (see the [Salesforce documentation for the Organization SObject](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_organization.htm)) for the org. - `scratch` : true indicates the org is a scratch org. False indicates it is a persistent org From 2fe18a74657a8618d2a3bbb0367d789e0020da12 Mon Sep 17 00:00:00 2001 From: James Estevez Date: Fri, 17 Jan 2025 13:10:15 -0800 Subject: [PATCH 09/12] Update docs/org_config-reference.md --- docs/org_config-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/org_config-reference.md b/docs/org_config-reference.md index d26327e4ae..e2eb89ea36 100644 --- a/docs/org_config-reference.md +++ b/docs/org_config-reference.md @@ -22,7 +22,7 @@ https://github.com/SFDO-Tooling/CumulusCI/blob/main/cumulusci/core/config/org_co - `org_id` : Organization ID of the Salesforce org - `org_type` : eg "Enterprise Edition" or "Developer Edition" - `organization_sobject` : The Organization object (see the [Salesforce documentation for the Organization SObject](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_organization.htm)) for the org. -- `scratch` : true indicates the org is a scratch org. False indicates it is a persistent org +- `scratch` : `True` when the org is a scratch org. - `start_url`: the frontdoor URL that results in an instant login, like `https://mydomain.my.salesforce.com/secur/frontdoor.jsp?sid=...` - `user_id` : user id of the current Salesforce user - `userinfo`: user OAuth2 information (see https://help.salesforce.com/s/articleView?id=sf.remoteaccess_using_userinfo_endpoint.htm) From e963500ec984da641fc2ceb2ea4852411d20c1fb Mon Sep 17 00:00:00 2001 From: James Estevez Date: Fri, 17 Jan 2025 13:10:22 -0800 Subject: [PATCH 10/12] Update docs/org_config-reference.md --- docs/org_config-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/org_config-reference.md b/docs/org_config-reference.md index e2eb89ea36..03b74b8812 100644 --- a/docs/org_config-reference.md +++ b/docs/org_config-reference.md @@ -39,7 +39,7 @@ https://github.com/SFDO-Tooling/CumulusCI/blob/main/cumulusci/core/config/org_co ## org_config Object Methods -- `has_minimum_package_version(package_identifier, version_identifier)`: True if the org has a version of the specified package that is equal to or newer than the supplied version identifier. +- `has_minimum_package_version(package_identifier, version_identifier)`: `true` if the org has a version of the specified package that is equal to or newer than the supplied version identifier. The package identifier may be either a namespace or a 033 package Id. The version identifier should be in "1.2.3" or "1.2.3b4" format. From 91a617edd0ea6516c661ee95147df6ab7fe28614 Mon Sep 17 00:00:00 2001 From: James Estevez Date: Fri, 17 Jan 2025 13:10:28 -0800 Subject: [PATCH 11/12] Update docs/org_config-reference.md --- docs/org_config-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/org_config-reference.md b/docs/org_config-reference.md index 03b74b8812..e368878f6b 100644 --- a/docs/org_config-reference.md +++ b/docs/org_config-reference.md @@ -24,7 +24,7 @@ https://github.com/SFDO-Tooling/CumulusCI/blob/main/cumulusci/core/config/org_co - `organization_sobject` : The Organization object (see the [Salesforce documentation for the Organization SObject](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_organization.htm)) for the org. - `scratch` : `True` when the org is a scratch org. - `start_url`: the frontdoor URL that results in an instant login, like `https://mydomain.my.salesforce.com/secur/frontdoor.jsp?sid=...` -- `user_id` : user id of the current Salesforce user +- `user_id` : user ID of the current Salesforce user - `userinfo`: user OAuth2 information (see https://help.salesforce.com/s/articleView?id=sf.remoteaccess_using_userinfo_endpoint.htm) - `username` : username of the current Salesforce user From 8dc16ceb8fca811c35428d9018ed32b853362d2d Mon Sep 17 00:00:00 2001 From: James Estevez Date: Fri, 17 Jan 2025 13:10:35 -0800 Subject: [PATCH 12/12] Update docs/org_config-reference.md --- docs/org_config-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/org_config-reference.md b/docs/org_config-reference.md index e368878f6b..aa2f76b18c 100644 --- a/docs/org_config-reference.md +++ b/docs/org_config-reference.md @@ -40,7 +40,7 @@ https://github.com/SFDO-Tooling/CumulusCI/blob/main/cumulusci/core/config/org_co ## org_config Object Methods - `has_minimum_package_version(package_identifier, version_identifier)`: `true` if the org has a version of the specified package that is equal to or newer than the supplied version identifier. - The package identifier may be either a namespace or a 033 package Id. + The package identifier may be either a namespace or a `033` MetadataPackage ID. The version identifier should be in "1.2.3" or "1.2.3b4" format. `when` expressions can use the `has_minimum_package_version` method to check if a package is installed with a sufficient version.