Solved

Is there a way to update the customes date field condtionally based

  • 4 April 2022
  • 5 replies
  • 209 views

I have two different dates in different screens Ex(stock item and Branch) and i would like to update the minimum value of the stock item date and Branch date into a different screen. Can it be done via generic inquiry and Business events. thank you in advance

icon

Best answer by lauraj46 11 April 2022, 21:30

View original

5 replies

Badge +11

I’m not sure I understand your question. Would you be able to take some screenshots and give a little more detail about how and when this would ideally take place?

 

In answer to the idea of using a Generic Inquiry, GI’s don’t usually update records, but rather display information. The exception to this is using the Mass Field Update or Mass Actions feature. Perhaps that’s what you had in mind.

Userlevel 7
Badge +7

Hi @dilipnukala3,

We have accomplished similar by using a Generic Inquiry in combination with an Import Scenario and a Business Event.   

  1. Create the generic inquiry and make it visible on the UI.  This assigns it a screen name.  
  1. Select the GI as data source for a new “Data Provider”.
  1. Create an import scenario to update the screen using the Data Provider you created in step #2
  2. Create a business event which is triggered by a record change.  The screen name will be the GI created in step #1 above.  On the subscriber tab, select the import scenario that you created in step #3.

Once you piece it all together correctly we have had good success with this methodology.

Hope this helps!

Laura

 

 

Userlevel 7
Badge +7

Hi @dilipnukala3 ,

Correction - for step #2 above you need to create a Data Provider of the type Business Process Provider, otherwise it won’t be available to select on the subscriber tab in step #4.

Hope this helps!

Laura

Thanks for your support. I have tried the same but the data change isn’t Happening. I want to get the maximum of two date values and update it. I have described the field in the Import Scenario. 

All the launch dates are in dateteime format.

 

Maxmimum value of Branchaccount_usrLaunchDate or Itemreplenishment_launchDate

=IIf((DateDiff( 'd', [ItemWarehouse_launchDate], [Branchaccount_usrLaunchDate] )<0),[Branchaccount_usrLaunchDate],[Itemreplenishment_launchDate])

or 

=IIf([ItemWarehouse_launchDate]<[Branchaccount_usrLaunchDate] , [Branchaccount_usrLaunchDate], [Itemreplenishment_launchDate])

or 

=Max(CInt([ItemWarehouse_launchDate]) ,CInt([Branchaccount_usrLaunchDate])). This shouldnot be working as the date to int conversion. 

 

Userlevel 7
Badge +7

Hi @dilipnukala3,

When you “Import” the data on the “Import By Scenario” screen you should be able to confirm if your formula is working correctly.  I believe that either of your first two syntaxes should work, but that is assuming that the user defined field is of the appropriate data type and that it always contains data.  If one or the other field could be null then you might need to account for that in the formula.  You can use the IsNull function to check for that condition, something like this:

=IIf(IsNull([ItemWarehouse_launchDate], ‘1/1/1900’)<IsNull([Branchaccount_usrLaunchDate], ‘1/1/1900’) , [Branchaccount_usrLaunchDate], [Itemreplenishment_launchDate])

If both dates are null this formula will return the date ‘1/1/1900’.

Also, instead of embedding this logic in the Import Scenario, you could consider moving it to the the Generic Inquiry for the Data Provider.  It might be a little bit easier to debug there. Once you have the formula working correctly in the GI, you can just choose the calculated field to update from in the Import Scenario.

Hope this helps!

Laura

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