Message: Uncaught TypeError: Cannot read property 'PrdCodPlanprod' of undefined #5668
Unanswered
patriciomh1965
asked this question in
Help
Replies: 3 comments 1 reply
-
You need to check the field on your Form.cs, not row.cs, and make sure you tranformmed t4 template |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi jin The PrdCodPlanprod property exists in the form, reading some cases
of the error some people in the community indicate that it may be a problem
with the installation of the NuGet package. The truth is that I have not
been able to locate the problem. I would like an orientation since you are
a more suitable professional. Apologize for so many annoyances. Atte.
Patrick
El mié, 28 abr 2021 a las 3:15, Jin ***@***.***>) escribió:
… You need to check the field on your Form.cs, not row.cs, and make sure you
tranformmed t4 template
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5668 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKCDGGTY55UFN7J2V3XGFOTTK6Y25ANCNFSM43WNWSHQ>
.
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Jin
Thank you very much, your help was great my friend
Atte.
namespace PLAINT.ServiciosProducto {
@Serenity.Decorators.registerClass()
@Serenity.Decorators.panel()
export class TaCncPlanesDialog extends
Serenity.EntityDialog<TaCncPlanesRow, any> {
protected getFormKey() { return TaCncPlanesForm.formKey; }
protected getIdProperty() { return TaCncPlanesRow.idProperty; }
protected getLocalTextPrefix() { return
TaCncPlanesRow.localTextPrefix; }
// protected getNameProperty() { return TaCncPlanesRow.nameProperty;
}
protected getService() { return TaCncPlanesService.baseUrl; }
// protected getDeletePermission() { return
TaCncPlanesRow.deletePermission; }
// protected getInsertPermission() { return
TaCncPlanesRow.insertPermission; }
// protected getUpdatePermission() { return
TaCncPlanesRow.updatePermission; }
protected form = new TaCncPlanesForm(this.idPrefix);
// SACAR BOTONES
protected getToolbarButtons(): Serenity.ToolButton[] {
let buttons = super.getToolbarButtons();
buttons.splice(Q.indexOf(buttons, x => x.cssClass ==
"apply-changes-button"), 1);
return buttons;
}
protected updateTitle(): void {
super.updateTitle();
this.dialogTitle = 'Planes';
}
protected afterLoadEntity() {
super.afterLoadEntity();
Serenity.EditorUtils.setReadOnly(this.form.PlnPlataforma,
true);
Serenity.EditorUtils.setReadOnly(this.form.PlnCodPlanProd,
true);
}
constructor()
{
super();
this.form = new TaCncPlanesForm(this.idPrefix);
Serenity.SubDialogHelper.triggerDataChange(this);
this.form.PlnPlanProducto.change(() =>
{
var codplanprodID = 0;
var planproductoID =
Q.toId(this.form.PlnPlanProducto.value);
if (planproductoID != 0)
{
* var existedItem =
TaCncParamPlanProductoDatosRow.getLookup().itemById[this.form.PlnPlanProducto.value];
if (existedItem != null && typeof (existedItem) !=
'undefined') { codplanprodID =
existedItem.PrdCodPlanProd; //
Q.notifyInfo('PrdCodPlanprod ' + existedItem.PrdCodPlanProd);
} this.form.PlnCodPlanProd.value = codplanprodID;*
}
});
}
}
}
El mié, 28 abr 2021 a las 21:37, Jin ***@***.***>) escribió:
… I did not check it carefully, this line cause your error:
var codplanID = TaCncParamPlanProductoDatosRow.getLookup().itemById[this.form.PlnPlanProducto.value].PrdCodPlanprod;
Q.notifyInfo('PrdCodPlanprod ' + codplanID);
It is not problem about nuget package
Problem is this code return null value:
TaCncParamPlanProductoDatosRow.getLookup().itemById[this.form.PlnPlanProducto.value]
you should make sure that the lookup contains value
this.form.PlnPlanProducto.value
Normally the code should be re-write like this:
var existedItem = TaCncParamPlanProductoDatosRow.getLookup().itemById[this.form.PlnPlanProducto.value];if (existedItem != null && typeof(existedItem) != 'undefined'){
Q.notifyInfo('PrdCodPlanprod ' + existedItem.PrdCodPlanprod);}
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5668 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKCDGGQ2XKX2SPYCXAD3L23TLCZ4VANCNFSM43WNWSHQ>
.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello community
I have the following problem that I have fixed. I have searched the issues: I present the sentences
namespace PLAINT.ServiciosProducto {
}
It does not recognize the PrdCodPlanprod field, however it exists in the class:
namespace PLAINT.ServiciosProducto.Entities
{
using Serenity;
using Serenity.ComponentModel;
using Serenity.Data;
using Serenity.Data.Mapping;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
}
Someone who can tell me where my mistake is, I would appreciate it.
Atte.
Beta Was this translation helpful? Give feedback.
All reactions