Step 1: Create an Items as follows,
Source Item: P2_PARTY_TYPE
Type: Radio Group
List of Values: Person - P; Organization - O; Agent - A; Vendor: V
Affected Item: P2_PARTY (Don't give label name. Let it be blank)
Step 2: Create dynamic action as follows,
Event = Change
Selection Type = Item(s)
Item(s) = P2_PARTY_TYPE
Condition = (No Condition)
True Action = Execute JavaScript Code
Fire On Page Load = Yes
Selection Type = (Blank)
Code = (please copy and paste below JavaScript code)
JavaScript Code:
if ($v("P2_PARTY_TYPE")=='P') {
$("label[for=P2_PARTY]").text("First Name")
} else if ($v("P2_PARTY_TYPE")=='O') {
$("label[for=P2_PARTY]").text("Organization")
}
else if ($v("P2_PARTY_TYPE")=='A') {
$("label[for=P2_PARTY]").text("Agent")
}
else if ($v("P2_PARTY_TYPE")=='V') {
$("label[for=P2_PARTY]").text("Vendor")
}
This code will change the label text of an item based on condition.
The demo is here
That's it. Happy APEXing!!!...
Nice one , thanks.
ReplyDeleteThanks Sameer
DeleteThank You! Megan Collins
ReplyDeleteVery usefull, thanks!
ReplyDelete