Nikesh Kadawathage Posted July 12 Posted July 12 (edited) Hi, I created a smart rule where it requires that you NEED to put a Vendor ID in a Journal Entry if the GL account is between the account 56001-59999 as such: {!GLENTRY.ACCOUNTNO!} < '56001' || {!GLENTRY.ACCOUNTNO!} > '59999' || {!GLENTRY.VENDORID!} != "" However I want to now include in this rule that you need to put a Vendor ID in the Journal entry if the GL account is between 56001-59999 EXCEPT 58301, meaning I want 58301 to be submitted without requiring a Vendor ID but the rest of 56001-59999 still needs to. Edited July 12 by Nikesh Kadawathage Putting tags
Members Sterio, Louis Posted July 12 Members Posted July 12 Please see the idea I referenced in this thread: https://developer-community.sage.com/topic/1667-parent-object-references-in-smart-ruleevent-conditions-and-triggers/#comment-21746
Preston, Charlie Posted July 12 Posted July 12 Writing a smart event can be tricky when it gets more complicated - either use the idea Louis outlined or try a trigger against the GL Entry object of type validation. JavaScript can be written in the formula box for the condition and return either a string containing the error message that will stop the transaction posting, or null to let it through. Something like the following should work for you: if ("{!GLENTRY.ACCOUNTNO!}" >= "56001" && "{!GLENTRY.ACCOUNTNO!}" <= "59999" && "{!GLENTRY.ACCOUNTNO!}" != "58301" && "{!GLENTRY.VENDORID!}" == ""){ return "This is not allowed! Line " + "{!GLENTRY.LINE_NO!}" + " needs a supplier."; } return null; More information on triggers can be found here: https://developer.intacct.com/platform-services/triggers-examples/ 1
Varian Lee Posted July 15 Posted July 15 You can do this with standard functionality. On a GL account in the 'Require dimensions' section, check Vendor. The benefit of this is that this setting will apply across other modules such as AP Invoice, not just journal entry. If your rule needs to cover GL accounts that don't currently exist, then you could put a trigger on the GL account to set Vendor to true if it falls within your range of accounts. 2
Recommended Posts