Need help creating alert in Quotes module when related Account has a Memo

I am a marketing strategist at a manufacturing company. (Aka, not a developer!) I’m trying to create an alert in the Quotes module that notifies users when the related Account has a memo.

Goal:

When a user selects any of the 3 Account lookups on a quote, I want to:

  1. Fetch the Memo text from the associated Account.

  2. Populate the Quote’s corresponding memo field.

  3. Immediately show an alert message if the memo is not empty.

This ensures users are aware of any important account-level notes before saving a quote.

Setup

Each Quote record has 3 lookup fields pointing to Accounts:

  • Account_Name (front end: “Bill To Customer Name”)

  • Ship_To_Customer_Name

  • Preferred_Dealer_Enduser

Each Account record contains a Memo field. It is a custom field. (API name: Memo).

Each Quote has a corresponding memo field:

  • Bill_To_Memo

  • Ship_To_Memo

  • Assoc_Memo (front end: “Preferred Dealer/Enduser”)

What I’ve Tried

With the help of ChatGPT, I’ve tested several Client Scripts without success:

  • Page Event → onSave

  • Field Event → onChange

None of them triggered in the live Quotes module. I suspect this may be related to:

  • The field types involved (lookup + “field of lookup module”), or

  • Limitations with when Client Scripts run

I also attempted a 2-step script (populate the memo field when the lookup changes, then show the alert when the memo field changes) but that didn’t work either.

There’s also a chance that Chat GPT simply didn’t write the script correctly. It has a hard time speaking Deluge. 😉

Requirements

  • The alert must display before the user saves the quote.

  • The alert can be a popup message or something displayed next to the field.

I’m open to outside the box solutions if we need to approach this in a different way!

Sample Script I Tried

// Quotes — On Save alert if any memo has content

(function () {

  function hasText(v) { return v && String(v).trim() !== ""; }

  // Memo fields on the Quote layout

  var memoFields = ["Bill_To_Memo", "Assoc_Memo", "Ship_To_Memo"];

  ZDK.Page.on("save", function () {

    try {

      var anyMemo = memoFields.some(function (api) {

        var f = ZDK.Page.getField(api);

        return f && hasText(f.getValue());

      });

      if (anyMemo) {

        ZDK.Client.showAlert("HEADS UP: this Quote has memo notes. Review before proceeding.");

      }

    } catch (e) {

      // optional: ZDK.Client.showNotification("Memo check skipped.");

    }

    // Allow save to continue (alert only)

    return true;

  });

})();