Make a new collection.... filter it as per your category/group. use $$Numitems to get the # of items in that category/group.
One more question if I want Num stock item which don't have category. I tried but not succeed. Pls suggest
please have a look: Regards, Kapil Code: [#Field: STKI PartNo] option: STKI PartNoNew: @@K004IsBarcodeApplicable [!field: STKI PartNoNew] Setas: If ($$Line=1 AND $$InCreateMode) then @KSCCode + "P"+$$ZeroFill:@KSTotal:5 else $$Value Type: String: Forced SetAlways: Yes KSTotal: (@KStartPartNo + @KSNumstock) KStartPartNo : 1 KSNumstock: $$Numitems:KStockItemCollection ;$$NumStockItems Max: 10 Skip: Yes KSCCode: if #STKICategory= $$SysName:NotApplicable then "ODE" ELSE @@KSCCode ;#STKICategory color: Red background: Pale Green [Collection: KStockItemCollection] type: Stock Item filter: KSTKICategory belongsto: yes fetch: Name [#Form: Stock Item] option: Stock ItemNew: @@K004IsBarcodeApplicable [!Form: Stock ItemNew] local:Part: STKI Basic:Local:Line: MST Name: Local:field: MST Name: setas: #KSTKIItemName +@@RSKIN+ #KSTKIMaterial +@@RSKIM+ #KSTKIColor +@@RSKIC+ #KSTKISize +@@RSKIS+ #KSTKIRange local:Part: STKI Basic:Local:Line: MST Name: Local:field: MST Name: skip: yes local:Part: STKI Basic:Local:Line: MST Name: Local:field: MST Name: Color: red local:Part: STKI Basic:Local:Line: MST Name: Local:field: MST Name: background: Pale Green local:Part: STKI Basic:Local:Line: MST Name: height: 1.3 local:Part: STKI Basic:Local:Line: MST Name: replace: Field:ShortPrompt:MediumPrompt local:Part: STKI Basic:Local:Line: MST Name: local: Field:MediumPrompt:Info : $$LocaleString:"Stock Name" local:Part: STKI Basic:Local:Line: STKI PartNo: height: 1.3 add:part: atbeginning: KSTKI Parent Local:part: KSTKI Parent: local:Line: STKI Parent: replace: Field:ShortPrompt:MediumPrompt Local:part: KSTKI Parent: local:Line: STKI Parent: local: Field:MediumPrompt:Info : $$LocaleString:"Stock Group" Local:part: KSTKI Parent: local:Line: STKI Category: replace: Field:ShortPrompt:MediumPrompt Local:part: KSTKI Parent: local:Line: STKI Category: local: Field:MediumPrompt:Info : $$LocaleString:"Stock Category" local:Part: STKI Parent: local:Line: STKI Parent: invisible:yes local:Part: STKI Parent: local:Line: STKI Category: invisible:yes [part: KSTKI Parent] add: Lines: KSTKIItemName, KSTKIMaterial, KSTKIColor, KSTKISize, KSTKIRange lines: STKI Parent, STKI Category [Line: KSTKIItemName] field: MediumPrompt, KSTKIItemName local: Field:MediumPrompt:Info : $$LocaleString:"Item Name" [Line: KSTKIMaterial] field: MediumPrompt, KSTKIMaterial local: Field:MediumPrompt:Info : $$LocaleString:"Item Material" [line: KSTKIColor] Field: MediumPrompt, KSTKIColor local: Field:MediumPrompt:Info : $$LocaleString:"Item Color" [line: KSTKISize] Field: MediumPrompt, KSTKISize local: Field:MediumPrompt:Info : $$LocaleString:"Item Size" [line: KSTKIRange] Field: MediumPrompt, KSTKIRange local: Field:MediumPrompt:Info : $$LocaleString:"Item Range" [Field: KSTKIItemName] use: NameField storage: KItemName [Field: KSTKIMaterial] use: NameField storage: KItemMaterial [Field: KSTKIColor] use: NameField storage: KItemColor [Field: KSTKISize] use: NameField storage: KItemSize [Field: KSTKIRange] use: NameField storage: KItemRange [system: udf] KItemName: String: 5001 KItemMaterial: String: 5002 KItemColor: String: 5003 KItemSize: String: 5004 KItemRange: String: 5005 [system: formula] RSKIN: IF #KSTKIItemName = "" THEN "" ELSE " " RSKIM: IF #KSTKIMaterial = "" THEN "" ELSE " " RSKIC: IF #KSTKIColor = "" THEN "" ELSE " " RSKIS: IF #KSTKISize = "" THEN "" ELSE " " RSKIR: IF #KSTKIRange = "" THEN "" ELSE " " KSTKICategory: $$IsBelongsToCategory:#STKICategory KSCReplace: $$StringFindAndReplace:#STKICategory:"-":"" KSCCode: $$Stringword:1:@@KSCReplace
Fetch Category in collection try using this forumla KSTKINoCategory : $Category contains "Not Applicable" This is just an idea you can recode it as per your needs. Regards, Raylong
final done as follows: Thanks, Try, Refer, Try, Refer, and Try : the only way to find solution Code: [#Field: STKI PartNo] option: STKI PartNoNew: @@K004IsBarcodeApplicable [!field: STKI PartNoNew] Setas: If ($$Line=1 AND $$InCreateMode) then @KSCCode + "P"+$$ZeroFill:@KSTotal:5 else $$Value Type: String: Forced SetAlways: Yes KSTotal: (@KStartPartNo + @KSNumstock) KStartPartNo : 1 KSNumstock: if #STKICategory= $$SysName:NotApplicable then $$Numitems:KStockItemCollection2 else $$Numitems:KStockItemCollection Max: 10 Skip: Yes KSCCode: if #STKICategory= $$SysName:NotApplicable then "ODE" ELSE @@KSCCode color: Red background: Pale Green [Collection: KStockItemCollection] type: Stock Item filter: KSTKICategory fetch: Name [Collection: KStockItemCollection2] type: Stock Item filter: KSTKICategory2 fetch: Name [system: formula] RSKIN: IF #KSTKIItemName = "" THEN "" ELSE " " RSKIM: IF #KSTKIMaterial = "" THEN "" ELSE " " RSKIC: IF #KSTKIColor = "" THEN "" ELSE " " RSKIS: IF #KSTKISize = "" THEN "" ELSE " " RSKIR: IF #KSTKIRange = "" THEN "" ELSE " " KSTKICategory: $$IsBelongsToCategory:#STKICategory KSTKICategory2: $Category contains "Not Applicable" KSCReplace: $$StringFindAndReplace:#STKICategory:"-":"" KSCCode: $$Stringword:1:@@KSCReplace