The error message I am afraid to see when building a canvas app is:
This is a particular bad error message to get. Especially, if you have been coding for a while without monitoring the errors that may have been introduced. Time to debug this message is not small. At end of this article I suggest a possible timesaver.
Coding without checking errors
Yes this does happen to me in particular. For example I know I have used a new variable, but the declaration will come on a different event. Thus this ‘known error’ may mask any other errors you may introduce.
Brief Basic Background
Some basics about record types:
UpdateContext(
{ l_personSoccerRec:
{
soccerperson : GUID(),
firstName: “Joe”,
lastName: “Bloggs”,
favouriteTeam: “Chelsea”,
mostExcitingPlayer: “Grealish”
}
}
);
This data called be setup using individual variables:
UpdateContext( {l_soccerPerson: GUID()});
UpdateContext( {l_firstName: “Joe”});
UpdateContext( {l_ lastName: “Bloggs”});
UpdateContext( {l_favouriteTeam: “Chelsea”});
UpdateContext( {l_ mostExcitingPlayer: “Grealish”});
By reading the data, it should be clear that the first sample code is far cleaner to read.
There are multiple articles, that will dig deeper into reasons.
Retrieved from Table
If retrieved from a table the record may be populated by
UpdateContext( { l_personSoccerRec: LookUp(SoccerPeople: soccerperson = [guid] )}) //[guid] is pseudo syntax
Retrieved from Form
UpdateContext(
{ l_personSoccerRec:
{
soccerperson : GUID(txtFirstName.Text),
firstName: txtFirstName.Text,
lastName: txtLastName.Text,
favouriteTeam: txtFavouritTeam.Text,
mostExcitingPlayer: txtExcitingPlayer.Text
}
}
);
Huge Assumption
The table does not reference other tables, so not normalised etc. Thus not optimally designed.
Introduce the Error
UpdateContext(
{ l_personSoccerRec:
{
soccerperson :txtFirstName.Text,
firstName: txtFirstName.Text,
lastName: txtLastName.Text,
favouriteTeam: txtFavouritTeam.Text,
mostExcitingPlayer: txtExcitingPlayer.Text
}
}
);
Error Message is Cryptic
Incompatible type. We cant evaluate your formula because ….
This is really not helpful. In this example there is only 5 fields, but there could be many more.
Please Microsoft
Please can you advise the fieldname, even if the issue is on more than one field. One field at a time will be a huge improvement.
Time Saver
Let me say I save and also save to my computer lots. If this type of error has taken over 15 minutes (and it can easily). I reload from my last “Save”.
Recent Comments