NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Thys on July 02, 2019, 12:57:22 AM
-
Hi,
I remember that some time ago I reported that by adding an attribute to a DCT column in the External Name, caused problems. The templates used the full external name that includes the attribute, which is wrong.
Attached is a screenshot of such a setup, where the "guid" column in the Organisation table has an External Name value of "guid |READONLY" to instruct the Clarion db driver not to attempt to add a new guid, but let the db do the work. It now seems as if the NetTalk code doesn't return the guid (a PK value) for a newly inserted record in the response:
{
"dbOrganisation_response": {
"ServiceResults": [
{
"RESULTACTION": "insert",
"RESULTTABLE": "Organisation",
"RESULTRECORDID": "ORG_GUID=",
"RESULTDESCRIPTION": "success"
}
]
}
}
Is there another way to get the new guid value? I know Clarion has a way by using PROP:ServerAutoInc. But this also needs additional code which the NetTalk template probably does not have. I really can't remember that it was necessary to do all of this just to get the newly insert guid back, so for now I assume it has to do with the columm attribute in the DCT.
Thanks
Thys
-
Hi Thys,
>> Is there another way to get the new guid value? I know Clarion has a way by using PROP:ServerAutoInc. But this also needs additional code which the NetTalk template probably does not have.
Tell me more about what code is needed here...
cheers
Bruce
-
Hi Bruce.
I expect the value of ORG_GUID to be displayed, which currently it's not as shown in red in the response.
My question about extra code, was maybe to change something that the guid is shown. I think that p_web.RecordIdentifier(Organisation) is the call to get the guid. Maybe additional code would help to get the correct value and not a blank?
Thys
-
Hi Thys,
>> I expect the value of ORG_GUID to be displayed, which currently it's not as shown in red in the response.
I agree.
>> My question about extra code, was maybe to change something that the guid is shown.
yes, I understood that. From your earlier post it seemed like you knew what this code should be? I don't use server-side guids, or server-side auto-numbering, so this issue has not come up before.
>> Maybe additional code would help to get the correct value and not a blank?
I'll research PROP:ServerAutoInc to see what this code should be...
cheers
Bruce
-
Hi Thys,
I have added an embed point in the InsertRecord:Table routine.
Just before the call to p_web.AddFile(Table)
I think the code you want in here looks something like this;
table{PROP:ServerAutoInc,n}= m
where n is the field number in the table (presumably usually 1) and m is usually 1.
(it seems it could be different if you have a multi-component unique key.)
So the first step is for you to test this with the next build to see if we are on the right track. If we are then I can look at possible ways to automate this for all methods.
cheers
Bruce