I want to know the difference when should I used workflows and when to use codeunits?
Like e.g Email notification to customers about sales order
Which is more efficient writing a codeunit or workflow?
*This post is locked for comments
I want to know the difference when should I used workflows and when to use codeunits?
Like e.g Email notification to customers about sales order
Which is more efficient writing a codeunit or workflow?
*This post is locked for comments
for that i'll create a doc. and update you.
till now you can practice with this workflow [This workflow fire if any record deleted]
so based on you can try.
Hello @Binesh
i want sent email notification to the customer using workflows hence i follwed your link
sbinesh.blogspot.in/.../walkthrough-implementing-new-workflow_21.html
how to cal a function when it is Local function.
i used Codeunit.Run for it. the problem still exist
Hello,
Write your code in any codeunit, and that codeunit.function call to your sales order page i.e. 42.
See the bellow screenshot.
Whenever you click on Release action, and once the release action done then your code will fire and emailed.
@Binesh
Also can you tell me how did you call the codeunit using workflows
@Binesh i followed your link
sbinesh.blogspot.in/.../walkthrough-implementing-new-workflow_21.html
only in sendemail if inserted the following code sice i need to take the respective customers email address
LOCAL SendEmailOnRelease(SalesHeader : Record "Sales Header") : Boolean
WITH SalesHeader DO BEGIN
SalesLine.RESET;
SalesLine.SETRANGE("Document No.","No.");
IF SalesLine.FINDFIRST THEN
REPEAT
Customer.RESET;
Customer.SETRANGE("No.",SalesLine."Sell-to Customer No.");
IF Customer.FINDFIRST THEN
CustEmail:=Customer."E-Mail";
SMTPMailSetup.GET;
FileName:=FileManagement.ServerTempFileName('pdf');
REPORT.SAVEASPDF(205,FileName,SalesHeader);
SMTPMail.CreateMessage('',SMTPMailSetup."User ID",CustEmail,'Sales Order is Released','',TRUE);
SMTPMail.AddAttachment(FileName,SalesHeader."No."+'.pdf');
SMTPMail.AppendBody('Dear Sir/Madam');
SMTPMail.AppendBody('<br><br>');
SMTPMail.AppendBody('Please find the attachment');
SMTPMail.AppendBody('<br><br>');
SMTPMail.AppendBody('<HR>');
SMTPMail.AppendBody('This is system generated mail.Please do not reply to this EmailID');
SMTPMail.Send;
UNTIL SalesLine.NEXT=0;
MESSAGE('Mail sent to Customer');
END;
EXIT(TRUE);
the email is not sent and another problem is while creating new sales order, when i select the customer. the event fires
and message of email is sent is displayed
Can you help me with this
Hello,
Or In Short workflow is a example of "Request and Response"
For more Info Click Here
> Writing a codeunit is a big headache or time consuming, But using workflow its simple and reliable.
I think it depends on the requirement but I would suggest you to discover how workflow works and how it is useful in your business process.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,235 Most Valuable Professional
nmaenpaa 101,156