Creating a Quote from Accounts doesn´t link anything

If a strange behaviour, but i am not sure how to fix it.

I am on an Account. There are two Subpanels "Quote (Bill to)" and "Qoute (Ship to)".

Every other [+] on the other Subpanels opens the "Overlay" and links the account together.

On the "Quotes" [+] it jumps to "/#Quotes/create"

On this page there is a Select Account dropdown as a mandatory field.

It´s an installation i make the support and i am not sure if some future developer made something crazy or if it works currently as designed.

What i would achive is:

Click [+] on the Account Subpanel "Quote (Bill to)" and the current selected Account is used as default "BILLING_ACCOUNT".

Any ideas or suggestions?

There is no vardefs Overwrite so far as i  can see.

Any help appreciated.

Parents Reply Children
  • Well, i found the reason - looks like the custom/modules/Quotes/clients/base/views/create/create.js makes "nothing" or something wrong. Pretty simple logic. If i remove the create.js - it works. But with this File - the wrong behavior exists. What´s wrong with this create.js ?? (record.js looks similiar)

    ({ extendsFrom: 'CreateView', initialize: function (options) { this._super('initialize', [options]); this.getDefaultText(); }, getDefaultText: function () { var self = this; var beanId = this.model.get('id'); var url = App.api.buildURL("Quotes/getDefaultText/" + beanId + "/1", null, null); App.api.call('read', url, null, { success: function (response) { // do something with response } }); } })

  • EVentually your custom js controller should extendsFrom 'QuotesCreateView' instead.

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Michael,

    Andre is correct that the file should be extending from 'QuotesCreateView' but your main issue is that this custom create.js file is actually doing nothing at all. It is simply calling the parent version of initialize() then making a call to an API endpoint that it does nothing with. Your "success(response)" function only has a comment line in it so it is doing nothing with the API response.

    I'd guess your best bet is just to remove this custom create.js until you find out what the developer was trying to do with it. It is not performing any function that I can see (unless it is just trying to ensure that the API call gets made but is not worried about what it returns!) and is incorrectly extending anyway.

    This is probably why the correct default behaviour works for you when you don't have this file.

    Thanks,

    JH.

  • The missing success callback is not responsible for such a behavior, probably it is under development.

    Whenever you create a custom js controller you need to figure out if a default one already exists so you may decide which to extendsFrom.

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Guys you are awesome. That´s the solution. After i change the "extendsFrom" everything still work.

    And yes, i striped the code a little bit. the "getDefaultText" Function has some logic inside, but i was aware, that that was not the reason.

    Solution was so simple - but now i am aware for that in the future.

    Thanks a lot!

  • Andre,

    You are quite right, I wasn't as clear as I could have been. My intention was to suggest that if the function was empty then removing the file might be the best solution to avoid unnecessary API calls. As Michael has pointed out, it wasn't actually empty so was needed.

    In any case, the "extendsFrom" was going to be the cause of the issue as I tried to agree with in my first line.

    Apologies for any confusion in my reply Slight smile

    @Michael - glad you have the issue sorted now.

    Thanks,

    JH.