hi
i have option set field value is A,B,C,D . if i select a D value it show single line text box on left and type any text in single line box it come on option set field and other value a,b,c,d will hide
how could i do it it is possible or not
*This post is locked for comments
As mentioned in thread,
Add textbox value to existing option set's metadata using metadata service call using js code like below:
// Create a request.
InsertOptionValueRequest insertOptionValueRequest =
new InsertOptionValueRequest {
AttributeLogicalName = "new_picklist",
EntityLogicalName = Contact.EntityLogicalName,
Label = new Label("New Picklist Label", _languageCode)
};
// Execute the request.
int insertOptionValue = ((InsertOptionValueResponse)_serviceProxy.Execute(
insertOptionValueRequest)).NewOptionValue;
Refer: msdn.microsoft.com/.../gg509035.aspx
Then Write a SOAP call, You can convert above code to client side using SOAP logger available in SDK
nishantrana.me/.../updated-soaplogger-for-crm-2013-to-generate-javascript
Thanks,
Anand
Hi, Please refer the threads for code.
community.dynamics.com/.../168756
msdn.microsoft.com/.../gg509035.aspx
Thanks,
Anand
Hi,
What exactly you want to achieve. could you specify all in one time?
type*
thanks but i want to do that if i select d in optionset field converted text formate / opne text form
in that type any thing that save on option set field
Hi,
You can refer below code.
below v9.0
function shohidefield() { var optionsetvalue=Xrm.Page.getAttribute("providefieldSchemaNamehere").getValue(); if(optionsetvalue=="value here) { Xrm.Page.getControl('fieldname').setVisible(bool); // true = show ; false = hide } else { Xrm.Page.getControl('fieldname').setVisible(bool);// true = show ; false = hide } }
above 9.0
function showhidefield(executioncontext) { var formContext = executionContext.getFormContext(); var optionsetvalue=formContext.getAttribute("providefieldSchemaNamehere").getValue(); if(optionsetvalue=="value here) { formContext.getControl('fieldname').setVisible(bool); // Specify true to show the control; false to hide the control. } else { formContext.getControl('fieldname').setVisible(bool);// Specify true to show the control; false to hide the control. } }
thanks for replya can u plz suggest code
Hi himy,
If you want to show or hide fields based on the option value, you could use Business Rules.
For exaxple:
When I set "option height"(an option set field)= "C", then "Stage Name"(a single line text box) displays.
About your requirement "hiding a,b,c,d values", do you mean you want to set the value of single text box to the option set field and remove all other fields(including "D")? Why don't you use the value of text box directly? Values cannot be assigned between different types of fields with OOB functions.
If you must do this, you could use code to add the value of text box to the option set and then set it to be selected.
In addition, could you kindly share more information about the complete requirement?
Hope it helps.
Best Regards,
Leo
Hi,
you can easily achieve this with business rule. Refer below blog.
heidster12.wordpress.com/.../showhide-fields-with-business-rules
Hi There,
Please use business rule to achieve any hide/show based on value on a form.
docs.microsoft.com/.../create-business-rules-recommendations-apply-logic-form
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,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156