AnsweredAssumed Answered

Script to Modify a Record Entry

Question asked by bunoire14 on Feb 5, 2016
Latest reply on Feb 5, 2016 by bunoire14

Hi,

 

Im brand new to FM and am working on a basic Image Library for my Department at work so that we can keep track of our Resources, search for them and email them to distributors easily.

 

I have setup a basic form layout which has three buttons, 1. Authorise Image, 2. Download, 3. Email.

 

The download button is fine it triggers a simple script that grabs the contents of the container this will be used by myself and my colleagues to grab images we need for projects.

 

However Im struggling getting my head round the syntax to create a script that updates a field on a record and commit it back to the DB. The image has a Image_Athorised field which is a number limited to 1. The idea is its a boolean "True/False" or "1/0" in my case (I couldn't figure out how to setup a boolean on the DB) This will be used to ensure the images we have in the DB have been authorised for use by the manufacturers of our products and have been checked by a manager in terms of Licence arrangements. So clicking "Authorise" will set the Image_Authorised Field to 1 and store that back to the DB and refresh the current record (I have some conditional formatting based on if a image is authorised or not).

 

My background is in PHP and if I were writing it in that I would check the value with a conditional and if the conditional confirmed the presence of a 0 it would update to 1 push back to the DB and refresh the users view.

 

Any pointers on achieving this on FM would be great.... or pointers if im taking a totally incorrect approach ot this.

 

Thanks,

Outcomes