Send Email with invoice as attachment thru electronic reporting
Follow the below steps:
- Go to Electronic reporting workspace
- Click on the Electronic reporting destination
3. Add new record in file destination grid settings type Émail’
4. Do the settings on the destination screen as below
5. On To Field click Edit , click and select print Management Email
6. For above settings of Email Source account , click on link button before delete button ,it will open the formula designer , you need to select the field AccountNum (customer account number)
It will select the customer email defined on the customer Master contact details as primary
7. click Save and close the formula designer form
8. click on the next two forms and now you can test the email by running the invoice print using print management
Leave your comments below if you are facing any issue.
To send SSRS report in Email as attachment, please check below link
Sometime a requirement come that we need to copy the attachment from one form to another with the flow of data.
For example when purchase order creates from sales order then the attachment also need to be flow from sales order to purchase order
First thing first -> Identify the relation between new and existing form(tables).
Then use the below code to achieve this.
I used the onInserted event ,you can use the same or whatever suitable for your scenario. Important thing is record should be created in new table then you can copy the attachment.
/// <param name="sender"></param>
/// <param name="e"></param>
public static void PurchTable_onInserted(Common sender, DataEventArgs e)
PurchTable purchTable = sender;
SalesTable salesTable = SalesTable::find(purchTable.InterCompanyOriginalSalesId);
DocuRef docuRef = DocuRef::findTableIdRecId(salesTable.DataAreaId, salesTable.TableId, salesTable.RecId);
docuRef.RefTableId = purchTable.TableId;
docuRef.RefRecId = purchTable.RecId;
Leave your comments below if you have any query. I will try to help you to solve your problem
Requirement is to have a custom field showing Customer Number and Name.
In that case instead of creating regular field on the Data entity and we will create a virtual field and fill the data at runtime when records are importing
Below are the steps needs to perform:
1. Create extension of the base entity (Example SalesOrderHeaderEntity) or your custom entity
2. Open the entity in designer and expand the fields
3. Right click and add new field -> StringUnmappedField
4. Set the Name property of new field, in our case I put ‘CustomerNumberAndName’
5. Set the IsComputedField Property to No.
6. Leave the DataEntityViewMethod Empty
7.Use the virtual field to receive the information from outside(odata or excel) and parse the information
8. Use chain of command or pre-post event handler if its base entity or customise the method ‘mapEntityToDataSource’
‘example of mapEntityToDataSpurce’
public void mapEntityToDataSource(DataEntityRuntimeContext entityCtx,
//Check if desired data source context is available
case dataEntityDataSourceStr(SalesOrderHeaderV2Entity, SalesTable):
SalesTable salesTable = _dataSourceCtx.getBuffer();
this.CustomerNumberAndName = salesTable.InvoiceAccount + ' - ' salesTable.customerName();
10. You can get the value from odata also to use it for different purpose as per request