hi
ihave problem to assign the filed "Docuomant type" and Documant No."
and "Line No." from Sales Line to another table called TEST i add Button
in the sales order sub form and write this code OnPush Event
//GetSalesLine is function in the TestCard Form
// the 99508 is the testCard form id
testCard.GetSalesLine("No.","Document Type","Document No.");
FORM.RUN(99508);
and in the GetSalesLine Function i try to assign the function parameter to the filed Put Nathing happened
//GetSalesLine have 3 parameter
// No code[20]
// Type option
//DocNo code[20]
"No.":=No;
"Document Type":=Type;
"Document No.":=DocNo;
any one can help plz ](*,)
Comments
In place of calling the form by FORM.RUN() , use TestCard.RUN instead, so you are sure you work on the same instance of the form ...
SalesLine.Get(Type,DocNo,No)
in the getsalesline function. With your code you're trying to modify the record itself (even than you wold have to insert an salesline.modify).
but the problen not solve yet
janv this the function GetSalesLine after modifying the code
no error but the filed in the TestCard still empty ](*,) ](*,)
Form.RUN(Form::"Te Form", Record);
as with this code you're trying to assign new values.
Maybe you can replace the "get"-statement throug a form.setrecord like in
form.setrecord(salesline) and then run the form.
BTW, what do you mean with "button in subform"? Did you really put it into the subform or did you just put it next to the other buttons?
but i cant use
couse the 2 tables have deferunt fileds just 3 of the fileds shared between the two table
man there is no function called
whit the form object
yes i put it into the subform
For example,
If you want to open the item card from a sales line, the "No." from the salesline is the "No." from the item.
You should the define an Item record variable and to something like
I Hope this clarifies things.
TEST Table
so if i applay the folwing code
this error come out
You have the primary key available or do you have other link fields?
If you for instance know the name of an item you can do
Instead of the get.
I have no perdifined items, let say I want to sell tickets but each ticket is much diferrent than the others and this diferrence is impossible to be preknown so we can't define each ticket as an individual item so we defined (Ticket category) as an item and therefore when you select the (Ticket category) in the sales order a new window must open to allow me to enter the details of this ticket. Now the primary key for the sales lines consists of three fields; document type, document no. and the line no. The primary key for the ticket window -the new window- is the same.
My problem is how to copy the values found in those fields in the sales lines to the new window -ticket card- because we want to link the ticket to its corresponding sales line.
Thanks again man for your precious time
You could try to do something like this. (Assuming there is no ticket)
And if the ticket exists: