This is my code that i wrote awhile ago but i’m not wanted to hard code in my “SKU” numbers i want it to pick up off a name, say it was for Apples and i had Apples black, Apples Blue, Apples Red … etc. and i wanted to pick up every apple and change a price on it.
Heres my code at the moment
If ( (Year(docThis.PF_Dates_BuyIn(0))) )=>2009 Then
Select Case sSKU
Case 11829,11834,11832,11833,11831,11986,11987,12026,11908,11964,11830,12092,12133,12273,12274,12275,12276,12277,12493,12494,12495,12496 :
Call docThis.ReplaceItemValue(sPrefix+"Product_Royalty"+sLine, "7")
Case 11983,12047,11981,11975,12046,11944,12220,11982,11980,11943,12389,12390,12507,12508,12490,12491,12492 :
Call docThis.ReplaceItemValue(sPrefix+"Product_Royalty"+sLine, "8")
Case Else :
Call docThis.ReplaceItemValue(sPrefix+"Product_Royalty"+sLine, docProducts.p_Royalty(0))
End Select
Else
Call docThis.ReplaceItemValue(sPrefix+"Product_Royalty"+sLine, docProducts.p_Royalty(0))
End If
Here you can see my sSku(the 5 digit numbers) are the unique IDs for the Apples but i dont want to hard code them in like this as more sSku’s can come in and are deleted so i would want to change it to something like this:
If ( (Year(docThis.PF_Dates_BuyIn(0))) )=>2009 Then
Select Case sSKU
Case 11829,11834,11832,11833,11831,11986,11987,12026,11908,11964,11830,12092,12133,12273,12274,12275,12276,12277,12493,12494,12495,12496 :
Call docThis.ReplaceItemValue(sPrefix+"Product_Royalty"+sLine, "7")
Case "*Apples*" :
Call docThis.ReplaceItemValue(sPrefix+"Product_Royalty"+sLine, "8")
Case Else :
Call docThis.ReplaceItemValue(sPrefix+"Product_Royalty"+sLine, docProducts.p_Royalty(0))
End Select
Else
Call docThis.ReplaceItemValue(sPrefix+"Product_Royalty"+sLine, docProducts.p_Royalty(0))
End If
i have put in *'s as i want it to pickup if it was black Apple or Apple Black.
Cheers
Chris.