Class AttachedDocument

Object
AttachedDocument
All Implemented Interfaces:
UserGroupRestrictedObject

@Entity public class AttachedDocument extends Object implements UserGroupRestrictedObject
Read-only summary of a document attached to a Deal Plan, such as a Quote, Contract, Rebate Agreement, Claim or Price List.

Each instance describes one attached document: its typed ID, label, unique name, status, workflow status, and who created, updated, submitted, approved or denied it. The object is a snapshot and cannot be saved back. Use it to read information about the attached documents, not to modify them.

You get a list of these objects from api.findAttachedDocuments(typedId, lineId, filters). Logic code does not create instances directly.

Deprecated: The Deal Planning module has been discontinued since version 11.3.0, and api.findAttachedDocuments is deprecated. There is no replacement.

Note: getCreateDate() and getLastUpdateDate() return formatted date-time strings, not date objects. isFinal() is set by api.findAttachedDocuments. isAttached() is not set by that call and always returns false.

Since:
6.0 - Vesper
  • Constructor Details

    • AttachedDocument

      public AttachedDocument()
  • Method Details

    • getCreatedBy

      public Long getCreatedBy()
      Returns the ID of the user who created the document.
      Returns:
      User ID, or null if it is not set.
      See Also:
    • getLastUpdateBy

      public Long getLastUpdateBy()
      Returns the ID of the user who last updated the document.
      Returns:
      User ID, or null if it is not set.
      See Also:
    • getDeleteDate

      public LocalDateTime getDeleteDate()
      Returns the date and time when the document was deleted.
      Returns:
      Delete date, or null if the document is not deleted.
    • getDeletedBy

      public Long getDeletedBy()
      Returns the ID of the user who deleted the document.
      Returns:
      User ID, or null if the document is not deleted.
    • isDeleted

      public boolean isDeleted()
      Checks whether the document is deleted.
      Returns:
      true if the document is deleted.
    • getVersion

      public Long getVersion()
      Returns the version number of the document. The number goes up each time the document is saved.
      Returns:
      Version number.
    • getCreateDate

      public String getCreateDate()
      Returns the date this document was created, as a formatted date-time string, or null if it is not set.
    • getLastUpdateDate

      public String getLastUpdateDate()
      Returns the date this document was last updated, as a formatted date-time string, or null if it is not set.
    • getLabel

      public String getLabel()
      Returns the label (display name) of the document.
      Returns:
      Label, or null if it is not set.
    • getUniqueName

      public String getUniqueName()
      Returns the unique name of the document, for example P-1234 for a Quote. For a Price List, this is its ID; for a Simulation or a Live Price Grid, its typed ID (for example 12.SIM).
      Returns:
      Unique name.
    • getDocTypedId

      public String getDocTypedId()
      Returns the typed ID of the document, for example 1234.Q for a Quote or 56.CT for a Contract. The same as getTypedId().
      Returns:
      Typed ID of the document.
    • getDocumentType

      public DocumentRef.DocumentType getDocumentType()
      Returns the kind of the document, for example QUOTE, CONTRACT or PRICE_LIST.
      Returns:
      Document type.
      See Also:
    • getTypedId

      public String getTypedId()
      Returns the typed ID of the document, for example 1234.Q. The same as getDocTypedId().
      Returns:
      Typed ID of the document.
    • getTypeCode

      public TypeCode getTypeCode()
      Returns the type code of the document, for example Q for a Quote or CT for a Contract.
      Returns:
      Type code of the document.
      See Also:
    • getTypeUniqueName

      public String getTypeUniqueName()
      Returns the unique name of the document's type, for example the Quote Type of a Quote or the Claim Type of a Claim. For a Simulation, this is the typed ID of the Price List or Live Price Grid it is based on (for example 123.PL).
      Returns:
      Unique name of the type, or null if the document has no type.
    • getStatus

      public AttachedDocument.DocumentStatus getStatus()
      Returns the status of the document, mapped to a common list of statuses for all kinds of documents. See AttachedDocument.DocumentStatus.
      Returns:
      Status of the document. AttachedDocument.DocumentStatus.UNKNOWN if the status cannot be mapped.
      See Also:
    • getWorkflowStatus

      public Workflow.WorkflowStatus getWorkflowStatus()
      Returns the status of the approval workflow of the document, for example SUBMITTED or APPROVED.
      Returns:
      Workflow status, or null if it is not set.
      See Also:
    • getLastUpdateByName

      public String getLastUpdateByName()
      Returns the name of the user who last updated the document.
      Returns:
      User name, or null if it is not set.
    • getCreatedByName

      public String getCreatedByName()
      Returns the name of the user who created the document.
      Returns:
      User name, or null if it is not set.
    • getSubmittedByName

      public String getSubmittedByName()
      Returns the name of the user who submitted the document for approval.
      Returns:
      User name, or null if the document was not submitted.
    • getApprovedByName

      public String getApprovedByName()
      Returns the name of the user who approved the document. It depends on the kind of document:
      • Quote, Contract, Rebate Agreement, Price List and Compensation: the user who last acted on the approval workflow. It is set only when the workflow status is SUBMITTED, APPROVED or NO_APPROVAL_REQUIRED.
      • Claim, Deal Plan, Custom Form and Model Object: the approver stored on the document.
      • Manual Price List, Simulation and Live Price Grid: always null.
      Returns:
      User name, or null if it is not set.
      See Also:
    • getDeniedByName

      public String getDeniedByName()
      Returns the name of the user who denied the document. It depends on the kind of document:
      • Quote, Contract, Rebate Agreement, Price List and Compensation: the user who last acted on the approval workflow. It is set only when the workflow status is DENIED.
      • Claim, Deal Plan, Custom Form and Model Object: the user who denied it, as stored on the document.
      • Manual Price List, Simulation and Live Price Grid: always null.
      Returns:
      User name, or null if it is not set.
      See Also:
    • getUserGroupEdit

      public String getUserGroupEdit()
      Returns the User Groups that can edit the document.
      Specified by:
      getUserGroupEdit in interface UserGroupRestrictedObject
      Returns:
      User Groups, or null if editing is not restricted.
    • setUserGroupEdit

      public void setUserGroupEdit(String userGroupEdit)
      Internal: used by the server. Not for use in logic. The object is a read-only snapshot, so this change is not saved.
      Specified by:
      setUserGroupEdit in interface UserGroupRestrictedObject
      Parameters:
      userGroupEdit - User Groups that can edit the document.
    • getUserGroupViewDetails

      public String getUserGroupViewDetails()
      Returns the User Groups that can view the details of the document.
      Specified by:
      getUserGroupViewDetails in interface UserGroupRestrictedObject
      Returns:
      User Groups, or null if viewing is not restricted.
    • setUserGroupViewDetails

      public void setUserGroupViewDetails(String userGroupViewDetails)
      Internal: used by the server. Not for use in logic. The object is a read-only snapshot, so this change is not saved.
      Specified by:
      setUserGroupViewDetails in interface UserGroupRestrictedObject
      Parameters:
      userGroupViewDetails - User Groups that can view the details of the document.
    • isFinal

      public boolean isFinal()
      Checks whether the document is marked as final in the Deal Plan. api.findAttachedDocuments sets this value.
      Returns:
      true if the document is marked as final.
    • setFinal

      public void setFinal(boolean isFinal)
      Internal: used by the server to set the final flag. Not for use in logic.
      Parameters:
      isFinal - true if the document is marked as final in the Deal Plan.
    • isAttached

      public boolean isAttached()
      Checks whether the document is attached to the Deal Plan. api.findAttachedDocuments does not set this value, so it returns false for the objects that this call returns.
      Returns:
      true if the document is attached.
    • setAttached

      public void setAttached(boolean attached)
      Internal: used by the server to set the attached flag. Not for use in logic.
      Parameters:
      attached - true if the document is attached to the Deal Plan.
    • toString

      public String toString()
      Returns the typed ID of the document, for example 1234.Q.
      Overrides:
      toString in class Object
      Returns:
      Typed ID of the document.