Page 1 of 1

aXes Mobile - How to add a button to use the Camera feature

Posted: 08 Aug 2014, 15:10
by jeanmichel
How to add a button to a project to use the mobile device's Camera feature

1) Open aXes development environment

Image

2) Load your project in TS2 and navigate to the screen you wish to customise

Click on "Work as a TS2 Developer"

Image

Signon to your session

Image

Type on the command line: "addlible axesdemo" followed by enter

Image

Type on the command line: "call xhrrpgtrn" followed by enter

Image

Put an X next to to an employee

Image

If you don't have a screen definition, press suggest and save the screen.

Image

3) Add a PushButton

Image

4) Edit caption. Change the caption value to "Take Photo"

Image

5) Edit script

Image

Copy and paste the script hereunder in the edit box.
Please note you will need to amend the URL of your server as well as the username and the password required to connect.

Code: Select all

if (window.LRSV)
{
var config =
   {
   serverUrl: "http://server.domain.local/service/longreach.jsp",
   credential: {user:"myusername",password:"mypassword}
   };
LONGRANGE.FileTransfer.setDefaultConfig(config);

var options =
   {
   imageName : FIELDS("EmpID").getValue() + ".jpg",
   annotate : true,
   toIFSfolder : "{BASE}/"
   };

try 
   {
   LRSV.imageUpload(options);
   }
catch (Error) { alert("problem uploading photo"); }
}
6) You should now have a button on your screen which looks like this:

Image

7) open aXes mobile and run your demonstration

Image Image Image