The CreatorCon Call for Content is officially open! Get started here.

Background Script or not

amacqueen
Mega Guru

I have seen several comments about not running background scripts in a production environment.

With that in mind can anyone give me a sample script to run that would parse an email address and from the results update a field in sys_user called country.

Example, say I have an email address joe@de.domain.com I need to extract the de, capitalise it and then populate the country field with that information.

Thanks

1 ACCEPTED SOLUTION

Allright reason is, since you are running the script on all the records, which also contains email with null value so the script fails after reaching it.



So in the gliderecord query you can include the line..



usr.addEncodedQuery('email!=NULL^emailLIKE@');


View solution in original post

12 REPLIES 12

Thanks Shariq with both of those it seemed to take me a bit further, now I'm getting the following:-



Allright reason is, since you are running the script on all the records, which also contains email with null value so the script fails after reaching it.



So in the gliderecord query you can include the line..



usr.addEncodedQuery('email!=NULL^emailLIKE@');


Great stuff Sharique - much appreciated.



Thanks also to ctomasi and souren007 for their input.