This topic contains 6 replies, has 0 voices, and was last updated by KCSF Bud 8 years ago.

  • Author
    Posts
  • #1580

    KCSF Bud

    This might be a little general…but doing some testing to start to learn SS 2.0 – I have a very simple pageInit client script that just returns an alert in the UI. I don’t reference the record type in any way in the script and have deployed it in Test mode to purchase orders and sales orders. Works for POs but not SOs. If I am accurate in saying that my script is basically independent of record type….any ideas on what might cause this? We do have quite a few more 1.0 scripts and workflows running on sales orders than POs, could that somehow be causing a conflict?

    Probably not enough detail, I know, just seeing if there were ideas before I bang my head on the desk some or file a case.
    This is a cached copy. Click here to see the original post.

  • #1581

    al3xicon

    Do you get an error in your browser console, or does it just fail silently? Can you post your entire script contents for us to view?

  • #1582

    KCSF Bud

    No error in browser console that i can detect, just silent almost as if its not deployed. I guess I could create a problem in the script and see what that does.

    Code:
    /**
    * @NApiVersion 2.0
    * @NScriptType ClientScript
    */
    define([],
    /**
    * @param {email} email
    * @param {dialog} dialog
    */
    function() {

    /**
    * Function to be executed after page is initialized.
    *
    * @param {Object} context
    * @param {Record} context.currentRecord – Current form record
    * @param {string} context.mode – The mode in which the record is being accessed (create, copy, or edit)
    *
    * @since 2015.2
    */
    function pageInit(context) {
    alert(‘Hmm’);
    log.debug({
    details : ‘I am a debug log’
    })
    var order = context.currentRecord;

    }

    return {
    pageInit: pageInit,
    // fieldChanged: fieldChanged,
    // postSourcing: postSourcing,
    // sublistChanged: sublistChanged,
    // lineInit: lineInit,
    // validateField: validateField,
    // validateLine: validateLine,
    // validateInsert: validateInsert,
    // validateDelete: validateDelete,
    // saveRecord: saveRecord
    };

    });

  • #1583

    david.smith

    How many scripts do you have on SO? Can you deploy to other record types too?

  • #1584

    KCSF Bud

    I will test other record types. About 30 client/user event scripts on sales orders, all 1.0. Mostly user event submit stuff, nothing that is pageInit.

  • #1585

    fjannelle

    Only the first 10 client-side scripts will execute on a specific record type. This is likely to be your issue here. You can check the Scripted Records, select Sales Order and reorder the scripts as needed. A consolidation of scripts will eventually be needed (ex: combine all 1.0 scripts Save Record trigger into a single script).

    Best regards,


    KCSF Bud replied on 11/03/2016, 06:53 AM: I confirm that moving test script to top of list allowed it to execute. Thank you.

  • #1586

    KCSF Bud

    Good to hear, I suspected it was something like that just couldn’t find it published anywhere. I will turn off a few/re-order to confirm and then start the consolidation. Such an exciting project for the weekend!

You must be logged in to reply to this topic.