cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic labels

Former Member
0 Kudos

Hi

I am working on VC 7.0 EHP1. SP 8.I have a requirement as follows:

There are two drop downs on my form view : Country and State.

On choosing the Country the drop down State gets filled with the associated states for that country.

My requirement is to change the label "State" for countries like Canada where there no states but "provinces".

So if a user chooses "Canada" from the Country drop down the label should read "Province" for the second drop down and not state.

Is that possible with current version of VC i am on?

Please help.

Thanks in advance

Regards

Shweta

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I would first find out condition, which explains whether country has states or not.

Based on that condition, I would set a flag in store (true/false).

then select the item on form in layout view. Go to configure. In the General section, there will be Label entry available.

there I would put formula.

eg.,

=if(store@state_flag==true then "STATE" else "PROVINCES".

Hope this helps you,

Regards,

Vinay.

Former Member
0 Kudos

Thanks Vinay but it did not help ... The user would select the country from the drop aown at run time so when he does that i should have an event where i can catch which country has he selected from the drop down,a one with the states or the one with the provinces ...Right now i tried using select element action in the drop down and stored value in the store at select action but it did not work ...any more pointers ....

Former Member
0 Kudos

Can you tell the logic in which another/states dropdown is getting filled with values? That would help.

As I am not quite aware of the logic for country has state or not, I can only give some inputs.

I would define action on dropdown

Right click on country dropdown in layout mode. Go to Action.

Add Action "Assign"

On right hand side,

From : (form_name)

Value : =( if(form_name@country_id)=='CANADA' then false else true)

To : Data Store

Target Field : states_flag

Now as soon as you put your dropdown, this action "ASSIGN" will set your status_flag in data store. Further, this flag value will change your title of another dropdown using formula in previous post.

Hope this helps you,

Regards,

Vinay

Former Member
0 Kudos

Hi Vinay

thanks for your prompt reply.so the other countries are india usa algeria etc.My drop down for country is bind with a RFC which brings all the countries maintained in the system.The drop down for state is again bind with RFC which takes the selected country as input.

I tried the steps you mentioned but it did not work.I assigned "Assign" action to my country drop down and gave the target as a flag variable in store.then in the display label for state i checked the condition for the flag.Also i dragged an event called "Assign" (which i created) from my form till the data store.

Former Member
0 Kudos

Thanks Vinay it finally worked with all the steps you mentioned .... in the vent selector to the data store i was creating an action "Assign" whereas i should have chosen the existing action assign.Awarding you full points for the same.Thanks a lot

Former Member
0 Kudos

Sorry Vinay i overlooked ... it worked because i assigned a default value formula to the variable in the store....

would appreciate if you vcan throw in some more pointers

Regards

Shweta

Answers (1)

Answers (1)

Former Member
0 Kudos

I overlooked and had assigned the value as defualt ... the suggested solution did not work

Former Member
0 Kudos

Hi,

Can you try same things with below change.

Right click on country dropdown in layout mode. Go to Action.

Add Action "Assign"

On right hand side,

From : Data Store

Value : =( if(form_name@country_id)=='CANADA' then false else true)

To : Data Store

Target Field : states_flag

Regards,

Vinay

Former Member
0 Kudos

Hi Vinay

I only get to see the target to and target field.I cant changethe from field

can i in any way insert the screen shot or send you that over the mail?

REgards

Shweta

Former Member
0 Kudos

Thanks Vinay it worked withthe last option you suggested.