Insert Current Date

ApolloC

I am trying to insert the current date in $[$10.0.0] on form 141 (A/P Invoice).  I am using the SetValue function.  I was hoping to use an alpha character, which SAP updates with the current date once leaving the field in hopes that would work.  Instead, I get an error with a message to check the log for more info.  This is from the log.



<description>Error in EasyFunction rule: "FCFInsertCurrentDate"
System.Runtime.InteropServices.COMException (0xFFFFFC13): Invalid date value [131-183]
at COR_Utility.Logic.EasyFunction.Commands.CommandBase.HandleException(Exception ex)
at COR_Utility.Logic.EasyFunction.Commands.SetValue.Execute()
at COR_Utility.Logic.EasyFunction.EasyFunctionCondition.Execute(CustomizeEvent pVal)
at COR_Utility.Logic.EasyFunction.EasyFunctionRule.Execute(CustomizeEvent pVal)
at COR_Utility.Logic.EasyFunction.EasyFunctionExecutor.ExecuteRule(EasyFunctionRule rule, CustomizeEvent pVal)</description>

I then tried changing from the alpha character to typing in a date just to confirm the rule works and the issue was the value being set.  That failed with the same message.  I tried many different date formats with the same result.  Not sure what to try next.  Thanks in advance for the help.


Anders Olsson

Hello,


 


The SAP UI wants a date in ISO format (yyyyMMdd).


 


You can use this EasyFunction code to set the current date:


 


SQLQuery("today|SELECT CONVERT(varchar(10),GETDATE(),112)")

SetData("$[$10.0.0]|today")

 

Regards,

Anders

ApolloC

That works perfectly; however, I cannot find an event type that will populate the cell when the form opens (formload and formloadcompleted does not work).  I tested the command with the "click" event type, but I want it populated when the user opens the window.  Thank you.


ApolloC

Figured it out.  New it had to be something in the optimizer rule.  I had ItemUID filled in witht he target location.  I emptied that field and that did the trick along with FormLoadCompleted.  Thanks again for the command Anders.


0

Comments

0 comments

Please sign in to leave a comment.

Didn't find what you were looking for?

New post