# Contacts, L/Gs, and Last Modifications on a sales job

## Contacts, L/Gs, and Last Modifications on a sales job

A saved sales job has related-work surfaces beside its main record. Use
**Contacts** to associate people with the job, **LGs** to review or request
job-related letters of guarantee, and **Last Modifications** to review recorded
changes to the job.

In this chapter, L/G means letter of guarantee. A contact is a person associated
with the saved sales job.

| If you need to… | Go to |
|---|---|
| Associate a person with the saved job | [Associate a contact with the sales job](#associate-a-contact-with-the-sales-job) |
| Review or request a job-related letter of guarantee | [Review or request a job-related L/G](#review-or-request-a-job-related-lg) |
| Review who changed the job and what changed | [Review recorded job changes](#review-recorded-job-changes) |
| Understand why a tab or action is unavailable | [Handle availability and stage branches](#handle-availability-and-stage-branches) |
| Match a displayed message to a recovery action | [When a related-work action goes wrong](#when-a-related-work-action-goes-wrong) |

These surfaces remain companion work beside the saved sales-job record. The
record itself remains the parent surface.

## Before you start

Each related-work surface depends on a saved sales job and on the access and
subscription conditions in the table below. A principal user cannot use
**Contacts**, **LGs**, or **Last Modifications**.

| Surface | What must be in place |
|---|---|
| **Contacts** | A saved job, the Contacts subscription, a selected account with a `PrimaryID`, and the **Contacts** tab selected. |
| **LGs** list | A saved job with `Job.Id`, the Letter of Guarantee subscription, the **LGs** tab selected, and the list access for that tab. |
| **Last Modifications** | The **Last Modifications** tab selected and the Latest Modifications subscription. |
| All three | A non-principal user. |
| Work information | The contact, guarantee request, or changed field that must remain connected to the job's client and vendor work. |

## Open a saved sales job

A saved sales job is the record that holds the related-work tabs for contacts,
letters of guarantee, and recorded changes.

### Prerequisites

- You know the saved sales job to open.

### Steps

1. Open the saved sales-job record.
2. Select the related-work tab that matches the work you need: **Contacts**,
   **LGs**, or **Last Modifications**.

![The saved sales-job record with the related-work tabs visible](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/6d9f516218dd152ca887379cd3d98859.png)

**Result:** The saved sales-job record is open with **Comments**, **Tasks**,
**Activities**, **Attachment**, **Contacts**, **LGs**, and **Last Modifications**
available as record tabs when their conditions are met.

With the record open, read the related-work surface before starting an action.

<!-- observed route: /sales/edit/83267?tab=comments&pm=false -->

## Understand the related-work surface

The related-work surface keeps people, guarantees, and change history beside
the saved job without replacing the main record.

| Tab | Use it for | What you can see or open |
|---|---|---|
| **Contacts** | Associate people with the job. | The contact grid can show **Title**, **Name**, **Position**, **Department**, **Account**, and **Branch**. |
| **LGs** | Review or request job-related letters of guarantee. | The list is organized by L/G status; selecting an L/G row opens the separate sales edit record. |
| **Last Modifications** | Review the job audit log. | An entry shows its action date, user name, and action summary; an expanded edit shows the field, old value, and new value. |

The **Contacts** surface appears only when the Contacts subscription, selected
account, account `PrimaryID`, and **Contacts** tab state are present. The **LGs**
list also needs `Job.Id`, the Letter of Guarantee subscription, and active access
to the **LGs** tab. An L/G detail surface needs a loaded guarantee with an ID.
**Last Modifications** needs its subscription and selected tab state.

Use the column headers and row values that appear in your own list. Select the
related-work tab you need to view its entries.

When you know which surface contains the work, follow the matching procedure
below, starting with [Associate a contact with the sales job](#associate-a-contact-with-the-sales-job).

## Associate a contact with the sales job

A contact is a person associated with the saved job so the job carries the people
connected to its work. Use the contact grid as the job's association surface.

### Prerequisites

- The sales job is saved and the **Contacts** tab is available.
- You are working in the same branch as the contact when the action requires it.
- Your account permits the relevant new-contact or deletion action.

### Steps

1. In the contact selection area, select the existing contact to associate with
   the sales job.
2. Choose the contact action that matches your situation.

   | If you need to… | Action |
   |---|---|
   | Start the new-contact flow when the contact does not exist | Enter its text in the contact selection area. |
   | Remove the association when permitted | Select the contact's icon-only delete action. |
   | Continue when the contact flow opens a new record | Continue in [Create a contact] as the separate contact-creation task. |

The **New** control starts the new-person flow when the Contacts subscription and
`allowedtoNew` permit it. **Export** exports the contact list. Select the contact's
delete action when you need to remove that association from this job.

**Result:** The contact list refreshes after each permitted association change, and
the job shows the current contact association.

After the contact list refreshes, continue with [Review or request a job-related
L/G](#review-or-request-a-job-related-lg) if you need guarantee work.

## Review or request a job-related L/G

Use the L/G work area to find a request, open a row for the separate sales edit
record, or start a new request when the job and your permission allow it.

### Prerequisites

- The sales job is saved with `Job.Id`.
- The Letter of Guarantee subscription is available to your account.
- You are not a principal user and the L/G action is allowed for the job's branch.

### Steps

1. On the **LGs** tab, select the status view that matches the request.

   | If you need to review… | Select |
   |---|---|
   | Every listed L/G | **All** |
   | A draft request | **Draft** |
   | A request awaiting approval | **Awaiting Approval** |
   | An approved guarantee | **Approved** |
   | An active guarantee | **Active** |
   | A guarantee due for return | **Due for Return** |
   | An expired guarantee | **Expired** |
   | A cancelled guarantee | **Cancelled** |
   | A liquidated guarantee | **Liquidated** |
   | A returned guarantee | **Returned** |
   | A closed guarantee | **Closed** |

2. Select an L/G row to open its separate sales edit record.
3. To request a new L/G, select the add action on the **LGs** tab when the
   current tab, same branch, subscription, record context, and
   `allowedtoNewLetterOfGuarantee` permission allow it.
4. In the `L/G` popup, complete the request fields shown for your configuration:

   | Field | Requirement or choices |
   |---|---|
   | **Expiry Date** | Required. |
   | **On Behalf of** | Configuration-dependent selection. |
   | **LG Type** | **Bid bond**, **Down payment guaranty**, **Performance bond**, or **Warranty bond**. |
   | `RequestedAmount` | Configuration-dependent number. |
   | `IsExtendable` | Declared as not required. |
   | `CurrentAmount` | Configuration-dependent number. |
   | `Confirmation Of The LG Requirement` | Required; choose **Yes** or **No**. |
   | `Comment` | Required. |
   | `Confirmation Of The Financial Viability` | Required; choose **Yes** or **No**. |

5. Select **Request** to submit the request.
6. In an L/G detail record, select the action that matches the current L/G stage
   and your permission.

   | If you need to… | Select |
   |---|---|
   | Save the current detail record | **Save** |
   | Save the detail record and leave it | **Save and Close** |
   | Request approval | **Request approval** |

**Result:** A saved request refreshes the L/G list and closes the `L/G` popup.

After the L/G list refreshes, continue with [Review recorded job
changes](#review-recorded-job-changes) if you need to inspect the job history.

## Review recorded job changes

**Last Modifications** is the job audit log. It lets you narrow recorded changes
by user or field and inspect the before-and-after values of an edit.

### Prerequisites

- The saved sales job has the Latest Modifications subscription.
- You are not a principal user.

### Steps

1. Select **Last Modifications** on the saved sales-job record.
2. In `ActionUsers`, select a user to narrow the entries to that user's actions.
3. In `Fields`, select a field to narrow the entries to that field's changes.
4. Expand an audit entry to read its field, old value, and new value.
5. Select **Refresh** to reload the entries.

Each entry supplies an action date, user name, and action summary.

**Result:** The history shows the entries that match the selected user and field
filters, and refreshed entries are available after **Refresh**.

If a tab or action is missing while you review the history, check [Handle
availability and stage branches](#handle-availability-and-stage-branches).

## Handle availability and stage branches

The saved-job tabs and their actions are conditional. Use the condition that
matches the missing surface before treating it as a problem.

| What is unavailable | Condition that controls it |
|---|---|
| **Contacts** | The Contacts subscription, selected account, account `PrimaryID`, and **Contacts** tab state are required. Principal users cannot use it. |
| **LGs** | The Letter of Guarantee subscription, `Job.Id`, the **LGs** tab state, and active access to that tab are required. Principal users cannot use it. |
| **Last Modifications** | The Latest Modifications subscription and **Last Modifications** tab state are required. Principal users cannot use it. |
| L/G detail tabs such as **Comments**, **Attachment**, **LG Extensions**, **LG Deductions**, **LG Increase**, and **Last Modifications** | A loaded guarantee with an ID is required. |
| **New** contact action | `allowedtoNew` and the Contacts subscription are required. |
| Contact association deletion | A non-empty list, selected layout, same branch, the Contacts subscription, and `allowedtoDelete` are required. |
| New L/G request | Same-branch access and `allowedtoNewLetterOfGuarantee`, together with the L/G list conditions, are required. |
| L/G list views | The L/G subscription and current tab state control the views. |

`ActionTypes` is not a reader control because its guard is permanently false.
Use the column headers and row values visible in your own related-work lists.

After checking the conditions, use [When a related-work action goes
wrong](#when-a-related-work-action-goes-wrong) for a displayed recovery message.

## When a related-work action goes wrong

Use the message on screen to identify the input or stage condition that stopped the
action. The available recovery is limited to the correction stated in the message.

| Message | What to do |
|---|---|
| `Forbidden characters detected. Please remove them and try again.` | Remove the forbidden characters from the contact text and submit it again. |
| ` You already have a contact with this name` | Use the existing contact instead of creating a duplicate. |
| `Please Add Extension to activate the LG` | Add the required extension before activating the L/G. |
| `LG has one or more extensions or deductions and cannot be reverted to the requested stage` | Do not revert the L/G to that stage while its extensions or deductions remain. |
| `LG still needs confirmation` | Complete the required confirmation before continuing. |
| `Please choose a date after the current expiry date` | Choose a date after the current expiry date. |
| ` There is a pending increase you can edit` | Edit the pending increase instead of starting another increase. |

The following messages can also appear while related sales-job work is being
processed. Read the message, then take the corresponding action before continuing.

| Message | What to do |
|---|---|
| `Custom fields saved successfully` | Continue after confirming that the custom fields are saved. |
| `Job updated successfully` | Continue after confirming that the job is updated. |
| `Job deleted successfully` | Return to the appropriate list after confirming that the job is deleted. |
| `Job regretted successfully` | Continue from the regretted-job result. |
| `Job cancelled successfully` | Continue from the cancelled-job result. |
| `Job missed successfully` | Continue from the missed-job result. |
| `Job reactivated successfully` | Continue working with the reactivated job. |
| `Converted to offer successfully` | Continue with the offer work for the job. |
| `Converted to inquiry successfully` | Continue with the inquiry work for the job. |
| `Converted To Regretted` | Continue from the regretted result. |
| `Converted to cancelled` | Continue from the cancelled result. |
| `Converted to lost` | Continue from the lost result. |
| `An error occurred while processing your request` | Review the current action and its fields, then repeat it. |
| `Error saving custom fields` | Review the custom fields, correct them, and save again. |
| `Cannot be un-delivered — a due invoice already exists` | Review the due invoice before changing the delivery state. |
| `All offers must be in draft status to revert to inquiry` | Return every offer to **Draft**, then repeat the reversion. |
| `Error {{errorMsg}}` | Read the displayed error detail and correct the named problem. |
| `An account with this name already exists` | Use the existing account instead of creating another one. |
| `A project with this name already exists` | Use the existing project instead of creating another one. |
| `Check mandatory field(s)` | Complete the mandatory fields. |
| `Please save opened inquiry first` | Save the opened inquiry before continuing. |
| `All inquiries must be in draft stage to revert to potential` | Return every inquiry to **Draft**, then repeat the reversion. |
| `One or more items has ZERO quantity` | Enter a quantity greater than zero for each item. |
| `One or more items has no unit` | Select a unit for each item. |
| `Please enter action for each milstone  ` | Enter an action for each milestone. |
| `Please save opened cost sheet first` | Save the opened cost sheet before continuing. |
| `There is a maximum discount that exceeds the negotiation margin.` | Reduce the discount so it does not exceed the negotiation margin. |
| `The gross profit margin is unacceptable, and the release prices have been stopped.` | Review the gross profit margin and release prices before continuing. |
| `Your request was completed successfully` | Continue after confirming that the request is complete. |
| `Error: Vendor not saved yet` | Save the vendor before continuing. |
| `Error: Client not saved yet` | Save the client before continuing. |
| `This Field Is Required` | Complete the field. |
| `Just '_'‘-''.' And '&' Characters Accepted` | Remove characters outside the accepted set. |
| `Sales order is archived` | Open the active sales order before continuing. |
| `Booked quantity for this job is greater than the required BOM quantity` | Reduce the booked quantity to the required quantity or less. |
| `You cannot edit or delete the product after the purchase package is created` | Use the existing product without editing or deleting it. |
| `Cannot be deleted. Product is in purchasing` | Leave the product in place while it is in purchasing. |
| `You cannot edit the product after the PO is created` | Leave the product in place after the purchase order is created. |
| `This product is already included in BOM` | Use the existing BOM item instead of adding it again. |
| `The first variant cannot be deleted` | Keep the first variant and choose another permitted action. |
| `An error occurred while connecting to your CRM system.` | Check the CRM connection before repeating the action. |
| `Please select one product` | Select one product, then continue. |
| ` Package must have at least one item` | Add at least one item to the package. |
| `You cannot save without adding at least one product` | Add at least one product before saving. |
| `One of products has no quantity` | Enter a quantity for every product. |
| `This record is related to saved data and cannot be deleted` | Keep the record and continue without deleting it. |
| `Action not allowed` | Choose an action available for the current record. |
| `Check validation` | Correct the validation errors. |
| `No remaining items. All items have been selected` | Continue with the selected items. |
| `This action is only allowed if you belong to that branch` | Use an account that belongs to the record's branch. |
| `Please enter at least one email` | Enter at least one email address. |
| `Inquiry must have at least one item` | Add at least one item to the inquiry. |
| `Offer must have at least one item` | Add at least one item to the offer. |
| `Order must have at least one item` | Add at least one item to the order. |
| `Items labeled as ‘Ready for Shipment’ or ‘Delivered’ cannot be deleted` | Keep items in either of those states. |
| `Please select one or more items to create a RFQ.` | Select one or more items before creating the RFQ. |
| `You don’t have permission` | Ask an administrator for the required permission. |
| `Error loading accounts` | Refresh the account list and select an available account. |
| `Serial you have entered already exist and belong to same manufacturer` | Enter a different serial or review the existing manufacturer. |
| `There is error in serial you have entered` | Correct the serial and submit it again. |
| `Minimum: At least one serial` | Enter at least one serial. |
| `One topic and at least one note is required` | Enter a topic and at least one note. |
| `There is no topic to print` | Add a topic before printing. |
| `Required Receiving Date` | Enter the receiving date. |
| `Invalid input. The value must be greater than 0 and cannot exceed 999,999.00` | Enter a value between the stated limits. |
| `Invalid input. Please enter a non-negative value` | Enter zero or a positive value. |
| `Required Receiving After` | Enter the receiving-after value. |
| `Required Offer Type` | Select an offer type. |
| `Required Bid Due Date` | Enter the bid due date. |

Backend validation and persistence are outside this page's supported recovery
boundaries.

After applying a listed correction, return to the saved sales job to continue its
main work.

## Continue with the saved sales job

The saved sales-job record remains the parent surface after related work. **Contacts**,
**LGs**, and **Last Modifications** are tabs on that record for related work, while
an L/G row opens the separate sales edit record.

Return to the saved job to continue its main work after reviewing contacts, L/Gs,
or recorded changes. The broader contact record is covered by the Contacts overview
page. New-contact work is covered by the Create a contact page. The complete
guarantee progression is covered by the L/G lifecycle and Create an L/G pages.
