Adding Custom Fields to Checkout page

Aeden Frost
Tera Contributor

Hello all of you beautiful people, hope you're having a nice day.

 

I have an issue with adding and mapping new fields from the checkout to the sc_request form.

I've been able to create the fields on the checkout form, as shown below, but I cannot configure the server side to make it populate the forms when a sc_request form is created.

   <!-- Start new Fields. -->
          <label for="delivery-location" ng-class="{'m-l': c.isNative}">${Location}
                          </label>
                          <i ng-if="!c.isNative" class="fa fa-info-circle" tabindex="0" data-toggle="tooltip" data-original-title="${Requestor's Location}" data-placement="right" aria-label="${Requestor's Location}"></i>
                          <sn-record-picker id="delivery-location"
                                            field="c.deliveryLocation"
                                            table="'cmn_location'" 
                                            display-field="c.data.reqForDispCol" 
                                            display-fields="c.data.reqForDispCols" 
                                            value-field="'name'" 
                                            search-fields="c.data.reqForSearchCols"
                                            default-query="c.data.reqForQuery"
                                            page-size="100"
                                            options="{allowClear : false}"
                                            sn-disabled="!c.data.disable_req_for">
                          </sn-record-picker>
              </div>
          </div>
              
              <label for="to-stockroom" ng-class="{'m-l': c.isNative}">${To stockroom}
                          </label>
                          <i ng-if="!c.isNative" class="fa fa-info-circle" tabindex="0" data-toggle="tooltip" data-original-title="${Requestor's Location}" data-placement="right" aria-label="${Requestor's Location}"></i>
                          <sn-record-picker id="to-stockroom"
                                            field="c.toStockroom"
                                            table="'alm_stockroom'" 
                                            display-field="c.data.reqForDispCol" 
                                            display-fields="c.data.reqForDispCols" 
                                            value-field="'name'" 
                                            search-fields="c.data.reqForSearchCols"
                                            default-query="c.data.reqForQuery"
                                            page-size="100"
                                            options="{allowClear : false}"
                                            sn-disabled="!c.data.disable_req_for">
                          </sn-record-picker>
                            
          </div>
              
              <label for="to-stockroom" ng-class="{'m-l': c.isNative}">${Cost Centre}
                          </label>
                          <i ng-if="!c.isNative" class="fa fa-info-circle" tabindex="0" data-toggle="tooltip" data-original-title="${Cost Centre associated with request}" data-placement="right" aria-label="${Cost Centre associated with request}"></i>
                          <sn-record-picker id="cost-centre"
                                            field="c.costCentre"
                                            table="'cmn_cost_center'" 
                                            display-field="c.data.reqForDispCol" 
                                            display-fields="c.data.reqForDispCols" 
                                            value-field="'name'" 
                                            search-fields="c.data.reqForSearchCols"
                                            default-query="c.data.reqForQuery"
                                            page-size="100"
                                            options="{allowClear : false}"
                                            sn-disabled="!c.data.disable_req_for">
                          </sn-record-picker>
                            </div>
              <!-- End New Fields. -->

These are the new fields that I have added to a Catalog Checkout Widget, any help with the server side would be greatly appreciated! Every other post I've found on this has been for older versions of ServiceNow with different server-side code.

1 ACCEPTED SOLUTION

-O-
Kilo Patron
Kilo Patron

I don't think it is possible. The submission of a Catalog Item happens with help of the Service Catalog API (REST) and if you look at the parameters allowed, there is no way to pass on more data then variables, requested for and at most delivery address and special instructions.

Best is to stick with requesting all information through variables.

View solution in original post

3 REPLIES 3

-O-
Kilo Patron
Kilo Patron

I don't think it is possible. The submission of a Catalog Item happens with help of the Service Catalog API (REST) and if you look at the parameters allowed, there is no way to pass on more data then variables, requested for and at most delivery address and special instructions.

Best is to stick with requesting all information through variables.

Aeden Frost
Tera Contributor

Oh, that's annoying. Thank you very much for the answer

You're welcome 🙂