I want that If i select cashInflow ,3 Options in form of dropdown should come from a whole set of Enum should appear in another field and if i select outflow another 3 should Appear from same set.how can i achieve this.
field(2; "Level-01_Descrption"; Enum CashflowLevel1Description)
{
Editable = false;
trigger OnValidate()
var
OptionsVar: Enum CashflowLevel1Description;
begin
OptionsVar := "Level-01_Descrption";
case OptionsVar OF
OptionsVar::"Cash Inflow":
begin
"Level-02_Descrption":= "Level-02_Descrption":: ???????????????
end;
OptionsVar::"Cash Outflow":
begin
"Level-02_Descrption":= "Level-02_Descrption":: ????????????
end;
end;
end;
}
field(3; "Level-02_Code"; Enum CashFlowLevel2Code)
{
}
field(4; "Level-02_Descrption"; Enum CashflowLevel2Description)
{
}
Hi i dont think u r getting my question.I dont want to assign a value to reclevel2description i want to assign a set of options for user to select if cash inflow is in Reclevel1Description and vice versa for Cash Outflow.That is why i was talking about iterating enum.For ex: if u have state field and district field,and if u select punjab than different dropdown options shd come for district than if u select gujrat in state.
Yes, you can do if else condition on an OptionField..
As you said your enum is the same for both fields, so you can set a specific value for your enum based on the value selected in the first field..
if (Rec.Level_01_Descrption = Rec.Level_01_Descrption::"Cash Inflow") then begin
begin
Rec.Level_02_Descrption := Rec.Level_01_Descrption::"Field4_CashInflow";
end;
end
else
if (Rec.Level_01_Descrption = Rec.Level_01_Descrption::"Cash Outflow") then begin
Rec.Level_02_Descrption := Rec.Level_01_Descrption::"Field7_CashOutflow";
end;
However, I don't undertsand what you mean by "iterate the enum value from 0 to 5 if you select the cashInflow in your first field.. and 6,7 for cashOutflow..
Regards
No, I have same Enum for both , I was thinking about iterating the enum for value 0 to 5 in case of cash inflow and value 6 and 7 as dropdown in cashOutflow option case.Can we do If else Condition On OptionMembers
Can you tell me if the CashflowLevel1Description and CashflowLevel2Description enums both are the same or different.. also if you want to set the specific value for the field 'Level-02_Descrption' based on the value you select on your first field?
Here's how can you try it..
trigger OnValidate() var OptionsVar: Enum TestEnum; Level: Enum TestEnum2; begin case Level_01_Descrption OF Level_01_Descrption::"Cash Inflow": begin Level_02_Descrption := Level_02_Descrption::"Level_02_Descrption_CashInflow"; end; Level_01_Descrption::"Cash Outflow": begin Level_02_Descrption := Level_02_Descrption::"Level_02_Descrption_CashOutflow"; end; end; end;
Hope it helps you
Regards
Hi Pragya752,
If I understand correctly, you want to set different enums in other fields based on the option selected in your first field. For example, if 'cashinflow' is selected in your first enum field, then you want to set a specific enum with three options in your second field. If 'cashoutflow' is selected, then another set of three option fields should be set in the second field. If this is the case, then your code is not correct and I also recommend you do it on the page level and using a variable as the field on the page.. and set the value on the variable based on the validation field in your code..
Please let me know if you need any help..
Regards
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,232 Super User 2024 Season 2
Martin Dráb 230,064 Most Valuable Professional
nmaenpaa 101,156