how to execute function in form from another form?

how to execute function in form from another form?

See what i understand is correct…you have created a function in form A and what to excute/use it in form B?

then you can create a variable for form A like FormA and use it in formB like.

FormA.Function();

hope this helps[:)]

All the best[Y]

actually, i want to post from Sales invoice to be Posted sales invoice

so i want the posted sales invoice generate some file that i already create function in Posted Sales Invoice form

but i don’t know where to put the code

do you have any idea?

first you say this, next

Dear you are confusing me.

Which one you want?

If you want from sales invoice to Posted sales invoice,

  1. create a variable for this sales invoice in your Posted sales invoice and call like i said earlier.

  2. placement: Place the codes where you want them to be executed, like if you want those to be posted when a user clicks a button then write the codes inside the button.

Hope it clears your doubt…

yap… i already create a function in Posted Sales Invoices…

and it done successfully

but the problem is … in sales invoice, i want to generate that file after posting

so it will generate automatically

SPAM DELETED

Hmmm so you want those posts generated in the posted sales invoice to appear in sales invoice! right?

How do you want those to be generated? right when RUN is clicked? like how?

paste the codes under the trigger.

Hmmm in which way you want to generate the posts?

like right when the RUN is clicked? how?

Just place the codes under that trigger.

Make sense?

Sorry kept getting 405 error. thought my replies werent getting posted. hence two of a kind.

in post button

after posted successfully, i want to generate the file

but how i get the “Sales Invoices Header”.No. just created after i posted

so you can call the function with code in the post button. As far as getting the “header No” , 'm not sure but have you tried using GET?

salesinvoiceheader.GET(“No.”); ?

i have function name E-Invoice

start

E-Invoice(OutPutFileName : Text[250])
SIH.SETRANGE(SIH.“No.”,Code)

.

.

.

.

finish

i want to get that no from posted invoice to send to Code

this code from push button

“E-Invoice”(‘C:\Test.text’);

You can use setrange for filtering the No you want and GET for retriving it.

P.S: just out of curiosity…whats this start and finish? part of codes, is it?

frist i just setrange it

SalesInvHeader.SETRANGE(SalesInvHeader.“DF”,FALSE);

but i add setcurrentkey like this

SalesInvHeader.SETCURRENTKEY(“DF”);
SalesInvHeader.SETRANGE(SalesInvHeader.“DF”,FALSE);