AnsweredAssumed Answered

So not being well versed in the ways of FM I need some assistance to create an excel upload file....

Question asked by mfl666 on Aug 9, 2011
Latest reply on Aug 26, 2011 by philmodjunk

Post

So not being well versed in the ways of FM I need some assistance to create an excel upload file. This file is for our ERP system which is not FM.

The setup I am working with is .....

DB/Tbl – STYLE_MAIN, all garment styles contained in a “Program”.

Tbl – STYLE_ClrSelect, all colors associated with a particular style, there can be a max of 8. There is one record for each color of a style.

Tbl – ZZSTYLR, file format for upload. Contains all the fields that are in a specific order for the upload. Related to STYLE_ClrSelect by style serial number.

The current script I have creates the correct number of records in the excel file but it only ever puts in the first color number for all the records. For the most part the only thing that changes is the color#.

This process also only works if its a new style setup or if I leave the style and go back in. I have also set ZZSTYLR to create and delete records when created in ClrSelect.

Current script...

 

Set Variable [ $filename; Value:Style_Main::Style_ID_Name & "_export.xls" ]

Set Variable [ $pcdesktop; Value:Case ( Left ( Get ( DesktopPath ) ; 2 ) = "/C" ; "filewin:" & Get ( DesktopPath ) & "Style PDFS/" & $filename & "¶" & "filewin:" & Get ( DesktopPath ) & $filename ;

Left ( Get ( DesktopPath ) ; 2 ) = "/U" ; Get ( DesktopPath ) & "/" & "Style PDFS/" & $filename & "¶" & Get ( DesktopPath ) & "/" & $filename ;

Left ( Get ( DesktopPath ) ; 2 ) = "/M" ; Get ( DesktopPath ) & "Style PDFS/" & $filename & "¶" & Get ( DesktopPath ) & $filename ) ]

Set Field [ ZZSTYLR::BCDivision; "MON" ]

Set Field [ ZZSTYLR::BCStyle_Type; "FG" ]

Set Field [ ZZSTYLR::BCStyle; Style_Main::Style_ID_Program_Code & Style_Main::Style_ID_Style_Number ]

Set Field [ ZZSTYLR::BCStyle_Name; Style_Main::Style_ID_Name ]

Set Field [ ZZSTYLR::BCMin_Multiple; "Y" ]

Set Field [ ZZSTYLR::BCStyle_Avail; "Y" ]

Set Field [ ZZSTYLR::BCActive_Ok; "Y" ]

Set Field [ ZZSTYLR::BCStyle_Desc; Style_Main::Style_Description ]

Set Field [ ZZSTYLR::BCSize_Code; Style_Main::Style_Size_Range_Code ]

Set Field [ ZZSTYLR::BCColor_Code; Style_ClrSelect::Style_Color_Standards_Legend_NRF_Num ]

Go to Related Record [ From table: “Style_ClrSelect”; Using layout: “ZZSTYLR” (Style_ClrSelect) ] [ Show only related records; New window ]

// Go to Layout [ “ZZSTYLR” (Style_ClrSelect) ]

Save Records as Excel [ File Name: “$pcdesktop”; Records being browsed; Worksheet: Style_Main::Style_ID_Name; Title: "Style Code: " & Style_Main::Style_ID_Name ] [ Restore; No dialog ]

Close Window [ Current Window ]

 

 

The other option I was thinking of was to add all the fields I have in ZZSTYLR and add them to ClrSelect. I already have a layout that gives me the correct records and color #'s, it would be just a matter of adding the Set Field statements for the remainder. I just not sure if this would be the most logical approach.

All ideas welcome.

Thanks

Michael

Outcomes