RE: Update script parameter field value in company preference

Hi Guys, How do i update script parameter field value in company preference thru script?

t(^__^t) Beginner Asked on July 8, 2021 in SuiteScript.
Add Comment
2 Answers

Please follow the below code snippet:

 * companyPreferences.js
 * @NApiVersion 2.x
 * @NModuleScope Public
//Sample Config load and get Value or set Value
    function (config) {
    //Please visit config module for types in help
        function loadCompanyPreferences() {
            const shopifyApi = config.load({
                type: config.Type.COMPANY_PREFERENCES //depends on your requirement
            const apiKey = shopifyApi.getValue('field ID');
            shopifyApi.setValue('field ID', 'value');
  ; //You can use the ignore or field sourcing

        return {
            compPref: loadCompanyPreferences

Beginner Answered on July 8, 2021.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.