I have this script in sales order that filters the types of campaigns a user can choose depending on the customer_group of the customer, the date validity of the campaign, and the campaign approval status. It currently looks like this:
cur_frm.fields_dict.tma_campaign.get_query = function(doc) {
return {
filters: [
['Campaign', 'proposal_status', 'in', 'Approved'],
['Campaign', 'customer', 'in', doc.customer_group],
['Campaign', 'start_date', '<=', get_today()],
['Campaign', 'end_date', '>=' , get_today()]
]
}
}
I'd like to be able to add an OR type filter that lets me include another field that is normally mutually exclusive with the 'customer' field (bold line above); something like
['Campaign', 'national_campaign', '=', '1'],
The problem is that 'national_campaign' and 'customer' are mutually exclusive, i.e. if a campaign is 'national_campaign' = 1, then the 'customer' field would be null.