Solved

How to define conditional parameters with a combobox that use attribute data containing a date to give predefined date ranges

  • 29 October 2021
  • 7 replies
  • 406 views

Userlevel 4
Badge

I have a GI that I am building that will allow me to show all sales orders our Powdercoating warehouse team need to work on.

Many of our sales orders come with a lead time that is quite far in the future (eg, the material is not needed until the end of the month) but others need to be shipped urgently. We use the “Requested On Date” (renamed in my GI to “PC DUE DATE” to measure DIFOT, and I have added a “PC Scheduled Date” attribute that I have connected to the Sales Order UDF so that production planners can put a date that they want the team to prepare this order. I want to be able to have a combo box at the top of my GI that says “Painting Today” or something like this, but  cannot seem to make it work. 

 

so for example, the production planner would select “Painting Today” (A) and if the Schedule Date (B) was in the same day as today, then only these records would show. 

 

 

icon

Best answer by Naveen Boga 29 October 2021, 21:32

View original

7 replies

Userlevel 7
Badge +17

Hi @DanielStarke  Can you please review my understanding and confirm?

Simply, when we select the “Painting Today” on the top then we need to look into the “schedule Date” and populate the records, which are equal to today’s date right?

if yes, can you please share the XML format of GI here

Userlevel 4
Badge

Yes perfect @Naveen B .

 

basically in the physical workflow there are two teams, pickers and painters. the pickers are always preparing the material for the painters to work on tomorrow. so we just need “Painting Today” and “Painting Tomorrow” as drop downs and the teams can the focus on what they need to work on

Userlevel 7
Badge +17

Hi @DanielStarke  I just worked on it and working for me.

Please add the below condition so that records will be populated based on the selection criteria on the top.

Here is the formula

=IIF([TimeDuration] = 'P1', Today(), IIF([TimeDuration] = 'P2', DateAdd( Today(), 'd', 1), IIF([TimeDuration] = 'W1', DateAdd( Today(), 'd', 7), DateAdd( Today(), 'd', 14) )))

 

 

Userlevel 4
Badge

excellent @Naveen B - works perfect other than the part for next week and this week - i wondered if these should be a range somehow? also it would be nice if it showed all until a selection was made in the combo box. would the switch function be better than nested iffs?

 

=Switch( [TimeDuration] = 'P1', DateAdd( Today(), 'd', 0.5), [TimeDuration] = 'P2', DateAdd( Today(), 'd', 1.5), [TimeDuration] = 'W1', DateAdd( Today(), 'd', 7.5), DateAdd( Today(), 'd', 14.5) , '*') 

Userlevel 4
Badge

i tried to add a wildcard as the closing else but the syntax must not be right

Userlevel 4
Badge

@Naveen B , my subsequent question is linked to this as in I wondered if it would be simpler to have a number of days since the schedule date and then filter against that value for the ranges, rather than use combo box parameters

Userlevel 7
Badge +17

Hi @DanielStarke  Yeah, switch case is also very simple and here is sample for your reference.

 


Switch( [TimeDuration] = 'P1', DateAdd( Today(), 'd', 0.5), [TimeDuration] = 'P2', DateAdd( Today(), 'd', 1.5), [TimeDuration] = 'W1', DateAdd( Today(), 'd', 7.5), [TimeDuration] = 'W2', DateAdd( Today(), 'd', 14.5)) 
 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved