Configurator On Leave

Thanks Jim, that did it. I was also able to set rules to delete qty. input box and price box (we use this price box for setting the total cost for an order) when a "Non-Part" is entered. This is going to cut way down on input errors.

Thank You
Gene

--- In vantage@yahoogroups.com, "jckinneman" <jckinneman@...> wrote:
>
> add a no-error on the find statement. Progress is probably reporting an error in the server log that you aren't seeing. Without the no-error you are letting progress deal with the "error" of finding no part. With the no-error you are telling progress "I will handle the errors".
>
> FIND Part WHERE Part.partNum = chrS1 AND Part.Company = "JSI" NO-LOCK NO-ERROR.
>
> if available part then
> do:
> /* what you want to happen if part is found */
> end.
> else
> do:
> /* what you want to happen if not part is found */
> end.
>
> Jim Kinneman
> Encompass Solutions, Inc
>
> --- In vantage@yahoogroups.com, "gmack110256" <genemack@> wrote:
> >
> > I am setting up a new configured part in our system. We have both "stock" and "non-stock" parts in our system. I am setting up different character boxes tha will allow sales staff to input any part number in the system. I have used the following on leave rule for these boxes.
> >
> > FIND Part WHERE Part.partNum = chrS1 AND Part.Company = "JSI" NO-LOCK.
> >
> > if available Part then
> >
> > chrS1C = Part.Class
> >
> > This triggers the Part.Class to be populated in the next character box for verification of stock verses non-stock part status. This works fine. My question is this, if you go back and change the part number in the first box to a number that is not in the system (basically a non part) and tab out the "Class" box retains the Part.Class that was tied to the orginal part.
> >
> > Does any know if there is a line of code I can put in that will take the Part.Class out if the number entered is not a part in the system?
> >
> > Thank You
> > Gene
> >
>
I am setting up a new configured part in our system. We have both "stock" and "non-stock" parts in our system. I am setting up different character boxes tha will allow sales staff to input any part number in the system. I have used the following on leave rule for these boxes.

FIND Part WHERE Part.partNum = chrS1 AND Part.Company = "JSI" NO-LOCK.

if available Part then

chrS1C = Part.Class

This triggers the Part.Class to be populated in the next character box for verification of stock verses non-stock part status. This works fine. My question is this, if you go back and change the part number in the first box to a number that is not in the system (basically a non part) and tab out the "Class" box retains the Part.Class that was tied to the orginal part.

Does any know if there is a line of code I can put in that will take the Part.Class out if the number entered is not a part in the system?

Thank You
Gene
Try:

if available Part then chrS1C = Part.Class else chrS1C=""

Or is your problem that when chrS1 is not in the system, an error occurs?


Calvin

--- In vantage@yahoogroups.com, "gmack110256" <genemack@...> wrote:
>
> I am setting up a new configured part in our system. We have both "stock" and "non-stock" parts in our system. I am setting up different character boxes tha will allow sales staff to input any part number in the system. I have used the following on leave rule for these boxes.
>
> FIND Part WHERE Part.partNum = chrS1 AND Part.Company = "JSI" NO-LOCK.
>
> if available Part then
>
> chrS1C = Part.Class
>
> This triggers the Part.Class to be populated in the next character box for verification of stock verses non-stock part status. This works fine. My question is this, if you go back and change the part number in the first box to a number that is not in the system (basically a non part) and tab out the "Class" box retains the Part.Class that was tied to the orginal part.
>
> Does any know if there is a line of code I can put in that will take the Part.Class out if the number entered is not a part in the system?
>
> Thank You
> Gene
>
I see your problem now.

What I suggested doesn't work. It seems that if chrS1 is not in the 'Part' table, none of the code executes.

I even tried putting a chrS1C = "". before the call to FIND, hoping it would clear chrS1C before checking if a part existed.

I'll keeping looking at it.

Calvin


--- In vantage@yahoogroups.com, "c.krusen1" <ckrusen1@...> wrote:
>
> Try:
>
> if available Part then chrS1C = Part.Class else chrS1C=""
>
> Or is your problem that when chrS1 is not in the system, an error occurs?
>
>
> Calvin
>
> --- In vantage@yahoogroups.com, "gmack110256" <genemack@> wrote:
> >
> > I am setting up a new configured part in our system. We have both "stock" and "non-stock" parts in our system. I am setting up different character boxes tha will allow sales staff to input any part number in the system. I have used the following on leave rule for these boxes.
> >
> > FIND Part WHERE Part.partNum = chrS1 AND Part.Company = "JSI" NO-LOCK.
> >
> > if available Part then
> >
> > chrS1C = Part.Class
> >
> > This triggers the Part.Class to be populated in the next character box for verification of stock verses non-stock part status. This works fine. My question is this, if you go back and change the part number in the first box to a number that is not in the system (basically a non part) and tab out the "Class" box retains the Part.Class that was tied to the orginal part.
> >
> > Does any know if there is a line of code I can put in that will take the Part.Class out if the number entered is not a part in the system?
> >
> > Thank You
> > Gene
> >
>
Thanks for looking at this. I am lost as to why if it can't find the part in the table it will not reset as you suggested. I had tried the same thing without success.

Gene

--- In vantage@yahoogroups.com, "c.krusen1" <ckrusen1@...> wrote:
>
> I see your problem now.
>
> What I suggested doesn't work. It seems that if chrS1 is not in the 'Part' table, none of the code executes.
>
> I even tried putting a chrS1C = "". before the call to FIND, hoping it would clear chrS1C before checking if a part existed.
>
> I'll keeping looking at it.
>
> Calvin
>
>
> --- In vantage@yahoogroups.com, "c.krusen1" <ckrusen1@> wrote:
> >
> > Try:
> >
> > if available Part then chrS1C = Part.Class else chrS1C=""
> >
> > Or is your problem that when chrS1 is not in the system, an error occurs?
> >
> >
> > Calvin
> >
> > --- In vantage@yahoogroups.com, "gmack110256" <genemack@> wrote:
> > >
> > > I am setting up a new configured part in our system. We have both "stock" and "non-stock" parts in our system. I am setting up different character boxes tha will allow sales staff to input any part number in the system. I have used the following on leave rule for these boxes.
> > >
> > > FIND Part WHERE Part.partNum = chrS1 AND Part.Company = "JSI" NO-LOCK.
> > >
> > > if available Part then
> > >
> > > chrS1C = Part.Class
> > >
> > > This triggers the Part.Class to be populated in the next character box for verification of stock verses non-stock part status. This works fine. My question is this, if you go back and change the part number in the first box to a number that is not in the system (basically a non part) and tab out the "Class" box retains the Part.Class that was tied to the orginal part.
> > >
> > > Does any know if there is a line of code I can put in that will take the Part.Class out if the number entered is not a part in the system?
> > >
> > > Thank You
> > > Gene
> > >
> >
>
I also played around with using the ud\test\GetTableData.p function, without success.

Another odd function of OnLeave is that it doesn't process if the data hasn't changed.

I made a test where the OnLeave of FILLIN1 would set
FILLIN3 = FILLIN3 + "X"
to see whenever FILLIN1.OnLeave was executed.

But even if I deleted the value FILLIN1 and retyped it(even if I changes the case), the OnLeave didn't execute.

Calvin

--- In vantage@yahoogroups.com, "gmack110256" <genemack@...> wrote:
>
> Thanks for looking at this. I am lost as to why if it can't find the part in the table it will not reset as you suggested. I had tried the same thing without success.
>
> Gene
>
> --- In vantage@yahoogroups.com, "c.krusen1" <ckrusen1@> wrote:
> >
> > I see your problem now.
> >
> > What I suggested doesn't work. It seems that if chrS1 is not in the 'Part' table, none of the code executes.
> >
> > I even tried putting a chrS1C = "". before the call to FIND, hoping it would clear chrS1C before checking if a part existed.
> >
> > I'll keeping looking at it.
> >
> > Calvin
> >
> >
> > --- In vantage@yahoogroups.com, "c.krusen1" <ckrusen1@> wrote:
> > >
> > > Try:
> > >
> > > if available Part then chrS1C = Part.Class else chrS1C=""
> > >
> > > Or is your problem that when chrS1 is not in the system, an error occurs?
> > >
> > >
> > > Calvin
> > >
> > > --- In vantage@yahoogroups.com, "gmack110256" <genemack@> wrote:
> > > >
> > > > I am setting up a new configured part in our system. We have both "stock" and "non-stock" parts in our system. I am setting up different character boxes tha will allow sales staff to input any part number in the system. I have used the following on leave rule for these boxes.
> > > >
> > > > FIND Part WHERE Part.partNum = chrS1 AND Part.Company = "JSI" NO-LOCK.
> > > >
> > > > if available Part then
> > > >
> > > > chrS1C = Part.Class
> > > >
> > > > This triggers the Part.Class to be populated in the next character box for verification of stock verses non-stock part status. This works fine. My question is this, if you go back and change the part number in the first box to a number that is not in the system (basically a non part) and tab out the "Class" box retains the Part.Class that was tied to the orginal part.
> > > >
> > > > Does any know if there is a line of code I can put in that will take the Part.Class out if the number entered is not a part in the system?
> > > >
> > > > Thank You
> > > > Gene
> > > >
> > >
> >
>
add a no-error on the find statement. Progress is probably reporting an error in the server log that you aren't seeing. Without the no-error you are letting progress deal with the "error" of finding no part. With the no-error you are telling progress "I will handle the errors".

FIND Part WHERE Part.partNum = chrS1 AND Part.Company = "JSI" NO-LOCK NO-ERROR.

if available part then
do:
/* what you want to happen if part is found */
end.
else
do:
/* what you want to happen if not part is found */
end.

Jim Kinneman
Encompass Solutions, Inc

--- In vantage@yahoogroups.com, "gmack110256" <genemack@...> wrote:
>
> I am setting up a new configured part in our system. We have both "stock" and "non-stock" parts in our system. I am setting up different character boxes tha will allow sales staff to input any part number in the system. I have used the following on leave rule for these boxes.
>
> FIND Part WHERE Part.partNum = chrS1 AND Part.Company = "JSI" NO-LOCK.
>
> if available Part then
>
> chrS1C = Part.Class
>
> This triggers the Part.Class to be populated in the next character box for verification of stock verses non-stock part status. This works fine. My question is this, if you go back and change the part number in the first box to a number that is not in the system (basically a non part) and tab out the "Class" box retains the Part.Class that was tied to the orginal part.
>
> Does any know if there is a line of code I can put in that will take the Part.Class out if the number entered is not a part in the system?
>
> Thank You
> Gene
>