Disable 'Create EntityName' in general or based on status/field in another entity?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • worldmiros
    Senior Member
    • Dec 2015
    • 120

    Disable 'Create EntityName' in general or based on status/field in another entity?

    For example, in Task entity, there link that says, 'Create Task' (<a href="#Task/create">). Is it possible to disable that in general? And is it possible to enable it based on the status/field (in another Entity). If so, can it also be done for an entity created from entityManager?
  • worldmiros
    Senior Member
    • Dec 2015
    • 120

    #2
    I know directory, "Views.List" is responsible for the e.g. (<a href="#Task/create">). I created a list js file, then added "Views.List" and "Views.Main" as dependencies. I inherited the setup and setupcreatebutton function. In the console, I ran a test to see if I can get the array of objects the dev pushed onto this.menu.buttons, and was a success. Is there a way to push another property such as,
    PHP Code:
    this.menu.buttons.unshift({
      onClick: "return false;"
    //not sure if onClick: "return false;" is allowed
    }); 
    
    based on the status/field of another entity or entity records (list). Then maybe test if onclick is set to false, to add some some css, something similar to when button is disable (opacity changes). And maybe,
    PHP Code:
    delete this.menu.buttons[0].onClick
    //or
    this.menu.buttons[0].onClick = "return true;" 
    
    when the conditions I have implemented has been met.
    Last edited by worldmiros; 03-23-2016, 08:58 PM.

    Comment

    • worldmiros
      Senior Member
      • Dec 2015
      • 120

      #3
      Not sure how the get all the statuses of all the Quotes, that is displayed on the list. Is there a code already in espo to use as an example?

      Comment

      Working...