function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Venkat Reddy 6Venkat Reddy 6 

Multi Select PickList in Javascript Button

Hi All,
I've a requirement, where i need to have the value persisting in the Multiselect picklist value. To be clear with the message, i would like to check if the Value in the multi picklist is BLANK or Not.

Here is the sample code, i've been trying in trial sandbox.

var a = new sforce.SObject("Account");
a.Id = '{!Account.Id}';
var b = '';
b = '{!Account.Multi_Test__c}';
alert('dddddd --> '+b);
if(b!= null || b!= '' )
alert('multi select is not empty');
a.status__c = 'Closed';
result = sforce.connection.update([a]);
  alert('multi select is empty');

Where, Multi_Test__c is a multi select picklist field with some values say..a,b,c,d,.. and Status__c is a picklist field with lovs Open,closed, in-progress. both these fields are on account
I alert returns"multi select is not empty", and i never the alert "multi select is empty".

Thanks in Advance

William TranWilliam Tran
Why don't you add the multilist in your alert to see what value is display, that way you can easily debug and find the issue.



 alert('multi select is not empty: '+b);

 alert('multi select is empty: '+b);