Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 335
  • Last Modified:

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!
0
emem
Asked:
emem
  • 5
  • 3
1 Solution
 
madheeswarCommented:
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." )))
0
 
ememAuthor Commented:
ok ill try this ....ur such a big help and the other experts as well ...get back to you soon....
0
 
ememAuthor Commented:
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?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
madheeswarCommented:
@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.
0
 
ememAuthor Commented:
ok ill try this thanks again
0
 
ememAuthor Commented:
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." ))))
0
 
ememAuthor Commented:
i have also notice that the first time it will work but the next time it will display the error msg ...
0
 
madheeswarCommented:
Thats why try step by step:
First create Button: test Date
in that :
FIELD dcol:=dcol;
res:=@Adjust(dcol;0;0;13;0;0;0);
@Prompt([OK];"Result";@text(res))

Like this debug the code line by line. U wil get the result. Try with different docs and different scenarios.

Hope it sheds some light.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now