Page 5112 Profile Question Details
- App
- Base Application
- Namespace
- Microsoft.CRM.Profiling
- Versions
- 17-28
- Source table
- 5088
Versions171819202122232425262728
Source29
Source in 29
src/Layers/W1/BaseApp/CRM/Profiling/ProfileQuestionDetails.Page.al276 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.Profiling;
page 5112 "Profile Question Details"
{
Caption = 'Profile Question Details';
DeleteAllowed = false;
InsertAllowed = false;
PageType = Card;
SourceTable = "Profile Questionnaire Line";
layout
{
area(content)
{
group(General)
{
Caption = 'General';
field(Description; Rec.Description)
{
ApplicationArea = All;
}
field("Multiple Answers"; Rec."Multiple Answers")
{
ApplicationArea = RelationshipMgmt;
}
}
group(Classification)
{
Caption = 'Classification';
field("Auto Contact Classification"; Rec."Auto Contact Classification")
{
ApplicationArea = RelationshipMgmt;
trigger OnValidate()
begin
AutoContactClassificationOnAft();
end;
}
field("Customer Class. Field"; Rec."Customer Class. Field")
{
ApplicationArea = RelationshipMgmt;
Editable = CustomerClassFieldEditable;
trigger OnValidate()
begin
CustomerClassFieldOnAfterValid();
end;
}
field("Vendor Class. Field"; Rec."Vendor Class. Field")
{
ApplicationArea = RelationshipMgmt;
Editable = VendorClassFieldEditable;
trigger OnValidate()
begin
VendorClassFieldOnAfterValidat();
end;
}
field("Contact Class. Field"; Rec."Contact Class. Field")
{
ApplicationArea = RelationshipMgmt;
Editable = ContactClassFieldEditable;
trigger OnValidate()
begin
ContactClassFieldOnAfterValida();
end;
}
field("Min. % Questions Answered"; Rec."Min. % Questions Answered")
{
ApplicationArea = RelationshipMgmt;
Editable = MinPctQuestionsAnsweredEditable;
HideValue = MinPctQuestionsAnsweredHideValue;
}
field("Starting Date Formula"; Rec."Starting Date Formula")
{
ApplicationArea = RelationshipMgmt;
Editable = StartingDateFormulaEditable;
}
field("Ending Date Formula"; Rec."Ending Date Formula")
{
ApplicationArea = RelationshipMgmt;
Editable = EndingDateFormulaEditable;
}
field("Classification Method"; Rec."Classification Method")
{
ApplicationArea = RelationshipMgmt;
Editable = ClassificationMethodEditable;
trigger OnValidate()
begin
ClassificationMethodOnAfterVal();
end;
}
field("Sorting Method"; Rec."Sorting Method")
{
ApplicationArea = RelationshipMgmt;
Editable = SortingMethodEditable;
}
field("No. of Decimals"; Rec."No. of Decimals")
{
ApplicationArea = RelationshipMgmt;
Editable = NoOfDecimalsEditable;
HideValue = NoOfDecimalsHideValue;
}
}
}
area(factboxes)
{
systempart(Control1900383207; Links)
{
ApplicationArea = RecordLinks;
Visible = false;
}
systempart(Control1905767507; Notes)
{
ApplicationArea = Notes;
Visible = false;
}
}
}
actions
{
area(processing)
{
action(AnswerValues)
{
ApplicationArea = RelationshipMgmt;
Caption = '&Answer Points';
Enabled = AnswerValuesEnable;
Image = Answers;
ToolTip = 'View or edit the number of points a questionnaire answer gives.';
trigger OnAction()
var
ProfileManagement: Codeunit ProfileManagement;
begin
ProfileManagement.ShowAnswerPoints(Rec);
end;
}
}
area(Promoted)
{
group(Category_Process)
{
Caption = 'Process';
actionref(AnswerValues_Promoted; AnswerValues)
{
}
}
}
}
trigger OnAfterGetRecord()
begin
MinPctQuestionsAnsweredHideValue := false;
NoOfDecimalsHideValue := false;
SetEditable();
NoofDecimalsOnFormat();
Min37QuestionsAnsweredOnFormat();
end;
trigger OnInit()
begin
AnswerValuesEnable := true;
SortingMethodEditable := true;
NoOfDecimalsEditable := true;
EndingDateFormulaEditable := true;
ClassificationMethodEditable := true;
StartingDateFormulaEditable := true;
MinPctQuestionsAnsweredEditable := true;
ContactClassFieldEditable := true;
VendorClassFieldEditable := true;
CustomerClassFieldEditable := true;
end;
trigger OnOpenPage()
begin
Rec.SetRange(Type, Rec.Type::Question);
end;
var
NoOfDecimalsHideValue: Boolean;
NoOfDecimalsEditable: Boolean;
MinPctQuestionsAnsweredHideValue: Boolean;
CustomerClassFieldEditable: Boolean;
VendorClassFieldEditable: Boolean;
ContactClassFieldEditable: Boolean;
MinPctQuestionsAnsweredEditable: Boolean;
StartingDateFormulaEditable: Boolean;
ClassificationMethodEditable: Boolean;
EndingDateFormulaEditable: Boolean;
SortingMethodEditable: Boolean;
AnswerValuesEnable: Boolean;
procedure SetEditable()
begin
CustomerClassFieldEditable :=
Rec."Auto Contact Classification" and (Rec."Vendor Class. Field" = Rec."Vendor Class. Field"::" ") and (Rec."Contact Class. Field" =
Rec."Contact Class. Field"::" ");
VendorClassFieldEditable :=
Rec."Auto Contact Classification" and (Rec."Customer Class. Field" = Rec."Customer Class. Field"::" ") and (Rec."Contact Class. Field" =
Rec."Contact Class. Field"::" ");
ContactClassFieldEditable :=
Rec."Auto Contact Classification" and (Rec."Customer Class. Field" = Rec."Customer Class. Field"::" ") and (Rec."Vendor Class. Field" =
Rec."Vendor Class. Field"::" ");
MinPctQuestionsAnsweredEditable := Rec."Contact Class. Field" = Rec."Contact Class. Field"::Rating;
StartingDateFormulaEditable :=
(Rec."Customer Class. Field" <> Rec."Customer Class. Field"::" ") or
(Rec."Vendor Class. Field" <> Rec."Vendor Class. Field"::" ") or
((Rec."Contact Class. Field" <> Rec."Contact Class. Field"::" ") and (Rec."Contact Class. Field" <> Rec."Contact Class. Field"::Rating));
EndingDateFormulaEditable := StartingDateFormulaEditable;
ClassificationMethodEditable :=
(Rec."Customer Class. Field" <> Rec."Customer Class. Field"::" ") or
(Rec."Vendor Class. Field" <> Rec."Vendor Class. Field"::" ") or
((Rec."Contact Class. Field" <> Rec."Contact Class. Field"::" ") and (Rec."Contact Class. Field" <> Rec."Contact Class. Field"::Rating));
SortingMethodEditable :=
(Rec."Classification Method" = Rec."Classification Method"::"Percentage of Value") or
(Rec."Classification Method" = Rec."Classification Method"
::"Percentage of Contacts");
NoOfDecimalsEditable := ClassificationMethodEditable;
AnswerValuesEnable := (Rec."Contact Class. Field" = Rec."Contact Class. Field"::Rating);
end;
local procedure AutoContactClassificationOnAft()
begin
SetEditable();
end;
local procedure CustomerClassFieldOnAfterValid()
begin
SetEditable();
end;
local procedure VendorClassFieldOnAfterValidat()
begin
SetEditable();
end;
local procedure ContactClassFieldOnAfterValida()
begin
SetEditable();
end;
local procedure ClassificationMethodOnAfterVal()
begin
SetEditable();
end;
local procedure NoofDecimalsOnFormat()
begin
if not NoOfDecimalsEditable then
NoOfDecimalsHideValue := true;
end;
local procedure Min37QuestionsAnsweredOnFormat()
begin
if Rec."Contact Class. Field" <> Rec."Contact Class. Field"::Rating then
MinPctQuestionsAnsweredHideValue := true;
end;
}