How to edit code for submit on Project form?

Hi Team,

Project Form

I want to modify code for highlighted red section. I tried to find the function for same but I dint find and also din't find button on form(PM_projectOnAdd).

Any one can please help where I can find this event method ?

  • Hello,

    Could you let us know what you're trying to change about this functionality? The functionality for that button is contained within the codetree and would require modifying source files which is typically not recommended. If we know what you're trying to do, we may be able to recommend a change that will only affect the database.

    Chris

    Christopher Gillis

    Aras Labs Software Engineer

  • Hi christopher, 

    Thank you for replying in short time. 

    I want to add one field on that page, which will be required/mandatory. Also i need to validate that field on click of that button and if validation result successful fhan it will move to project form. 

  • There's two ways to achieve that.

    The first would be to simply flag your new property as Required on the Project ItemType. This won't prevent users from closing that initial dialog, but it will prevent users from saving and actually creating the new Project from the main form. The Project isn't actually saved to the database when you click the green check mark on the dialog. The fields required there undergo additional validation for the purposes of calculating the schedule of the Project.

    If you have good reason to require the field specifically on that dialog, you can find the file in your installation directory (By default C:\Program Files (x86)\Aras\Innovator\) under \Innovator\Client\Solutions\Project\scripts\addProjectDialog.html. You can edit the function sendData in this file to perform a validation check. The beginning of this function already performs validation checks for other properties, so you can base your own check on those.

    Chris

  • Sorry I clicked on verified answer first.

    I tried your first option of making field required but on click of button its not validating i.e. it redirect to main project form page even if field marked required is empty or null. But same field when I use on main project form page it gets validate. I know why its behaving as strange on first dialog box? 

    I also tried editing code in addProjectDialog.html this file but its not working too. 

  • Hello,

    What you're describing is the expected behavior of marking this new field as Required. The user will still be able to close the first dialog, but they will not be able to save the Project from the main from. The Project is not saved to the database when the initial dialog is closed, so this functionally meets the requirements but may be confusing to users. This means that you're likely better off changing the file in the codetree.

    Could you confirm that you have cleared your browser cache after making this change to addProjectDialog.html? It's possible that an old, cached copy of the file is still being used when you open a project. If you can confirm it works after clearing your cache, you can force all of the client machines to use the new copy of this file by following the steps below.

    1. Navigate to \Innovator\Client\web.config
    2. Open this file in a text editor
    3. Near the bottom find the <cachingModule/> XML tag
    4. Update the filesRevision attribute and increment it's value by 1
      1. std->2->3->4->etc.
    5. Save the file

    Chris

    Christopher Gillis

    Aras Labs Software Engineer

  • Hi Christopher,


    Thank you for your time and reply.

    Clearing cache after modifying addProjectDialog.html file solved my problem.

    Actually my requirement was not to allow user to redirect to main project form from first popup until it enters and validate field from DB. 

    This solution made my day. Thank you once again.