Not being a Perl guy (though I have changed the Perl c for new ARS releases on occasion but done only a few very minor tweaks to actual Perl code) When you make an assignment to a field, Perl has to create a "FieldValue" on your behalf. Again, I do not know what you need to do to do this in Perl. When you make a "FieldValue", you do NOT have to match the field type you are assigning. So, for example, you could assign the FieldValue "Keyword", -2 to a date/time field. The list of values is given in ar.h AR_KEYWORD_ #define AR_KEYWORD_TIMESTAMP 2 /* current date/time */
This should go to the server untouched and so you will get the server time. Caution: I would have expected the integer to be negative but the .h does not indicate so. You'd have to experiment to determine to use the + or - I would hope that Perl offered a way to do this but I really don't won't check that c code again and I personally don't use Perl unless I have to for some reason. I see it seems to accept strings in the assignment but then by using a keyword as the string it could be done. Meta-Update does allow this but it is implied by simply assigning the keyword. The Meta-Update script doesn't expose the internals of the API and effects conversion to the right types as needed. Cheers Ben Chernys Senior Software Architect Software Tool House Inc. Canada / Deutschland / Germany Mobile: +49 171 380 2329 GMT + 1 + [ DST ] Email: <mailto:ben.cher...@softwaretoolhouse.com> Ben.Chernys _AT_ softwaretoolhouse.com Web: <http://www.softwaretoolhouse.com/> www.softwaretoolhouse.com Check out Software Tool House's free Diary Editor. Meta-Update, our premium ARS Data tool, lets you automate your imports, migrations, in no time at all, without programming, without staging forms, without merge workflow. <http://www.softwaretoolhouse.com/> <http://www.softwaretoolhouse.com/> http://www.softwaretoolhouse.com/ _____ From: Action Request System discussion list(ARSList) [mailto:arsl...@arslist.org] On Behalf Of Frank Caruso Sent: June 11, 2010 3:02 PM To: arslist@ARSLIST.ORG Subject: Re: Using Remedy Keyword Constants with ARSPerl Module ars_MergeEntry API ** Have you tried: $ar_result = ars_MergeEntry($connection,$ store_schema,4, $fldid_store_id,$store_id, $fldid_latitude,$latitude, $fldid_longitude,$longitude, $fldid_geocode_update_date,"\$TIMESTAMP\$", $fldid_modified_date,"\$SERVERTIMESTAMP\$ I do not have ARS Perl available right now to test it. On Thu, Jun 10, 2010 at 1:57 PM, Thilo Stapff <thilo.sta...@apprologic.de> wrote: Hi, there are several possibilities to achieve this: - the most reliable method might be to not handle it in your perl script altogether, but instead create a filter on "Merge" that sets the fields to TIMESTAMP/SERVERTIMESTAMP. - You might use perl's "time" built-in function: $fldid_geocode_update_date, time(), $fldid_modified_date, time(), Of course this would only give you the current client time. I don't know how important it for you to have the exact server timestamp; in this case you could determine the server time by my %info = ars_GetServerInfo( $ctrl, &ARS::AR_SERVER_INFO_SERVER_TIME ); die "ars_GetServerInfo(): $ars_errstr" if $ars_errstr; my $tdiff = $info{SERVER_TIME} - time(); and then compute the server time by adding a correction term: $fldid_geocode_update_date, time()+$tdiff, $fldid_modified_date, time()+$tdiff, Regards, Thilo Stapff On 10.06.2010 18:44, Anderson Debra (PRN) wrote: ** Hi, I am new to using Remedy Perl ARSPerl Module and am trying to figure out how to pass in values equivalent to $TIMESTAMP$ or $SERVERTIMESTAMP$ keywords to a merge function. Here is a snippet of my code but the constants do not evaluate and I end up with invalid date values in the merged (updated) record. $ar_result = ars_MergeEntry($connection,$store_schema,4, $fldid_store_id,$store_id, $fldid_latitude,$latitude, $fldid_longitude,$longitude, $fldid_geocode_update_date,AR_KEYWORD_SERVERTIMESTAMP, $fldid_modified_date,AR_KEYWORD_SERVERTIMESTAMP, $fldid_modified_by, $modified_by); Any suggestions? Thanks Debra -- -- -- -- -- -- -- -- -- -- Debra Anderson 415 808 9118 direct | 600 Harrison St., 4th Floor, San Francisco CA 94107 Tomorrow's Network for Today's Shopper _http://www.prn.com _ P *Think Green-* please do not print this email unless necessary This e-mail (including any attachments) is meant for only the intended recipient of the transmission, and may include confidential information. If you are not the intended recipient or you received this e-mail in error, any review, use, dissemination, distribution, or copying of this e-mail is strictly prohibited. If you have received this message in error, please notify the sender immediately by telephone at (415) 808-3500 or by return e-mail and delete this e-mail, along with any attachments and copies, from your system. Thank you. _attend WWRUG10 www.wwrug.com ARSlist: "Where the Answers Are"_ ____________________________________________________________________________ ___ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org attend wwrug10 www.wwrug.com ARSlist: "Where the Answers Are" _attend WWRUG10 www.wwrug.com ARSlist: "Where the Answers Are"_ _______________________________________________________________________________ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org attend wwrug10 www.wwrug.com ARSlist: "Where the Answers Are"