You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

no current buffer context error

4 replies [Last post]
vijayalakshmi's picture
User offline. Last seen 8 years 28 weeks ago. Offline
Joined: 05/08/2012
Posts: 9

Local Record &Rec;
&Rec = CreateRecord(Record.LNT_EMPREC_970);
LNT_EMPREC_970.LNT_EMPLID_970 = &e;
LNT_EMPREC_970.LNT_DATE_970 = &bb.shift();
LNT_EMPREC_970.LNT_NAME1_970 = &bb.shift();
LNT_EMPREC_970.LNT_DEPARTMENT_970 = &bb.shift();
LNT_EMPREC_970.LNT_ADDRESS1_970 = &bb.shift();
LNT_EMPREC_970.LNT_PHONE1_970 = &bb.shift();

&Rec.Insert();

Ashar's picture
User offline. Last seen 5 years 1 week ago. Offline
Joined: 03/26/2008
Posts: 227
Re: no current buffer context error

Shouldn't this be,

Local Record &Rec;
&Rec = CreateRecord(Record.LNT_EMPREC_970);
&Rec.LNT_EMPLID_970 = &e;
&Rec.LNT_DATE_970 = &bb.shift();
&Rec.LNT_NAME1_970 = &bb.shift();
&Rec.LNT_DEPARTMENT_970 = &bb.shift();
&Rec.LNT_ADDRESS1_970 = &bb.shift();
&Rec.LNT_PHONE1_970 = &bb.shift();

&Rec.Insert();

kannadhasan's picture
User offline. Last seen 8 years 27 weeks ago. Offline
Joined: 06/10/2012
Posts: 4
Re: no current buffer context error

&Rec is created as Standalone record.

So Code should be like below
Local Record &Rec;
&Rec = CreateRecord(Record.LNT_EMPREC_970);
&Rec.LNT_EMPLID_970 = &e;
&Rec.LNT_DATE_970 = &bb.shift();
&Rec.LNT_NAME1_970 = &bb.shift();
&Rec.LNT_DEPARTMENT_970 = &bb.shift();
&Rec.LNT_ADDRESS1_970 = &bb.shift();
&Rec.LNT_PHONE1_970 = &bb.shift();
&Rec.Insert();

Reason for using &Rec variable for accessing the fields.

The fields created by Create Record function are initialized to null values. Default processing is not performed. No data associated with the record definition’s SQL table is brought in: only the record definition.

Example for Usage of Standalone Record
In the following example, a free-standing record is created (&PSBATREPREQRES). Values are assigned to the fields associated with the record. Then a second record is created (&PUBHDR), and the values from the first record are used to populate the second record.

&PSBATREPREQRES = CreateRecord(RECORD.PSBATREPREQRES);
&PSBATREPREQRES.BATREPID.Value = &BATREPID;
&PSBATREPREQRES.PUBID.Value = &MSG.Pubid;
&PSBATREPREQRES.CHNLNAME.Value = &MSG.ChannelName;
&PSBATREPREQRES.PUBNODE.Value = &MSG.PubNodeName;
&PSBATREPREQRES.MSGNAME.Value = &MSG.Name;

&PUBHDR = CreateRecord(RECORD.PSAPMSGPUBHDR);
&PSBATREPREQRES.CopyFieldsTo(&PUBHDR);

Guest's picture
Guest
Re: no current buffer context error

awesome things here. I am very glad to see your article. Thanks a lot and i am looking forward to contact you. Will you please drop me a mail?

Guest's picture
Guest
Re: no current buffer context error

Do you have a spam problem on this site; I also am a blogger, and I was wanting to know your situation; many of us have developed some nice procedures and we are looking to exchange solutions with others, be sure to shoot me an e-mail if interested.