How-to Guide
Nue Platform
Auto Unlock & Lock Grandfather Tier UI Plugin
1 min
this plugin is available in release 2504 1 07/01/2025 docid\ amb5lvhtvidg8oljmdkdj in certain scenarios nue's customers may grandfathered their users on discount tiers, when applying tiered price or discount tags grandfathering is typically done to encourage users to purchase more units or longer terms upfront allowing them to lock in their pricing for future changes to subscription however, as customers release new & competitive pricing, their sales reps would have to manually unlock & users' tiers & lock them again during change orders the new ui plugin automates the unlock of grandfather tier, recalculation of new price & re locking of new tier as the sales reps check out into change quotes/orders make additional changes to quantity or term on the line editor follow these steps to make pricing plugin page visible navaigate to setup > users click on the profile you want to set up the ui plugin for search for pricing plugins & turn it to default on now navigate to pricing plugins page from the app launcher menu adding necessary trigger events to ensure that this plugin works as expected the following trigger events need to be added to the picklist values on the ruby triggerevent c field on the ruby pricingplugin c object trigger event label api name default before calculation on ui ui beforecalculation false after calculation on ui ui aftercalculation false steps to follow navigate to setup > object manager search for pricing plugin custom object on fields & relationships fields & relationships menu find ruby triggerevent c field on the menu add a new picklist value on the values values section configuring plugin there are 3 different plug in configurations which need to be done grandfather tier on page load this ensures that whenever the change requests are checked into quotes or orders out by sales reps the auto unlock & lock would happen on loading of the line editor page configure the plugin as in the image insert the custom code mentioned below $$lineeditorcallback recalculate(); grandfather tier unlock this ensures everytime a change is made within the line editor the unlock of an existing grandfathered tier is triggered configure the plugin as in the image insert the custom code on the 'code' field java (function() { function processline(lineitem) { if (!lineitem pricedimensions) return; const hasgrandfathertiers = lineitem pricedimensions some(pd => pd copiedfrom); if (hasgrandfathertiers) { const updatedlineitem = $$callbacks handlegrandfathertiers(lineitem, 'ui beforecalculation'); if (updatedlineitem) { $$updatedlineitems push(updatedlineitem); } } // recursive process childrenlineitems if (array isarray(lineitem childrenlineitems)) { for (const child of lineitem childrenlineitems) { processline(child); } } } if (!$$callbacks || !$$callbacks handlegrandfathertiers) return; for (const lineitem of $$headerobject lineitems || \[]) { processline(lineitem); } })() grandfather tier lock this ensures everytime a recalculation happens on the ui due to a quantity or term change the price tier is grandfathered again or locked again configure the plugin as in the image insert the custom code on the 'code' field (function() { function processline(lineitem) { if (!lineitem pricedimensions) return; const needtolockback = lineitem pricedimensions some(pd => pd needgrandfatherlock); if (needtolockback) { const updatedlineitem = $$callbacks handlegrandfathertiers(lineitem, 'ui aftercalculation'); if (updatedlineitem) { $$updatedlineitems push(updatedlineitem); } } if (array isarray(lineitem childrenlineitems)) { for (const child of lineitem childrenlineitems) { processline(child); } } } if (!$$callbacks || !$$callbacks handlegrandfathertiers) return; for (const lineitem of $$headerobject lineitems || \[]) { processline(lineitem); } })() now test this out by updating relevant quantity or term on an existing subscription with a grandfathered tier
🤔
Have a question?
Get answers fast with Nue’s intelligent AI, expert support team, and a growing community of users - all here to help you succeed.
To ask a question or participate in discussions, you'll need to authenticate first.