I need to get the RecordID of a Record, but I haven't found the correct function to do that.
I have only found this function:
RECORDID (RecordRef)
Use this function to return the RecordID of the record that is currently selected in the table. If no table is selected, an error is generated.
RecordID := RecordRef.RECORDID
IF PurchaseHeader.HASLINKS THEN
BEGIN
RecRef.OPEN(DATABASE::"Purchase Header");
RecRef.SETTABLE(PurchaseHeader);
PurchHeaderRecordID := RecRef.RECORDID;
RecordLink.SETRANGE(RecordLink."Record ID",PurchHeaderRecordID);
IF RecordLink.FINDSET THEN
REPEAT
MESSAGE(RecordLink.URL1);
UNTIL RecordLink.NEXT = 0;
END;
The SETTABLE function does not make RecRef to be positioned on the record PurchaseHeader was.... RecRef has the default values (Order,'')
Yeah I don't think the documentation on those functions is adequate. It's similar to the Get & Set property functions they had in the old VB6 days, but in reverse. GetTable gets the values from the record and puts them in the record ref, while the SetTable pushes them back to the Record variable.
Answers
What are you trying to accomplish in code?
Epimatic Corp.
http://www.epimatic.com
The SETTABLE function does not make RecRef to be positioned on the record PurchaseHeader was.... RecRef has the default values (Order,'')
Epimatic Corp.
http://www.epimatic.com
Epimatic Corp.
http://www.epimatic.com
Epimatic Corp.
http://www.epimatic.com