0 votes

Hi,

for a customer I need to adjust the function isValidDate.
I've tried several ways to override it:

  • copy Validate.js in the folder scripts in the custom (isn't working)
  • Put the function in custom.js (isn't working)
  • Put the function in js/main/edit.js (isn't working)

Every time the function in Validate.js is used.

Is there a way how we can override this function?

Best regards,
Jeroen

asked in Efficy/ Client side by (345 points)

1 Answer

+2 votes

Hello Jeroen,

You are correct, there is a bug, the Valide.js file is loaded twice in Edit Windows :

<script src ="../efficy/js/config/require.config.js" data-custombase="../customs/default/efficy/" data-dealerbase="../"></script>
<script src ="../efficy/../lib/js/vendor/require.js" data-main="main/edit" data-custom-main=""></script>
<script src ="../efficy/scripts/Base.js" ></script>
<script src ="../efficy/scripts/Efficy.js" ></script>
<script src ="../efficy/scripts/Edit.js" ></script>
<script src ="../efficy/scripts/Validate.js" ></script>
<script src ="../efficy/scripts/Translate.js" ></script>
<script src ="../customs/default/efficy/Custom.js" ></script>
<script src ="../efficy/scripts/Validate.js" ></script>

... A workaround would be to use this macro to put in MacroEditCustom.txt

EditScriptsCustom {[
<script src="<%GetCustomBase()%>Custom.js" defer></script>
]}

Please can you open a ticket for R&D ?

answered by (1.9k points)
edited by
Hi Stéphane,

thanks for this workaround.
I've made a case for R&D.

Best regards,
Jeroen
1,193 questions
1,459 answers
1,758 comments
327 users