@WarrenBelz I have a htmltext object in my app which contains a html table which basically represents a report for the user. It is only accessible from a Gallery I have created and I set a number of variables on the OnSelect button they press to receive an emailed report.
In the html table I refer to all fields from the variables I have set for example varRecord.tripdate or varRecord.tripid and varContact.homemobile etc and they are all set to Gallery5.Selected (my main Gallery from where they can email the report to themselves)
I have this code to email the report:
Office365Outlook.SendEmailV2(
varUserMail,
"Printable report for Field Trip " & varRecord.tripid & " - click on the TripID to open the app",
TRIPREPORT.HtmlText,
{IsHtml: true}
);
varUserMail is the email of the logged-on user and tripid is the unique ID of the trip
The email is received and the html table can be seen within the body of the email however the tripid is the one before the one just selected. So if I choose tripid 1234 and the one I previously looked at was 998 it will show me 998. If I then go and choose 1235 it will show me 1234!! So it's one step behind every time
If I go to the htmltext object in edit mode it will show the last tripid selected and it is correct so if I chose 1234 it shows 1234
Here is the code on the OnSelect property of the button to email the report:
Set(
varContact,
Gallery7_1.Selected
);
Set(
varRecord,
Gallery5.Selected
);
ClearCollect(
colOfficers,
ForAll(
Sequence(CountRows(Gallery4_2.AllItems)),
Patch(
Last(
FirstN(
Gallery4_2.AllItems,
Value
)
),
{RowNumber: Value}
)
)
);
ClearCollect(
colDetails,
ForAll(
Sequence(CountRows(Gallery6.AllItems)),
Patch(
Last(
FirstN(
Gallery6.AllItems,
Value
)
),
{RowNumber: Value}
)
)
);
Office365Outlook.SendEmailV2(
varUserMail,
"Printable report for Field Trip " & varRecord.tripid & " - click on the TripID to open the app",
TRIPREPORT.HtmlText,
{IsHtml: true}
);
it's like varRecord is retaining it's contents until AFTER the report is emailed....so if I choose tripid 1234 twice, the second time it works!!