You need to sign in to do that
Don't have an account?
N - 1 Apex Class code
I have a value in an object that I'm trying to create a button for the user to de-crement (N - 1). This value tracks the progress of an record in the program and the N - 1 functionality would allow the existing department to send a record back one phase if they find that it isn't done to their standards (a quality control function). Found out that this can't be done in VisualForce itself via something simple like a command button that just writes out "object__c.field__c - 1" or something to that effect, so need the controller method of how this would be done and can't seem to find it online here.
The field in question is called "RPP_Tracker__c.Present_Dept_Number__c". Any help much appreciated.
The field in question is called "RPP_Tracker__c.Present_Dept_Number__c". Any help much appreciated.
Suppose below is your VF page:
Controller code:
SUGGESTION 2:
Instead of going for VF page, you can create a Detail page button with Onclick Javascript behaviour. On click of button decrement value and reload the page on successfull update and show error message if any failure.
JS code:
All Answers
Suppose below is your VF page:
Controller code:
SUGGESTION 2:
Instead of going for VF page, you can create a Detail page button with Onclick Javascript behaviour. On click of button decrement value and reload the page on successfull update and show error message if any failure.
JS code: