Loading
Automotive Cloud
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Update Additional Components for Funding Workbench

          Update Additional Components for Funding Workbench

          Set up additional components for enabling and accessing the capabilities of Funding Workbench.

          Required Editions

          Available in: Lightning Experience
          Available in: Enterprise, Unlimited, and Developer Editions.
          1. Clone and update flexcards for Document Checklist Items on an Application Action Item.
            1. From App Launcher, search for and select Flexcards.
            2. Open the FundingWorkbenchDocumentItemForApplicationActionItem flexcard and click Clone.
            3. Enter a name and save your changes.
            4. Select the first cell in the first column in the flexcard and delete it.
            5. From the elements panel, drag and drop an Action element in its place.
            6. In the properties panel, enter a name and label and select Show label without the icon.
            7. Enter an Action label.
            8. For Action Type, select Navigate.
            9. For Target, select Record.
            10. For Object API Name, enter DocumentChecklistItem.
            11. For Target Action, select View.
            12. Save and activate the flexcard.
            13. Similarly, clone the FundingWorkbenchDocumentsForApplicationActionItem flexcard.
            14. Replace the child FundingWorkbenchDocumentItemForApplicationActionItem flexcard with your new flexcard cloned and updated in the steps above.
          2. Add the cloned flexcards to the Application Action Item record page.
            1. From App Launcher, search for and select Application Action Items.
            2. Open a record page, from setup click Edit Page.
            3. Replace the FundingWorkbenchDocumentItemForApplicationActionItem flexcard on the related tab with your updated flexcard from step 1h.
            4. Activate your flexcard and under App, Record Type, and Profile, select Assign to Apps, Record Types, and Profiles.
            5. Select Funding Workbench Console.
            6. Click Next until the Profiles section.
            7. Select the required users.
            8. Click Next and save your changes.
          3. Update the FundingWorkbenchActionItemCreation Omniscript.
            1. From App Launcher, search for and select Omniscripts.
            2. Open the FundingWorkbenchActionItemCreation Omniscript and click New Version.
            3. Replace the label of the first Step element with $standardLabel.FundingWorkbenchActionItemCreation.Step1Header.
            4. Replace the label of the first Step element with $standardLabel.FundingWorkbenchActionItemCreation.Step2Header.
          4. Create an apex class.
            1. In Setup, in the Quick Find box, enter Apex Classes, and then select Apex Classes.
            2. Click New.
            3. Enter the Apex Class as provided.
              global class FundingWorkbenchApexUtil implements System.Callable {
              
                  // Minimal constants needed for this method + error reporting
                  private static final String RESULT_KEY = 'result';
                  private static final String SIZE_KEY   = 'size';
                  private static final String FOUND_KEY  = 'found';
                  private static final String APEX_INVOCATION_ERROR = 'ApexInvocationErrorDetails';
              
                  global FundingWorkbenchApexUtil() {}
              
                  // --- REQUIRED by System.Callable pattern used in the original ---
                  global static Object call(String action, Map<String, Object> args) {
                      Map<String, Object> input  = (Map<String, Object>) args.get('input');
                      Map<String, Object> output = (Map<String, Object>) args.get('output');
                      return invokeMethod(action, input, output);
                  }
              
                  // --- Minimal dispatcher: keep only what's needed ---
                  public static Object invokeMethod(String methodName,
                                                    Map<String, Object> input,
                                                    Map<String, Object> output) {
                      String errorDetails;
              
                      try {
                          switch on methodName {
                              when 'formatAssociatedParties' {
                                  return formatAssociatedParties(input, output);
                              }
                              when else {
                                  errorDetails = 'Invalid methodname';
                              }
                          }
                      } catch (Exception ex) {
                          errorDetails = 'Error Occurred : ' + ex.getMessage();
                      }
              
                      if (errorDetails != null) {
                          output.put(APEX_INVOCATION_ERROR, errorDetails);
                      }
                      return output;
                  }
              
                  /**
                   * Normalizes AssociatedParties into:
                   * [{ "label": "...", "value": "..." }, ...]
                   *
                   * Supports:
                   * 1) List<Object> of Map<String,Object> with keys label/value
                   * 2) String like:
                   *    "[{label=Application General, value=13Z...},[{label=Rachel, value=0x...}, {label=Mike, value=0x...}]]"
                   */
                  private static Object formatAssociatedParties(Map<String, Object> input,
                                                               Map<String, Object> output) {
                      List<Map<String, Object>> result = new List<Map<String, Object>>();
                      Object raw = (input == null) ? null : input.get('AssociatedParties');
              
                      if (raw == null) {
                          output.put(RESULT_KEY, result);
                          output.put(SIZE_KEY, 0);
                          output.put(FOUND_KEY, false);
                          return null;
                      }
              
                      // Case 1: Already list of objects
                      if (raw instanceof List<Object>) {
                          for (Object o : (List<Object>) raw) {
                              if (o == null) continue;
              
                              if (o instanceof Map<String, Object>) {
                                  Map<String, Object> row = (Map<String, Object>) o;
                                  String label = String.valueOf(row.get('label'));
                                  String value = String.valueOf(row.get('value'));
              
                                  if (!String.isBlank(label) && !String.isBlank(value)) {
                                      result.add(new Map<String, Object>{
                                          'label' => label,
                                          'value' => value
                                      });
                                  }
                              }
                          }
                      }
                      // Case 2: String (may be nested / have spaces)
                      else if (raw instanceof String) {
                          String s = ((String) raw).trim();
                          if (!String.isBlank(s)) {
                              // Extract every label/value pair anywhere in the string.
                              Pattern p = Pattern.compile(
                                  'label\\s*=\\s*([^,\\]\\}]+)\\s*,\\s*value\\s*=\\s*([^\\]\\}\\,\\s]+)'
                              );
                              Matcher m = p.matcher(s);
              
                              while (m.find()) {
                                  String label = m.group(1).trim();
                                  String value = m.group(2).trim();
              
                                  // strip any trailing brackets that sneak into the last token
                                  while (value.endsWith(']')) {
                                      value = value.left(value.length() - 1).trim();
                                  }
              
                                  if (!String.isBlank(label) && !String.isBlank(value)) {
                                      result.add(new Map<String, Object>{
                                          'label' => label,
                                          'value' => value
                                      });
                                  }
                              }
                          }
                      }
              
                      output.put(RESULT_KEY, result);
                      output.put(SIZE_KEY, result.size());
                      output.put(FOUND_KEY, !result.isEmpty());
                      return null;
                  }
              }
              
            4. Save your changes.
          5. Update the FundingWorkbenchGetDocumentCategoryAndType integration procedure with the created apex class.
            1. From the App Launcher, find and select Integration Procedures.
            2. Open FundingWorkbenchGetDocumentCategoryAndType.
            3. From the dropdown, click Create Version.
            4. For the Remote, Remote1, and Remote2 remote action elements, in the properties panel, for Remote Class, enter FundingWorkbenchApexUtil.
            5. For the SetAssociatedParties, SetAssociatedParties1, and SetAssociatedParties2 set values action elements, in the properties panel, set the element value as [%DataMapperExtract:ApplicationFormProduct%,%DataMapperExtract:PartyProfiles%], [%DataMapperExtract1:ApplicationFormProduct%,%DataMapperExtract1:PartyProfiles%], and [%DataMapperExtract2:ApplicationFormProduct%,%DataMapperExtract2:PartyProfiles%] respectively.
            6. Save and activate your changes.
          6. Update the FundingWorkbenchDocumentDetailsSelection flexcard.
            1. From the App Launcher, find and select Flexcards.
            2. Open the FundingWorkbenchDocumentDetailsSelection flexcard and click Clone.
            3. Enter a name and save your changes.
            4. For the "Select the document category" input element, in the Actions panel, select the getDocTypes action.
            5. Update the Integration Procedure Name to FundingWorkbenchGetDocumentCategoryAndType.
            6. Save and activate your changes.
          7. Update the FundingWorkbenchDocumentUpload flexcard.
            1. From App Launcher, search for and select Omniscripts.
            2. Open the FundingWorkbenchDocumentUpload Omniscript and click New Version.
            3. In the UploadFileStep, update the flexcard name to the name of the newly cloned and updated flexcard from step 6.
            4. In the SetSelectedValues step, for the SelectedDocumentTypeId element, update the Expression as follows.
              • IF(%UploadFileStep:SelectDocumentCategoryAndType:DocumentInformation:selectedDocumentTypeId% == NULL, %documentTypeValue%, %UploadFileStep:SelectDocumentCategoryAndType:DocumentInformation:selectedDocumentTypeId%)
          Note
          Note In case the Funding Workbench app isn't visible in your org, please check this known issue.
           
          Loading
          Salesforce Help | Article