What version of Progress are you running? I can't seem to duplicate your problem. Also, I found your code hard to read, and consequently hard to debug. For what it's worth, here are a couple of suggestions that may (or may not) help you get to the bottom of your issue...
1. You appear to be missing a space before your AND in your query string - "AND ":U
2. You may want to use a local character variable for your query string, then you can message the variable to verify your query string is what you think.
Code:
DEFINE VARIABLE cQry AS CHARACTER NO-UNDO.
ASSIGN cQry = "WHERE ":U + h_bf_arclientvd:BUFFER-FIELD("no_client":U):NAME + " = ":U + QUOTER(v_cd_client) + "AND ":U
+ h_bf_arclientvd:BUFFER-FIELD("no_vendeur":U):NAME + " = ":U + QUOTER(bf_invquotevend.no_vendeur).
MESSAGE "cQry=" cQry SKIP
VIEW-AS ALERT-BOX INFO BUTTONS OK.
ASSIGN v_err_query_quotevd = h_bf_arclientvd:FIND-FIRST(cQry, EXCLUSIVE-LOCK) NO-ERROR.
3. Next, to make the code easier to read, < h_bf_arclientvd:BUFFER-FIELD("no_client":U):NAME > is the same as < 'no_client' >. Perhaps you have a reason for doing it your way, but the snippet above could be cleaned up a bit and changed like this:
Code:
DEFINE VARIABLE cQry AS CHARACTER NO-UNDO.
ASSIGN cQry = "WHERE no_client = ":U + QUOTER(v_cd_client) + " AND no_vendeur = ":U + QUOTER(bf_invquotevend.no_vendeur).
MESSAGE "cQry=" cQry SKIP
VIEW-AS ALERT-BOX INFO BUTTONS OK.
ASSIGN v_err_query_quotevd = h_bf_arclientvd:FIND-FIRST(cQry, EXCLUSIVE-LOCK) NO-ERROR.
4. Also, when referring to dynamic buffer fields and values: < h_bf_arclientvd:BUFFER-FIELD("no_vendeur":U):BUFFER-VALUE > is the same as
< h_bf_arclientvd::no_vendeur >, so your assignment statement below would look like this:
Code:
--From this --
ASSIGN h_bf_arclientvd:BUFFER-FIELD("nr_arclientvd":U):BUFFER-VALUE = DYNAMIC-NEXT-VALUE("seq_arclientvd":U,h_bf_arclientvd:DBNAME)
h_bf_arclientvd:BUFFER-FIELD("no_vendeur":U):BUFFER-VALUE = bf_invquotevend.no_vendeur
h_bf_arclientvd:BUFFER-FIELD("charge_cpt":U):BUFFER-VALUE = bf_invquotevend.charge_cpt
h_bf_arclientvd:BUFFER-FIELD("no_client":U):BUFFER-VALUE = v_cd_client.
-- To this --
ASSIGN h_bf_arclientvd::nr_arclientvd = DYNAMIC-NEXT-VALUE("seq_arclientvd":U,h_bf_arclientvd:DBNAME)
h_bf_arclientvd::no_vendeur = bf_invquotevend.no_vendeur
h_bf_arclientvd::charge_cpt = bf_invquotevend.charge_cpt
h_bf_arclientvd::no_client = v_cd_client.
5. Finally - just throwing this out there - you seem to have a mix of static buffers, db tables AND dynamic buffers. Perhaps you could simplify everything by just changing over to a straightforward FIND? (where <TableName> is the database table of your dynamic buffer)
Code:
FIND FIRST <TableName>
WHERE <TableName>.no_client = QUOTER(v_cd_client)
AND <TableName>.no_vendeur = QUOTER(bf_invquotevend.no_vendeur) EXCLUSIVE-LOCK NO-ERROR.
IF NOT AVAILABLE <TableName> THEN DO:
END.
Good luck!