Default OpportunityFile Column value from the FileDetailV2 module?

Hello,

I have added a number column to the OpportunityFile object, and I have two separate File details for uploading to the same Opportunity. I would like each detail so set my new column to a different value (numbers 1 or 2). How can this be achieved?

Like 0

Like

1 comments

Hello Jordan,

 

There should be two different schemas for these two details that are using the same object. To achieve your task you need to add this method two both your details schemas:

 

methods: {

            save: function() {

                this.callParent(arguments);

                this.setInteger();

            },

            setInteger: function() {

            this.set("UsrInteger1", 2);

            }

        },

 

and replace UsrInteger1 with the name of your integer column from the object and specify the value of 1 or 2 in this part

 

this.set("UsrInteger1", 2);

 

for each detail schema separately. As a result, each time you add the file to each detail your integer column will be populated with the correct integer value.

 

Best regards,

Oscar

Show all comments