“Enable record locking and unlocking in Apex” for scratch org
Clash Royale CLAN TAG#URR8PPP
Any idea how to "Enable record locking and unlocking in Apex" for scratch org?
I am getting the following error while running unit tests in scratch org:
System.NoAccessException: Apex approval lock/unlock api preference not enabled.
Appreciate your insight on this or if you know any workaround.
salesforcedx
add a comment |
Any idea how to "Enable record locking and unlocking in Apex" for scratch org?
I am getting the following error while running unit tests in scratch org:
System.NoAccessException: Apex approval lock/unlock api preference not enabled.
Appreciate your insight on this or if you know any workaround.
salesforcedx
as a workaround, you can manually enable that -- salesforce.stackexchange.com/questions/108524/…
– kurunve
Dec 18 at 16:51
We've already considered it but that's not an ideal alternative, as we would like to spin up scratch orgs for CI/CD purposes. Appreciate your input though.
– Tanmay
Dec 18 at 16:54
add a comment |
Any idea how to "Enable record locking and unlocking in Apex" for scratch org?
I am getting the following error while running unit tests in scratch org:
System.NoAccessException: Apex approval lock/unlock api preference not enabled.
Appreciate your insight on this or if you know any workaround.
salesforcedx
Any idea how to "Enable record locking and unlocking in Apex" for scratch org?
I am getting the following error while running unit tests in scratch org:
System.NoAccessException: Apex approval lock/unlock api preference not enabled.
Appreciate your insight on this or if you know any workaround.
salesforcedx
salesforcedx
asked Dec 18 at 16:40
Tanmay
8016
8016
as a workaround, you can manually enable that -- salesforce.stackexchange.com/questions/108524/…
– kurunve
Dec 18 at 16:51
We've already considered it but that's not an ideal alternative, as we would like to spin up scratch orgs for CI/CD purposes. Appreciate your input though.
– Tanmay
Dec 18 at 16:54
add a comment |
as a workaround, you can manually enable that -- salesforce.stackexchange.com/questions/108524/…
– kurunve
Dec 18 at 16:51
We've already considered it but that's not an ideal alternative, as we would like to spin up scratch orgs for CI/CD purposes. Appreciate your input though.
– Tanmay
Dec 18 at 16:54
as a workaround, you can manually enable that -- salesforce.stackexchange.com/questions/108524/…
– kurunve
Dec 18 at 16:51
as a workaround, you can manually enable that -- salesforce.stackexchange.com/questions/108524/…
– kurunve
Dec 18 at 16:51
We've already considered it but that's not an ideal alternative, as we would like to spin up scratch orgs for CI/CD purposes. Appreciate your input though.
– Tanmay
Dec 18 at 16:54
We've already considered it but that's not an ideal alternative, as we would like to spin up scratch orgs for CI/CD purposes. Appreciate your input though.
– Tanmay
Dec 18 at 16:54
add a comment |
1 Answer
1
active
oldest
votes
As of Winter '19, you can specify the setting ApexApprovalLockUnlock
from the Metadata API's OrgPreferenceSettings
entity as part of your scratch org configuration file. (Deploying settings entities with the Metadata API continues to work).
Under the "settings"
key, you nest your settings entities and translate their names into camelCase
:
In Winter ’19 and later, scratch org settings are the format for defining org preferences in the scratch org definition. Because you can use all Metadata API settings, they are the most comprehensive way to configure a scratch org. If a setting is supported in Metadata API, it’s supported in scratch orgs.
[...]
Although the Settings are upper camel case in the Metadata API Developer Guide, be sure to indicate them as lower camel case in the scratch org definition.
When converting existing org prefs to settings, the org prefs that start with “Is” have a corresponding setting that starts with “enable”. For example, “IsOrdersEnabled” is “enableOrders” that takes a Boolean value of true or false.
Here, you can do this in your scratch org config file:
"orgName": "Acme",
"edition": "Enterprise",
"settings":
"orgPreferenceSettings":
"apexApprovalLockUnlock": true
Then your scratch orgs will spin up with the setting already enabled:
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "459"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f244035%2fenable-record-locking-and-unlocking-in-apex-for-scratch-org%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
As of Winter '19, you can specify the setting ApexApprovalLockUnlock
from the Metadata API's OrgPreferenceSettings
entity as part of your scratch org configuration file. (Deploying settings entities with the Metadata API continues to work).
Under the "settings"
key, you nest your settings entities and translate their names into camelCase
:
In Winter ’19 and later, scratch org settings are the format for defining org preferences in the scratch org definition. Because you can use all Metadata API settings, they are the most comprehensive way to configure a scratch org. If a setting is supported in Metadata API, it’s supported in scratch orgs.
[...]
Although the Settings are upper camel case in the Metadata API Developer Guide, be sure to indicate them as lower camel case in the scratch org definition.
When converting existing org prefs to settings, the org prefs that start with “Is” have a corresponding setting that starts with “enable”. For example, “IsOrdersEnabled” is “enableOrders” that takes a Boolean value of true or false.
Here, you can do this in your scratch org config file:
"orgName": "Acme",
"edition": "Enterprise",
"settings":
"orgPreferenceSettings":
"apexApprovalLockUnlock": true
Then your scratch orgs will spin up with the setting already enabled:
add a comment |
As of Winter '19, you can specify the setting ApexApprovalLockUnlock
from the Metadata API's OrgPreferenceSettings
entity as part of your scratch org configuration file. (Deploying settings entities with the Metadata API continues to work).
Under the "settings"
key, you nest your settings entities and translate their names into camelCase
:
In Winter ’19 and later, scratch org settings are the format for defining org preferences in the scratch org definition. Because you can use all Metadata API settings, they are the most comprehensive way to configure a scratch org. If a setting is supported in Metadata API, it’s supported in scratch orgs.
[...]
Although the Settings are upper camel case in the Metadata API Developer Guide, be sure to indicate them as lower camel case in the scratch org definition.
When converting existing org prefs to settings, the org prefs that start with “Is” have a corresponding setting that starts with “enable”. For example, “IsOrdersEnabled” is “enableOrders” that takes a Boolean value of true or false.
Here, you can do this in your scratch org config file:
"orgName": "Acme",
"edition": "Enterprise",
"settings":
"orgPreferenceSettings":
"apexApprovalLockUnlock": true
Then your scratch orgs will spin up with the setting already enabled:
add a comment |
As of Winter '19, you can specify the setting ApexApprovalLockUnlock
from the Metadata API's OrgPreferenceSettings
entity as part of your scratch org configuration file. (Deploying settings entities with the Metadata API continues to work).
Under the "settings"
key, you nest your settings entities and translate their names into camelCase
:
In Winter ’19 and later, scratch org settings are the format for defining org preferences in the scratch org definition. Because you can use all Metadata API settings, they are the most comprehensive way to configure a scratch org. If a setting is supported in Metadata API, it’s supported in scratch orgs.
[...]
Although the Settings are upper camel case in the Metadata API Developer Guide, be sure to indicate them as lower camel case in the scratch org definition.
When converting existing org prefs to settings, the org prefs that start with “Is” have a corresponding setting that starts with “enable”. For example, “IsOrdersEnabled” is “enableOrders” that takes a Boolean value of true or false.
Here, you can do this in your scratch org config file:
"orgName": "Acme",
"edition": "Enterprise",
"settings":
"orgPreferenceSettings":
"apexApprovalLockUnlock": true
Then your scratch orgs will spin up with the setting already enabled:
As of Winter '19, you can specify the setting ApexApprovalLockUnlock
from the Metadata API's OrgPreferenceSettings
entity as part of your scratch org configuration file. (Deploying settings entities with the Metadata API continues to work).
Under the "settings"
key, you nest your settings entities and translate their names into camelCase
:
In Winter ’19 and later, scratch org settings are the format for defining org preferences in the scratch org definition. Because you can use all Metadata API settings, they are the most comprehensive way to configure a scratch org. If a setting is supported in Metadata API, it’s supported in scratch orgs.
[...]
Although the Settings are upper camel case in the Metadata API Developer Guide, be sure to indicate them as lower camel case in the scratch org definition.
When converting existing org prefs to settings, the org prefs that start with “Is” have a corresponding setting that starts with “enable”. For example, “IsOrdersEnabled” is “enableOrders” that takes a Boolean value of true or false.
Here, you can do this in your scratch org config file:
"orgName": "Acme",
"edition": "Enterprise",
"settings":
"orgPreferenceSettings":
"apexApprovalLockUnlock": true
Then your scratch orgs will spin up with the setting already enabled:
answered Dec 18 at 18:19
David Reed
30.2k61746
30.2k61746
add a comment |
add a comment |
Thanks for contributing an answer to Salesforce Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f244035%2fenable-record-locking-and-unlocking-in-apex-for-scratch-org%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
as a workaround, you can manually enable that -- salesforce.stackexchange.com/questions/108524/…
– kurunve
Dec 18 at 16:51
We've already considered it but that's not an ideal alternative, as we would like to spin up scratch orgs for CI/CD purposes. Appreciate your input though.
– Tanmay
Dec 18 at 16:54