AnsweredAssumed Answered

auto fill-in sequential numbering over several fields

Question asked by SSed on Sep 4, 2009
Latest reply on Sep 9, 2009 by SSed

Title

auto fill-in sequential numbering over several fields

Post

hey guys. I've looked through the forums and it has helped me quite a bit already but I think I need to ask something specific to get this thing finished. I am not a scripter, like many of the people asking questions on this board, so please explain it to me like I'm a three year old :p

 

Ok, what I'm doing is duplicating records, adding unique serial number suffixes in order to track individual items that otherwise have the same data. There are four catagories that are pertinent to this question: RTP, AP, ED and Misc (business specific terms). I have "current" and "total" fields for each catagory. My goal is for the script to recognize the total number of an inventory catagory and then fill in the current field sequencially over duplicate records until it reaches the total number. After it reaches the total number then it moves on to the next inventory catagory, leaving the current field of the previous catagory empty afterwards. If this makes sense at all...

 

My script is based of the knowledge base entry on automatic record duplication (here), and I'm trying to use the same logic for this part of the solution. This is how I've mangled it so far to fit my needs.

 

Set Field [ Inventory v2::global_match_records; 1 ]

Set Field [ Inventory v2::global_match_records_rtp; 1 ]

Set Field [ Inventory v2::global_match_records_ap; 1 ]

Set Field [ Inventory v2::global_match_records_ed; 1 ]

Set Field [ Inventory v2::global_match_records_misc; 1 ]

Set Field [ Inventory v2::global_match_duplicates; "1" ]

Set Field [ Inventory v2::global_match_duplicates_rtp; "1" ]

Set Field [ Inventory v2::global_match_duplicates_ap; "1" ]

Set Field [ Inventory v2::global_match_duplicates_ed; "1" ]

Set Field [ Inventory v2::global_match_duplicates_misc; "1" ]

 

Loop

If [ IsEmpty ( Inventory v2::duplicate_count) = 0 and Inventory v2::duplicate_count ≠ Inventory v2::global_match_duplicates ]
Duplicate Record/Request

Set Field [ Inventory v2::global_match_duplicates; Inventory v2::global_match_duplicates + 1 ]

Set Field [ Inventory v2::serial_number_complex; Inventory v2::serial_number_complex + 1 ]

 

//this is the section that needs work

If [ IsEmpty ( Inventory v2::rtp_total ) = 0 and Inventory v2::rtp_total ≠ Inventory v2::global_match_duplicates_rtp ]
Set Field [ Inventory v2::rtp_current; Inventory v2::rtp_current + 1 ]

Else

Set Field [ Inventory v2::global_match_records_rtp; 1 ]

Set Field [ Inventory v2::global_match_records_rtp; Inventory v2::global_match_records_rtp + 1 ]

End If

//

 

Else

Set Field [ Inventory v2::global_match_records; 1 ]

Set Field [ Inventory v2::global_match_records; Inventory v2::global_match_records + 1 ]

If [ Get ( FoundCount ) = 0 ] Show All Records

End If

End If

End Loop

 

Thanks in advance for any kind of help you all can give me. I might have one more question if this one gets resolved...

Outcomes