No need for GET. When you're on a form, the current record is called 'Rec'. When you select it from the object browser, it even gets left out. Try this code:
"Name of the record" to access the current record is "Rec". But you can skip the Rec. part because all code on the form is virtually done with command "With rec do" (thus Rec. is not needed in the code, it will be added automatically in the background). I recommend to read basic documentation for developers to see how the Rec. and xRec. variables are working...
It doesn't look like you need the "name_of_record" variable. Just like the other example, you can assign values to just the field name, that will set those values to the current record on the form.
You know, instead of trying to come up with something like 'name_of_record' and 'name_of_field', why don't you just use the same record and field names that you are working with? Also, explain to us what the functional requirement is, so we understand what it is that you're trying to do. There might be a different way to approach your problem.
Think about what you're trying to do. You are trying to set the sell-to customer name on the sales header, so why are you doing a MODIFY on your GlavaProd variable? Where are you setting the value of your ime_priimek variable?
I am assuming that you are trying to retrieve the value from the GlaveProd table, and setting the field on the sales header with the name from that record.
OnPush()
IF GlavaProd.GET THEN
VALIDATE("Sell-to Customer Name",GlavaProd."Sell-to Customer Name");
or simply assigning the field:
OnPush()
IF GlavaProd.GET THEN
"Sell-to Customer Name" := GlavaProd."Sell-to Customer Name";
And if the value doesn't show up then add a CurrForm.UPDATE in there.
Comments
Did u write
Name_of_record.Get;
before these above two statements?
RIS Plus, LLC
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
now I have in string name, address and post code
and I try to write into record
with name_of_record."name_of_field" := string_name;
I also try "name_of_field" := string_name;?
You know, instead of trying to come up with something like 'name_of_record' and 'name_of_field', why don't you just use the same record and field names that you are working with? Also, explain to us what the functional requirement is, so we understand what it is that you're trying to do. There might be a different way to approach your problem.
RIS Plus, LLC
I have record GlavaProd on table Sales header
complete code will be in section OnPush() in my Button
GlavaProd.GET;
GlavaProd."Sell-to Customer Name" := ime_priimek; // this is my string
GlavaProd.Modify;
on button click there is no change on form.
I am assuming that you are trying to retrieve the value from the GlaveProd table, and setting the field on the sales header with the name from that record. or simply assigning the field: And if the value doesn't show up then add a CurrForm.UPDATE in there.
RIS Plus, LLC
when I added this it started to work.
funny that when I walked by Customers (form didnt refresh it self`s)
anyway now works, thanks again. =D>