Dear All,
am new to BC and learning from Scratch. i requested all of your support and Help on this always
My Target Req is, Creating 4 Custom Fields and Once User enter the Data then it will ask for the Verification. once user confirm ''yes'' it should be disable particular field for all the user Except one user. (That User can do the changes if Required)
Now the Issue is,
1st : user will not entering the data altogether , it gets disabling
2nd is : if User enter the last field then also it disable all the fields
Should disable only the particular field only if user enters the value and once they confirms
Kindly request all your help to fix the issue
addafter("Project Manager")
{
field("Previous Year Cost"; Rec."Previous Year Cost")
{
ApplicationArea = all;
Editable = IsEditable;
Caption = 'Previous Year Cost';
trigger OnValidate()
var
myInt: Integer;
Confirm: Label 'You have added a Prev Yr Cost Amount %1 for the Job %2. It should not be editable once confirmed';
begin
If Rec."Previous Year Cost" <> 0.00 then begin
If not (UserId = 'ANUSUYA') then begin
If Dialog.Confirm(StrSubstNo(Confirm, Rec."Previous Year Cost", Rec."No."), false) then begin
CheckEditable();
CurrPage.Update();
end else
Rec."Previous Year Cost" := 0.00;
end;
end;
end;
}
}
addafter("Previous Year Cost")
{
field("Previous Year Invoice"; Rec."Previous Year Invoice")
{
ApplicationArea = all;
Editable = IsEditable;
Caption = 'Previous Year Invoice';
trigger OnValidate()
var
myInt: Integer;
Confirm: Label 'You have added a Prev Yr Inv Amount %1 for the Job %2. It should not be editable once confirmed';
begin
If Rec."Previous Year Invoice" <> 0.00 then begin
If not (UserId = 'ANUSUYA') then begin
If Dialog.Confirm(StrSubstNo(Confirm, Rec."Previous Year Invoice", Rec."No."), false) then begin
CheckEditable();
CurrPage.Update();
end else
Rec."Previous Year Invoice" := 0.00;
end;
end;
end;
}
}
addafter("Previous Year Invoice")
{
field("Project Cost"; Rec."Project Cost")
{
ApplicationArea = all;
Editable = IsEditable;
Caption = 'Project Revenue';
trigger OnValidate()
var
myInt: Integer;
Confirm: Label 'You have added a Cost Amount %1 for the Job %2. It should not be editable once confirmed';
begin
If Rec."Project Cost" <> 0.00 then begin
If not (UserId = 'ANUSUYA') then begin
If Dialog.Confirm(StrSubstNo(Confirm, Rec."Project Cost", Rec."No."), false) then begin
CheckEditable();
CurrPage.Update();
end else
Rec."Project Cost" := 0.00;
end;
end;
end;
}
}
addafter("Project Cost")
{
field("Project Expense"; Rec."Project Expense")
{
ApplicationArea = all;
Editable = IsEditable;
trigger OnValidate()
var
myInt: Integer;
Confirm: Label 'You have added a Expense Amount %1 for the Job %2. It should not be editable once confirmed';
begin
If Rec."Project Expense" <> 0.00 then begin
If not (UserId = 'ANUSUYA') then begin
If Dialog.Confirm(StrSubstNo(Confirm, Rec."Project Expense", Rec."No."), false) then begin
CheckEditable();
CurrPage.Update();
end else
Rec."Project Expense" := 0.00;
end;
end;
end;
}
}
}
var
[InDataset]
IsEditable: Boolean;
local procedure CheckEditable()
var
UserRec: Record "User Group Member";
begin
If Rec."Previous Year Cost" <> 0 then begin
If UserId = 'ANUSUYA' then
IsEditable := true
else
IsEditable := false;
end else
IsEditable := true;
If Rec."Previous Year Invoice" <> 0 then begin
If UserId = 'ANUSUYA' then
IsEditable := true
else
IsEditable := false;
end else
IsEditable := true;
If Rec."Project Cost" <> 0 then begin
If UserId = 'ANUSUYA' then
IsEditable := true
else
IsEditable := false;
end else
IsEditable := true;
If Rec."Project Expense" <> 0 then begin
If UserId = 'ANUSUYA' then
IsEditable := true
else
IsEditable := false;
end else
IsEditable := true;
end;
trigger OnAfterGetCurrRecord()
var
myInt: Integer;
begin
CheckEditable();
end;
trigger OnOpenPage()
var
myInt: Integer;
begin
CheckEditable();
end;
trigger OnAfterGetRecord()
var
myInt: Integer;
begin
CheckEditable();
end;