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
Is there a way to update the customes date field condtionally based
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.
Hi
We have accomplished similar by using a Generic Inquiry in combination with an Import Scenario and a Business Event.
- Create the generic inquiry and make it visible on the UI. This assigns it a screen name.
- Select the GI as data source for a new “Data Provider”.
![](https://uploads-us-west-2.insided.com/acumatica-en/attachment/bc6b380e-c27b-45f9-9e43-1fa5e533de2e.png)
- Create an import scenario to update the screen using the Data Provider you created in step #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
Hi
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.
![](https://uploads-us-west-2.insided.com/acumatica-en/attachment/2dd09944-ac9f-4673-af4e-6f218fcd9c1b.png)
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.
Hi
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
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.