Link to home
Start Free TrialLog in
Avatar of emem
emem

asked on

using the @Adjust command

Hi! experts
I have a view named amla with the ff: columns

date of report value is dcol
status value is stat
branch value is branch

I also have an action button to send the data or record to Head Office.  The action button have the formula below:

FIELD Flag := Flag;
FIELD by := by;
@If(@Today >= @Adjust(dcol; 0; 0; 13; 0; 0; 0);@Failure( "The check date must be between 3 days from date received and not dated one year from date received." ); Flag = "No" & by != "";
@Do(@Prompt([OK];"@mailsend dapat dito");
@SetField("Flag"; "Yes");@Prompt([OK];"AMLA";"CSV File Sent"));Flag = "Yes"; @Prompt([OK];"AMLA";"CSV File Already Sent");@Prompt([OK];"Error";"Double click the newly created document and enter Reported by field." ))

What I want is that before sending it will check the dcol field versus the date today, if it is more than 13 days ..it will not send the record and prompt the user that the data is more than 13 days ....need help thanks guys!
Avatar of madheeswar
madheeswar
Flag of Singapore image

Try this:

FIELD Flag := Flag;
FIELD by := by;
FIELD dcol:=dcol;
@If(@Today >= @Adjust(dcol; 0; 0; 13; 0; 0; 0);@Return(@Prompt([OK];"cannot send"; "The check date must be between 13 days from date received and not dated one year from date received." )); @If(Flag = "No" & by != "";
@Do(@Prompt([OK];"@mailsend dapat dito");
@SetField("Flag"; "Yes");@Prompt([OK];"AMLA";"CSV File Sent"));Flag = "Yes"; @Prompt([OK];"AMLA";"CSV File Already Sent");@Prompt([OK];"Error";"Double click the newly created document and enter Reported by field." )))
Avatar of emem
emem

ASKER

ok ill try this ....ur such a big help and the other experts as well ...get back to you soon....
Avatar of emem

ASKER

madheeswar got this error "Incorrect data type for operatoror @ function: Time/Date expected"....dcol is in date format how come? if not in date format how can i convert text to date is there a way?
@TextToTime(dcol)

or use:
@textToTime(@text(dcol))

this may happen in @Adjust function and replace dcol with the above where ever necesary. Do it one after another.
Avatar of emem

ASKER

ok ill try this thanks again
Avatar of emem

ASKER

madheeswar.....i still encountered the error "Incorrect data type for operatoror @ function: Time/Date expected" how come?

FIELD Flag := Flag;
FIELD by := by;
FIELD dcol :=@texttotime(dcol);
@If(@Today >= @Adjust(dcol; 0; 0; 13; 0; 0; 0) & @Today >=@Adjust(dcol; 0; 0; 1; 0; 0; 0);@Return(@Prompt([OK];"Cannot send"; "Cannot Send CSV Files more than 10 days from Date of Report.  Manually Send your files to Compliance Office" )); "";@Today < @Adjust(dcol; 0; 0; 13; 0; 0; 0) & @Today >@Adjust(dcol; 0; 0; 1; 0; 0; 0);@Prompt([OK];"Sent"; "Sent CSV Files to late archive" ;
@If(Flag = "No" & by != "";
@Do(@Prompt([OK];"@mailsend dapat dito");
@SetField("Flag"; "Yes");@Prompt([OK];"AMLA";"CSV File Sent"));Flag = "Yes"; @Prompt([OK];"AMLA";"CSV File Already Sent");@Prompt([OK];"Error";"Double click the newly created document and enter Reported by field." ))))
Avatar of emem

ASKER

i have also notice that the first time it will work but the next time it will display the error msg ...
ASKER CERTIFIED SOLUTION
Avatar of madheeswar
madheeswar
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial