Errors and Warnings

As part of logging, FormulaShare will do what it can to identify where and why any sharing couldn't be applied. This is done in two main ways:

  • Record level errors. These are issues encountered when trying to assess or apply sharing for a particular record. For these issues, details are recorded in the Status Reason field on the relevant Processed Record Share.
  • Batch level errors which aren't specific to a record. In this context, the most recent exception will be recorded in the exception fields in the FormulaShare Batch Logs record. Specific batch numbers which failed will be listed in the Failed Batches field.

This section outlines the messages which come up in each of these contexts and how to interpret these.

 

Record level errors

The errors and warnings detected and captured during record processing are shown on the Processed Record Share detail page:

Processed Record Log Error


Possible Status Reason values are below:

  • Invalid rule metadata, check all fields populated: <rule details>
    Suggests the rule is not correctly defined. This could be due to a metadata record being set with an unsupported combination of values. If this doesn't seem to be fixable by modifying the rule from the FormulaShare Rules list, check the custom metadata record to see whether anything looks wrong. If neither of these work, try deleting the custom metadata record and recreating the rule.
     
  • Expected field to contain valid user / role / group id. Instead found: ....
    Indicates that the rule is set up to expect a 15 or 18 character id in the specified field, but that something other than this is set in the record. Check the record this log relates to to ensure the field is populating correctly, or update the rule to expect the appropriate data type in this field if needed.
     
  • No active user found with id <userId>
    For user sharing, FormulaShare will check that a user exists with the id specified and check that they're currently active. If a user doesn't exist matching the id or the matching user is inactive, this message will be shown.
     
  • Field value <value> should correspond to an active <public group / role>, but no <group / role> was found with this name
    Suggests that the share with field in the record being assessed is populated with the name of a public group / role which doesn't exist in the org.
     
  • Role <role name> specified on record is not valid for sharing
    Indicates that the share with field in the record assessed is populated with a value which doesn't correspond to the id of a valid role sharing group.
     
  • Share record to be inserted wasn't detected in query
    Implies that FormulaShare was called and identified that a share record should be created for the record, but that the asynchronous process which checks for sharing after the transaction has finished couldn't find the expected share record. This could suggest the insert line of the trigger code (or create element of a record-triggered flow) run correctly.
     
  • Share record identified for removal not actually deleted
    Implies that FormulaShare was called and identified a share record which should be deleted, but that the asynchronous process which checks for sharing after the transaction has finished recognised that the share record still exists. This could be because the delete line of the trigger code (or delete element of a record-triggered flow) didn't run correctly.

 

Batch level errors

Batch errors are recorded in the Exception Details section of batch logs:

Batch log exception details

Possible messages which may come up:

  • Issue populating batch scope. Message from Salesforce: ....
    Indicates a problem occurred while querying for details of the records which are part of the specific batch being processed. The message from Salesforce will show the message of the raw exception encountered
     
  • FormulaShareService processing error. Message from Salesforce: ....
    Shows an exception was encountered during the core FormulaShare sharing assessment process
     
  • Issue capturing logs or metrics. Message from Salesforce: ....
    This shows a problem was encountered when trying to update rule metrics after batch processing. This isn't an indication that the anything was missed or failed during the sharing assessment, but could mean the number of record shares on the FormulaShare Rules list may not be correct

Note that none of these are expected under normal processing. If you're seeing any of these messages regularly, or if other unexpected issues related to batch processing, feel free to get in touch with FormulaShare support.