• Angela Stratman
  • NEWBIE
  • 0 Points
  • Member since 2020
  • Business Analyst
  • Kappus Company

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
We have a Create New Work Order page in Field Service Lightning (FSL), as a Visualforce page.  One of the fields is a Work Type (picklist), but the order of the picklist is crazy, and I would like it to be in alphabetical order.  I have no idea if this is even possible or what order it is even pulling in.  Below are the only 2 parts of the code that contain Work Order Type.  I am not a developer, so any help is GREATLY appreciated!

  <tr>
                                    <td>
                                        <div class="slds-form-element">
                                            <label class="slds-form-element__label">Work Type *</label>
                                        </div>
                                    </td>
                                    <td>
                                        <div class="slds-form-element__control">
                                            <select id="work-type" class="slds-input" data-api="WorkTypeId">
                                                <option value=""></option>
                                            </select>
                                        </div>
                                    </td>
                                </tr>
_________________________________________________________________________________
var getPicklistOptions = function() {
Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.Kappus_NewWorkOrderButtonController.getWorkTypes}',
            function(workTypes, event) {
                if (event.statusCode === 200) {                   Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.Kappus_NewWorkOrderButtonController.getOptions}',
                    function(options, event) {
                        if (event.statusCode === 200) {
                            var options1 = '',
                                options2 = '',
                                options3 = '';
                            workTypes.forEach(function(workType) {
                                options1 += '<option value="' + workType['Id'] + '">' + workType['Name'] + '</option>';
                            });


 
We have a Create New Work Order page in Field Service Lightning (FSL), as a Visualforce page.  One of the fields is a Work Type (picklist), but the order of the picklist is crazy, and I would like it to be in alphabetical order.  I have no idea if this is even possible or what order it is even pulling in.  Below are the only 2 parts of the code that contain Work Order Type.  I am not a developer, so any help is GREATLY appreciated!

  <tr>
                                    <td>
                                        <div class="slds-form-element">
                                            <label class="slds-form-element__label">Work Type *</label>
                                        </div>
                                    </td>
                                    <td>
                                        <div class="slds-form-element__control">
                                            <select id="work-type" class="slds-input" data-api="WorkTypeId">
                                                <option value=""></option>
                                            </select>
                                        </div>
                                    </td>
                                </tr>
_________________________________________________________________________________
var getPicklistOptions = function() {
Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.Kappus_NewWorkOrderButtonController.getWorkTypes}',
            function(workTypes, event) {
                if (event.statusCode === 200) {                   Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.Kappus_NewWorkOrderButtonController.getOptions}',
                    function(options, event) {
                        if (event.statusCode === 200) {
                            var options1 = '',
                                options2 = '',
                                options3 = '';
                            workTypes.forEach(function(workType) {
                                options1 += '<option value="' + workType['Id'] + '">' + workType['Name'] + '</option>';
                            });