Aller au contenu principal

Recherche

Recherche

Simple Scripting

Commentaires

7 commentaires

  • Avatar
    Shotaro Ito
    Try script like below:
    [Code]
    ReferenceField("Cust-key")
    If Field("Cust-key",0)=1234 then
    Value = "UL123Recognized"
    End If
    [/code]

    If the field "Cust-key" is text type, you would do like
    [Code]
    ReferenceField("Cust-key")
    If Field("Cust-key","")="1234" then
    Value = "UL123Recognized"
    End If
    [/code]

    hope it helps!
    0
  • Avatar
    Legacy Poster
    [quote name='Shotaro I -Seagull Support' timestamp='1320135088' post='924']
    Try script like below:
    [Code]
    ReferenceField("Cust-key")
    If Field("Cust-key",0)=1234 then
    Value = "UL123Recognized"
    End If
    [/code]

    If the field "Cust-key" is text type, you would do like
    [Code]
    ReferenceField("Cust-key")
    If Field("Cust-key","")="1234" then
    Value = "UL123Recognized"
    End If
    [/code]

    hope it helps!
    [/quote]



    This worked great, but now what if it isn't that customer number? I tried adding the following

    Else
    Value = ""
    End If

    It seems to take it, but then it can't find the records unless they are related to this customer number. I tried adding a second statement to reference if the customer number is not equal to that customer, same result.

    Sorry, my scripting knowledge is limited, so not sure what I'm missing. Scenario, it is working if the item is associated with that customer, otherwise, with or without editing the script, it will not pull up the other records and not display the UL123Recognized which it shouldn't, but it won't display the rest of the record either.

    Thanks for your help.
    0
  • Avatar
    Shotaro Ito
    I'm not sure I understood your question properly - do you mean when "Cust-key" is not 1234, just show the value of Cust-key? if that is the case..

    [code]
    ReferenceField("Cust-key")
    If Field("Cust-key",0)=1234 then
    Value = "UL123Recognized"
    Else
    Value = Field("Cust-key",0)
    End If
    [/code]
    0
  • Avatar
    Legacy Poster
    [quote name='Shotaro I -Seagull Support' timestamp='1320194718' post='932']
    I'm not sure I understood your question properly - do you mean when "Cust-key" is not 1234, just show the value of Cust-key? if that is the case..

    [code]
    ReferenceField("Cust-key")
    If Field("Cust-key",0)=1234 then
    Value = "UL123Recognized"
    Else
    Value = Field("Cust-key",0)
    End If
    [/code]
    [/quote]


    Thank you. Closer. Basically if the customer does not equal 1234, then I want it to display nothing, no text or Customer number, so just show the UL123Recognized when the customer is 1234, otherwise, show nothing. I know it's close to being right, but still missing something.

    Thanks again for your help.
    0
  • Avatar
    Shotaro Ito
    OK, try this way...
    [Code]
    ReferenceField("Cust-key")
    If Field("Cust-key",0)=1234 then
    Value = "UL123Recognized"
    Else
    Value = ""
    End If
    [/code]
    0
  • Avatar
    Legacy Poster
    [quote name='Shotaro I -Seagull Support' timestamp='1320381576' post='969']
    OK, try this way...
    [Code]
    ReferenceField("Cust-key")
    If Field("Cust-key",0)=1234 then
    Value = "UL123Recognized"
    Else
    Value = ""
    End If
    [/code]
    [/quote]



    Thanks for your response. That is what I had in the code too, but something is wrong. If I have it set this way, when I call an item that is associated with the customer 1234, all is well and the UL123Recognized shows up on the label. If the item that is not associated with customer 1234, it tells me "No Records Found" BarTender Error Message #3200.

    I am confused why this won't work. Any other suggestions? Thanks.
    0
  • Avatar
    Shotaro Ito
    Hi Smileyville,
    If you still have trouble, Could you tell me how you set up the format and where did you place script?
    Is that in Multilne script in a text, or OnProcessData in More options of a text?
    Do you use Query prompt in Darabase setup > Query tab?
    If no record is selected because of query result, #3200 No record found error would be shown.
    0

Vous devez vous connecter pour laisser un commentaire.