Table 5061 Rlshp. Mgt. Comment Line, source in 29

Source29

src/Layers/W1/BaseApp/CRM/Comment/RlshpMgtCommentLine.Table.al113 lines, Copyright (c) Microsoft Corporation. MIT

// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
namespace Microsoft.CRM.Comment;

using Microsoft.CRM.Campaign;
using Microsoft.CRM.Contact;
using Microsoft.CRM.Opportunity;
using Microsoft.CRM.Setup;
using Microsoft.CRM.Task;

table 5061 "Rlshp. Mgt. Comment Line"
{
    Caption = 'Rlshp. Mgt. Comment Line';
    DataClassification = CustomerContent;
    DrillDownPageID = "Rlshp. Mgt. Comment List";
    LookupPageID = "Rlshp. Mgt. Comment List";

    fields
    {
        field(1; "Table Name"; Enum "Rlshp. Mgt. Comment Line Table Name")
        {
            Caption = 'Table Name';
        }
        field(2; "No."; Code[20])
        {
            Caption = 'No.';
            ToolTip = 'Specifies the number of the involved entry or record, according to the specified number series.';
            TableRelation = if ("Table Name" = const(Contact)) Contact
            else
            if ("Table Name" = const(Campaign)) Campaign
            else
            if ("Table Name" = const("To-do")) "To-do"
            else
            if ("Table Name" = const("Web Source")) "Web Source"
            else
            if ("Table Name" = const("Sales Cycle")) "Sales Cycle"
            else
            if ("Table Name" = const("Sales Cycle Stage")) "Sales Cycle Stage"
            else
            if ("Table Name" = const(Opportunity)) Opportunity;
        }
        field(3; "Sub No."; Integer)
        {
            Caption = 'Sub No.';
            ToolTip = 'Specifies the number of the stage within the sales cycle.';
            TableRelation = if ("Table Name" = const("Sales Cycle Stage")) "Sales Cycle Stage".Stage where("Sales Cycle Code" = field("No."));
        }
        field(4; "Line No."; Integer)
        {
            Caption = 'Line No.';
        }
        field(5; Date; Date)
        {
            Caption = 'Date';
            ToolTip = 'Specifies the date the comment was created.';
        }
        field(6; "Code"; Code[10])
        {
            Caption = 'Code';
            ToolTip = 'Specifies the code for the comment.';
        }
        field(7; Comment; Text[80])
        {
            Caption = 'Comment';
            ToolTip = 'Specifies the comment itself.';
        }
        field(8; "Last Date Modified"; Date)
        {
            Caption = 'Last Date Modified';
            Editable = false;
        }
    }

    keys
    {
        key(Key1; "Table Name", "No.", "Sub No.", "Line No.")
        {
            Clustered = true;
        }
    }

    fieldgroups
    {
    }

    trigger OnModify()
    begin
        "Last Date Modified" := Today;
    end;

    procedure SetUpNewLine()
    var
        RlshpMgtCommentLine: Record "Rlshp. Mgt. Comment Line";
    begin
        RlshpMgtCommentLine.SetRange("Table Name", "Table Name");
        RlshpMgtCommentLine.SetRange("No.", "No.");
        RlshpMgtCommentLine.SetRange("Sub No.", "Sub No.");
        RlshpMgtCommentLine.SetRange(Date, WorkDate());
        if not RlshpMgtCommentLine.FindFirst() then
            Date := WorkDate();

        OnAfterSetUpNewLine(Rec, RlshpMgtCommentLine);
    end;

    [IntegrationEvent(false, false)]
    local procedure OnAfterSetUpNewLine(var RlshpMgtCommentLineRec: Record "Rlshp. Mgt. Comment Line"; var RlshpMgtCommentLineFilter: Record "Rlshp. Mgt. Comment Line")
    begin
    end;
}