Problem with new record button on the tabs?Get last insert id of new record in FileMaker Pro databaseFileMaker Pro 10 - How to have cursor be in first field on new record?How to Populate Records in tabs dynamically in filemaker pro advanceCreating a new record from the first item in listFilemaker - How to add new instance of related record from parent record layoutInsert new record to table without using portalAdding buttons to a FileMaker portal to jump to the related recordsLog record changes in Filemaker like triggers works in SQLImporting Excel records on Filemaker Server using PSoSDisplaying empty/new record on open
If one can diff from Vim without the need to boot `vimdiff` then why is it a binary program?
How do I delete cookies from a specific site?
What quests do you need to stop at before you make an enemy of a faction for each faction?
How do I stop making people jump at home and at work?
Dissuading my girlfriend from a scam
Fantasy Military Arms and Armor: the Dwarven Grand Armory
Are buttons really enough to bound validities by S4.2?
First Number to Contain Each Letter
Is there any reason to change the ISO manually?
Is mathematics truth?
If I have an accident, should I file a claim with my car insurance company?
Was Rosie the Riveter sourced from a Michelangelo painting?
What are some countries where you can be imprisoned for reading or owning a Bible?
GFI outlets tripped after power outage
To which airspace does the border of two adjacent airspaces belong to?
Why are all volatile liquids combustible
A Meal fit for a King
Round away from zero
Where on Earth is it easiest to survive in the wilderness?
What would a biological creature need in order to see into the future?
Draw the ☣ (Biohazard Symbol)
Comparing elements in a nested list to generate a new list
My Friend James
What is the source of the fear in the Hallow spell's extra Fear effect?
Problem with new record button on the tabs?
Get last insert id of new record in FileMaker Pro databaseFileMaker Pro 10 - How to have cursor be in first field on new record?How to Populate Records in tabs dynamically in filemaker pro advanceCreating a new record from the first item in listFilemaker - How to add new instance of related record from parent record layoutInsert new record to table without using portalAdding buttons to a FileMaker portal to jump to the related recordsLog record changes in Filemaker like triggers works in SQLImporting Excel records on Filemaker Server using PSoSDisplaying empty/new record on open
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm a newbie on this. So after pressing the new record button and create a new record on the Company tab, the job# on Company tab increases by one but the problem is the job# of Private tab would increase as well. The job# Private tab should stay zero unless I press the add new record button. I used the same single step script for both of them (new record/request).
filemaker
add a comment |
I'm a newbie on this. So after pressing the new record button and create a new record on the Company tab, the job# on Company tab increases by one but the problem is the job# of Private tab would increase as well. The job# Private tab should stay zero unless I press the add new record button. I used the same single step script for both of them (new record/request).
filemaker
I suggest you ask this in one of the forums dedicated to the Filemaker platform. This is not really a question about programming and the answer is not simple. Unless the answer "do not mind if the Job # has gaps, it will have them anyway if you ever delete a record" is satisfactory.
– michael.hor257k
Mar 28 at 15:45
add a comment |
I'm a newbie on this. So after pressing the new record button and create a new record on the Company tab, the job# on Company tab increases by one but the problem is the job# of Private tab would increase as well. The job# Private tab should stay zero unless I press the add new record button. I used the same single step script for both of them (new record/request).
filemaker
I'm a newbie on this. So after pressing the new record button and create a new record on the Company tab, the job# on Company tab increases by one but the problem is the job# of Private tab would increase as well. The job# Private tab should stay zero unless I press the add new record button. I used the same single step script for both of them (new record/request).
filemaker
filemaker
asked Mar 28 at 3:31
SamSam
245 bronze badges
245 bronze badges
I suggest you ask this in one of the forums dedicated to the Filemaker platform. This is not really a question about programming and the answer is not simple. Unless the answer "do not mind if the Job # has gaps, it will have them anyway if you ever delete a record" is satisfactory.
– michael.hor257k
Mar 28 at 15:45
add a comment |
I suggest you ask this in one of the forums dedicated to the Filemaker platform. This is not really a question about programming and the answer is not simple. Unless the answer "do not mind if the Job # has gaps, it will have them anyway if you ever delete a record" is satisfactory.
– michael.hor257k
Mar 28 at 15:45
I suggest you ask this in one of the forums dedicated to the Filemaker platform. This is not really a question about programming and the answer is not simple. Unless the answer "do not mind if the Job # has gaps, it will have them anyway if you ever delete a record" is satisfactory.
– michael.hor257k
Mar 28 at 15:45
I suggest you ask this in one of the forums dedicated to the Filemaker platform. This is not really a question about programming and the answer is not simple. Unless the answer "do not mind if the Job # has gaps, it will have them anyway if you ever delete a record" is satisfactory.
– michael.hor257k
Mar 28 at 15:45
add a comment |
2 Answers
2
active
oldest
votes
If both fields are from same table and if you have used Auto Enter Serial number, it will increment both.
Uncheck the auto enter serial and increase the numbers using script by calculating the maximum + 1.
Calculating maximum + 1 is not a good idea. It's easy to generate duplicates if you're not careful.
– michael.hor257k
Mar 28 at 15:41
add a comment |
You could create a separate Sequence table for job numbers, public and private being stored in separate records.
Sequence Fields:
- type (TEXT)
- lastAssignedNumber (NUMBER)
Then create a script called Next Sequence ( $type )
Set Variable [ $type = Get(ScriptParameter) ]
Go to layout [ Sequence ]
Set Error Capture [ On ]
Perform Find [ type ==$type ]
If [GetLastError]
Show Custom Dialog [ "Invalid sequence " & Quote( $sequence ) ]
Halt Script
End If
Loop
Open Record/Request
Exit Loop If [ not Get(LastError) ]
# Error opening record, someone else has a lock on this sequence record
# Wait a bit and try again
Pause/Resume Script [ 0.1 ]
End Loop
Set Field [ Sequence::lastAssignedNumber ; Sequence::lastAssignedNumber + 1 ]
Set Variable [ $result = Sequence::lastAssignedNumber ]
Commit Records/Requests
Go to Layout [ original ]
Exit Script [ $result ]
This takes a parameter "type" and exits with a newly assigned sequence number for that type. You'll need to create two records in the Sequence table, giving them type values of "PublicJob" and "PrivateJob", e.g.
Then write two scripts for creating jobs
Create Public Job
New Record/Request
Perform Script [ "Next Sequence ( $type )" ; Parameter: "PublicJob" ]
Set Field [ Job#; Get(ScriptResult) ]
Create Private Job
New Record/Request
Perform Script [ "Next Sequence ( $type )" ; Parameter: "PrivateJob" ]
Set Field [ Job#; Get(ScriptResult) ]
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55389753%2fproblem-with-new-record-button-on-the-tabs%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
If both fields are from same table and if you have used Auto Enter Serial number, it will increment both.
Uncheck the auto enter serial and increase the numbers using script by calculating the maximum + 1.
Calculating maximum + 1 is not a good idea. It's easy to generate duplicates if you're not careful.
– michael.hor257k
Mar 28 at 15:41
add a comment |
If both fields are from same table and if you have used Auto Enter Serial number, it will increment both.
Uncheck the auto enter serial and increase the numbers using script by calculating the maximum + 1.
Calculating maximum + 1 is not a good idea. It's easy to generate duplicates if you're not careful.
– michael.hor257k
Mar 28 at 15:41
add a comment |
If both fields are from same table and if you have used Auto Enter Serial number, it will increment both.
Uncheck the auto enter serial and increase the numbers using script by calculating the maximum + 1.
If both fields are from same table and if you have used Auto Enter Serial number, it will increment both.
Uncheck the auto enter serial and increase the numbers using script by calculating the maximum + 1.
answered Mar 28 at 15:13
SivaSiva
413 bronze badges
413 bronze badges
Calculating maximum + 1 is not a good idea. It's easy to generate duplicates if you're not careful.
– michael.hor257k
Mar 28 at 15:41
add a comment |
Calculating maximum + 1 is not a good idea. It's easy to generate duplicates if you're not careful.
– michael.hor257k
Mar 28 at 15:41
Calculating maximum + 1 is not a good idea. It's easy to generate duplicates if you're not careful.
– michael.hor257k
Mar 28 at 15:41
Calculating maximum + 1 is not a good idea. It's easy to generate duplicates if you're not careful.
– michael.hor257k
Mar 28 at 15:41
add a comment |
You could create a separate Sequence table for job numbers, public and private being stored in separate records.
Sequence Fields:
- type (TEXT)
- lastAssignedNumber (NUMBER)
Then create a script called Next Sequence ( $type )
Set Variable [ $type = Get(ScriptParameter) ]
Go to layout [ Sequence ]
Set Error Capture [ On ]
Perform Find [ type ==$type ]
If [GetLastError]
Show Custom Dialog [ "Invalid sequence " & Quote( $sequence ) ]
Halt Script
End If
Loop
Open Record/Request
Exit Loop If [ not Get(LastError) ]
# Error opening record, someone else has a lock on this sequence record
# Wait a bit and try again
Pause/Resume Script [ 0.1 ]
End Loop
Set Field [ Sequence::lastAssignedNumber ; Sequence::lastAssignedNumber + 1 ]
Set Variable [ $result = Sequence::lastAssignedNumber ]
Commit Records/Requests
Go to Layout [ original ]
Exit Script [ $result ]
This takes a parameter "type" and exits with a newly assigned sequence number for that type. You'll need to create two records in the Sequence table, giving them type values of "PublicJob" and "PrivateJob", e.g.
Then write two scripts for creating jobs
Create Public Job
New Record/Request
Perform Script [ "Next Sequence ( $type )" ; Parameter: "PublicJob" ]
Set Field [ Job#; Get(ScriptResult) ]
Create Private Job
New Record/Request
Perform Script [ "Next Sequence ( $type )" ; Parameter: "PrivateJob" ]
Set Field [ Job#; Get(ScriptResult) ]
add a comment |
You could create a separate Sequence table for job numbers, public and private being stored in separate records.
Sequence Fields:
- type (TEXT)
- lastAssignedNumber (NUMBER)
Then create a script called Next Sequence ( $type )
Set Variable [ $type = Get(ScriptParameter) ]
Go to layout [ Sequence ]
Set Error Capture [ On ]
Perform Find [ type ==$type ]
If [GetLastError]
Show Custom Dialog [ "Invalid sequence " & Quote( $sequence ) ]
Halt Script
End If
Loop
Open Record/Request
Exit Loop If [ not Get(LastError) ]
# Error opening record, someone else has a lock on this sequence record
# Wait a bit and try again
Pause/Resume Script [ 0.1 ]
End Loop
Set Field [ Sequence::lastAssignedNumber ; Sequence::lastAssignedNumber + 1 ]
Set Variable [ $result = Sequence::lastAssignedNumber ]
Commit Records/Requests
Go to Layout [ original ]
Exit Script [ $result ]
This takes a parameter "type" and exits with a newly assigned sequence number for that type. You'll need to create two records in the Sequence table, giving them type values of "PublicJob" and "PrivateJob", e.g.
Then write two scripts for creating jobs
Create Public Job
New Record/Request
Perform Script [ "Next Sequence ( $type )" ; Parameter: "PublicJob" ]
Set Field [ Job#; Get(ScriptResult) ]
Create Private Job
New Record/Request
Perform Script [ "Next Sequence ( $type )" ; Parameter: "PrivateJob" ]
Set Field [ Job#; Get(ScriptResult) ]
add a comment |
You could create a separate Sequence table for job numbers, public and private being stored in separate records.
Sequence Fields:
- type (TEXT)
- lastAssignedNumber (NUMBER)
Then create a script called Next Sequence ( $type )
Set Variable [ $type = Get(ScriptParameter) ]
Go to layout [ Sequence ]
Set Error Capture [ On ]
Perform Find [ type ==$type ]
If [GetLastError]
Show Custom Dialog [ "Invalid sequence " & Quote( $sequence ) ]
Halt Script
End If
Loop
Open Record/Request
Exit Loop If [ not Get(LastError) ]
# Error opening record, someone else has a lock on this sequence record
# Wait a bit and try again
Pause/Resume Script [ 0.1 ]
End Loop
Set Field [ Sequence::lastAssignedNumber ; Sequence::lastAssignedNumber + 1 ]
Set Variable [ $result = Sequence::lastAssignedNumber ]
Commit Records/Requests
Go to Layout [ original ]
Exit Script [ $result ]
This takes a parameter "type" and exits with a newly assigned sequence number for that type. You'll need to create two records in the Sequence table, giving them type values of "PublicJob" and "PrivateJob", e.g.
Then write two scripts for creating jobs
Create Public Job
New Record/Request
Perform Script [ "Next Sequence ( $type )" ; Parameter: "PublicJob" ]
Set Field [ Job#; Get(ScriptResult) ]
Create Private Job
New Record/Request
Perform Script [ "Next Sequence ( $type )" ; Parameter: "PrivateJob" ]
Set Field [ Job#; Get(ScriptResult) ]
You could create a separate Sequence table for job numbers, public and private being stored in separate records.
Sequence Fields:
- type (TEXT)
- lastAssignedNumber (NUMBER)
Then create a script called Next Sequence ( $type )
Set Variable [ $type = Get(ScriptParameter) ]
Go to layout [ Sequence ]
Set Error Capture [ On ]
Perform Find [ type ==$type ]
If [GetLastError]
Show Custom Dialog [ "Invalid sequence " & Quote( $sequence ) ]
Halt Script
End If
Loop
Open Record/Request
Exit Loop If [ not Get(LastError) ]
# Error opening record, someone else has a lock on this sequence record
# Wait a bit and try again
Pause/Resume Script [ 0.1 ]
End Loop
Set Field [ Sequence::lastAssignedNumber ; Sequence::lastAssignedNumber + 1 ]
Set Variable [ $result = Sequence::lastAssignedNumber ]
Commit Records/Requests
Go to Layout [ original ]
Exit Script [ $result ]
This takes a parameter "type" and exits with a newly assigned sequence number for that type. You'll need to create two records in the Sequence table, giving them type values of "PublicJob" and "PrivateJob", e.g.
Then write two scripts for creating jobs
Create Public Job
New Record/Request
Perform Script [ "Next Sequence ( $type )" ; Parameter: "PublicJob" ]
Set Field [ Job#; Get(ScriptResult) ]
Create Private Job
New Record/Request
Perform Script [ "Next Sequence ( $type )" ; Parameter: "PrivateJob" ]
Set Field [ Job#; Get(ScriptResult) ]
answered Mar 28 at 18:18
Sam BarnumSam Barnum
8,8603 gold badges42 silver badges54 bronze badges
8,8603 gold badges42 silver badges54 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55389753%2fproblem-with-new-record-button-on-the-tabs%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I suggest you ask this in one of the forums dedicated to the Filemaker platform. This is not really a question about programming and the answer is not simple. Unless the answer "do not mind if the Job # has gaps, it will have them anyway if you ever delete a record" is satisfactory.
– michael.hor257k
Mar 28 at 15:45