How to get global option set values for dynamics crm with c#

This method maybe helping for you


public static List<GlobalOptionSetModel> GetGlobalOptionSetList(string globalOptionSetName, IOrganizationService service)

{

List<GlobalOptionSetModel> result = new List<GlobalOptionSetModel>();

RetrieveOptionSetRequest retrieveOptionSetRequest = new RetrieveOptionSetRequest { Name = globalOptionSetName };

RetrieveOptionSetResponse retrieveOptionSetResponse = (RetrieveOptionSetResponse)service.Execute(retrieveOptionSetRequest);

OptionSetMetadata optionSetMetadata = (OptionSetMetadata)retrieveOptionSetResponse.OptionSetMetadata;

List<OptionMetadata> optionList = optionSetMetadata.Options.ToList();

result = optionList.ConvertAll(z => new GlobalOptionSetModel { Label = z.Label.UserLocalizedLabel.Label, Value = z.Value.ToString(), LanguageCode = z.Label.UserLocalizedLabel.LanguageCode.ToString() });

return result;
}

public class GlobalOptionSetModel
{
public String LanguageCode { get; set; }
public String Value { get; set; }
public String Label { get; set; }
}

 

Advertisements

#csharp-global-option-set, #get-global-option-set-values, #ms-crm-global-option-set-values

Redirect to url after specific time with javascript

Try this


function RedirectUrl(url, interval) {

if (url!= null && url!= '') {

if (interval != undefined && interval != '') {
window.setTimeout(function () {
window.location.href = url;
}, interval);
} else {
window.location.href = url;
}

}

}

#interval, #javascript-url-redirect, #jquery, #settimeout, #url-redirect

How to include javascript file in html dynamically

Try this.


$.ajax({
url: 'library.js',
dataType: 'script',
async: false, //if you change this true, you may receive the error
success: function () {

}
});

#ajax, #dynamic-javascript, #dynamics-library