Paul P
25th October 2002, 12:20
Dear all,

After successfully making a record in multi occurence session current (return value of stpapi.find is 1), I issued a stpapi.synchronize.dialog. The stpapi.synchronize.dialog returns value of 1 stating it was successful. However, after observation it doesn't synchronize to the correct record. The stpapi.get.field for key fields on synchronized single occurence session returns nothing.

Is there any special step I had to do after successful stpapi.find in order that I synchronize to the correct record? I tried inserting stpapi.mark between the 2 but it didn't help.

Any clues are greatly appreciated. Thanks very much

Rgds,
Paul

Paul P
31st October 2002, 03:41
Dear all,

Has anybody ever tried stpapi.synchronize.dialog successfully at all? There's another threadthat talked about this but ended in no conclusion.

stpapi, insert and update record (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=889)

We've installed the latest STP bug fix numbered 128850 for our B5c but stpapi.synchronize.dialog still doesn't work.

HELP!!!!

Rgds,
Paul

gfasbender
31st October 2002, 04:04
Paul,

Try a stpapi.change.view() instead of a find().

Paul P
31st October 2002, 04:17
Dear Gordon,

Is stpapi.change.view a substitute for stpapi.find or does it merely change the view in type 3 forms? Problem is the multi occurence session I'm working with may have multiple occurence and I have to find a specific occurence, sync, and make modification on it, and .. wash, rinse, repeat. I'm just afraid if I only use stpapi.change.view then I'd always sync with the first occurence on the view, which is not what I want.

I'll give it a try anyway and let everybody knows. Thanks

Rgds,
Paul

Paul P
31st October 2002, 04:47
Dear Gordon,

When I used find, mark, and sync, they all returned 1. But when I used change.view, mark, and sync, they returned 2,1,1. Even more bizarre when I used change.view, find, mark, sync, they returned 2,0,1,1. But it would happily return to original case if I revert the script. Why did find failed to find the record after change.view but succeed to find it on its own?



I'm completely bamboozled. HELP, EVERYONE, HELP!! HELP!!!!

Rgds,
Paul

mark_h
31st October 2002, 14:46
Well when I use stpapi.change.view on a multi-occurrence session this finds the key value. Then I read through the records using stpapi.browse.set to move through the records to find the one that I want to update. So I would expect something like this:

stpapi.put.field(...)
stpapi.put.field(...)
stpapi.change.view(...)
stpapi.browse.set(...,"first.set")
| Maybe get something here to see if you have the correct record.
while checksomething
stpapi.browse.set(....,"next.set")
endwhile
stpapi.mark(...)
| Put some stuff....
stpapi.update(...)


Not sure if baan 5 works this way and I am not sure where you use the sync. dialog statement.

Mark

Paul P
5th November 2002, 05:24
stpapi.insert returns the error message "Editable synchronize dialog not started". I initially couldn't see this cause the stpapi.get.mess.code on the multi occ side of stpapi.insert returns nothing. However, as I said before sync returns 1. Moreover, the synchronized single occ session does appear on process list after stpapi.synchronized.dialog. Why?

Rgds,
Paul

Paul P
5th November 2002, 05:26
Dear Gordon and Mark,

I really appreciate your prompt attention and reply. It's giant leap better than the attention we're receiving now from BS. After logging case with BS, several days later they came up only with lists of basic checklist for API (including statement that BS doesn't do this stuffs, but help can be obtained by engaging Baan Technical Consultants). Pretty disappointing

We're about to give up on API now. We can't seem to make synchronize.dialog works. Find seems to be working fine in our other session where we find a specific record and process it using form.command. Beside, in this particular session, get.field after find returns the correct values. I was about to try your suggestion but, as I said, in my case it was the change.view that actually doesn't work.

Do you happen to know anybody at all successful at using advanced API functionalities in B5? We'd really like to get in touch with some.

Once again, thanks, Gordon and Mark

Rgds,
Paul

Dear all,
Do you know anybody who can help me with their successful API experience in B5? We'd really appreciate it. Thanks very much

Rgds,
Paul

mark_h
5th November 2002, 14:54
Hi Paul!

Sorry I must have missed this post. I do know there are others that have API function servers up for B5, but just from this forum. I will admit that there are some sessions that are just not friendly to API function servers. And I dis-agree with Baan supports answer, that is a bad response.

Mark

Paul P
8th November 2002, 11:08
IT WORKS!!! IT WORKS!!!! WOOOHOOOOO!!!!! IT WORKS!!!

Okay, in the API manual it says that following is the syntax for this particular command
long stpapi.synchronize.dialog(string session, string mode, ref string err.mesg)
And that the mode variable is to be replaced by either "Add", "Modify", "display", or "". Well, guess what, the manual's wrong!!! The mode variable is to be replaced by "add", "modify", "display", or "". That's right, just some stupid lower case/upper case mistake.

Thanks particularly to Mark and Gordon for your attentiveness to our problem. Keep up the great work, guys :) ! Let's hope that there'll be no more hick up. If there's one later, then I'll be back in new thread :)

Rgds,
Paul

spartacus
22nd January 2003, 11:23
Hi Paul,

maybe a little late. But understand I right if I say: "add" is the right syntax, and "Add" ist wrong???

Spartacus

Paul P
22nd January 2003, 11:44
Hi Spartacus,

You're right, you're supposed to put "add" and not "Add". Silly mistake in the manual. The sad thing is, they haven't fixed the manual up until now. Have a nice day!

Rgds,
Paul