Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5078 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hello, I am new in writing Script within FileMaker Pro. Over the last two years I have been writing applescripts modules to performs specific functions. I want to have a more structure and robust environment. I am then moving into FileMaker Pro.

I am attaching down below an applescript program I want to recode in FileMaker Pro. However, I do not know about the FileMaker Pro scripting syntax I should be using.

The idea, is that the operator is writing code order information into a specific line (Line1, Line2, Line3 and Line4). Each code is 4 characters long and is separated by a blank. For each of the code I want a record to be added in a FileMaker Pro table called ClientOrder. For example, if the operator enter the following :

Invoice #001

Line1: 0121 1204 3305 3601

The table "ClienOrder" will then have the following record (Invoice#, Code#):

001 0121

001 1204

001 3305

001 3601

Does anyone know of any reference material I could refer to in order to perform the required task?

Best regards!

Daniel

I've created in FileMaker Pro a layout model where the user sees three entry lines. I would like each line to be validated after the user entered for a line the code information and click on the tab or enter key.

Posted

The idea, is that the operator is writing code order information into a specific line (Line1, Line2, Line3 and Line4).

What makes this a good idea? What - if any - is the difference between the 4 lines?

Posted

Most of the time I will only be using Line1.

Line2,3 and 4 is there for exceptional situations. As you can see in the attached code the operator could be entering up to 10 code.

Entering code separated by spaces is what the operating staff is used to do. Clicking the return button would be equal to a "commit" statement. Validation of the entry would then be required and the "ClientOrder" would then be filled.

In the meantime, Comment your question made realized a number could be entered and already exist in the "ClientOrder" table. This would be allowed and a warning message should be displayed.

For example a message like could be displayed: Please note, the number "0301" as previously been entered in the database. Is this correct?

Thanks!

Danil

Posted

Entering code separated by spaces is what the staff is used to do.

Perhaps they should get used to something more conventional - like entering the codes directly into a portal, pressing tab to separate the entries. Your current method has many potential pitfalls - basically, you are putting your needles into 4 haystacks and now you have to find them (and verify they are needles to boot). It doesn't fit with your earlier statement:

I want to have a more structure and robust environment.

Anyway, if you must - start by setting a variable to =

Substitute ( TrimAll ( Line1 & " " & Line2 & " " & Line3 & " " & Line4 ; 0 ; 0 ) ; " " ; ¶ )

This will produce a return-separated list of the entered codes. Filemaker has several functions for handling return-separated lists. You can use these to loop over the list and create a record for each.

Posted

Thanks Comment for your help!

Is there a reference manual you could recommend for me to use. As you can see in the actual case I need to parse one record into multiple records in a filemaker pro database table called ClientOrder.

To ensure every IS OK before starting to parse, I need to verify the length of the line. I need to ensure all are numbers. In some case I might have to compare last two number with something else.

Regards!

Daniel

Posted

The built-in help is (generally speaking) a good resource - esp. the function and script steps reference.

I need to parse one record into multiple records in a filemaker pro database table called ClientOrder.

This part is not quite clear: where do they enter the codes? It sounds like there should be a table of Invoices and a table of LineItems, related through InvoiceID. I assume the codes are the SKU's of ordered products?

I need to verify the length of the line. I need to ensure all are numbers. ...

Shouldn't you verify the codes against a list of valid codes (existing product SKU's)?

In some case I might have to compare last two number with something else.

That too raises a red flag. Not that it's not possible - but it indicates that the 4-digit code encodes more than one fact. In general, that's not good database practice. Perhaps you should elaborate more on what your solution is about.

BTW, I'd suggest you take a look at a basic invoicing setup here:

http://fmforums.com/forum/showpost.php?post/309136/

Posted

Hello Comment,

I've tried to send you an email with more detail information on what I am trying to achieved. For some reason, the system did not let me send an email, do you have a temporary email address where I could send you information which explain better what I am trying to do.

Best regards!

Daniel

Posted

For some reason, the system did not let me send an email

The reason being that I have disabled this option. You can send me a private message through the forum - IF you feel you have a private matter to discuss... :P

This topic is 5078 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.