The open source framework for rapid business application development with Node.js
LESS File error : '../lib/less/bootstrap/bootstrap.less' wasn't found
LESS File : /Users/wombat/Development/hostman/node_modules/allcountjs/public/assets/less/main.less 1:0
I do not understand when to update the field 'status'
beforeSave: function(Entity, Console){
Console.log("beforeSave");
Console.log(Entity);
Console.log(Entity.opf);
},
I see in the log editable fields { id: '576934e51bd8ad653db5e1b3', status: 'коммерческое предложение' }
but also to the immutable fields OOO
I do not understand how to fill in the file attachment programmatically?
several times to view messages, but found nothing.
Entityname
to actual entity name
Applicants: {
fields: {
user: Fields.text("User Name").required(),
applicantname: Fields.text("Applicant Name").required(),
applicantemail: Fields.text("Applicant Email").required(),
applicantphone: Fields.text("Applicant Phone").required(),
positionapplied: Fields.fixedReference("Position Applied", "PositionsForReference").required(),
positionorganization: Fields.fixedReference("Organization", "ClientForReference").required(),
positionpostedby: Fields.fixedReference("Posted By", "ContactForReference").required(),
applicantlastContactDate: Fields.date("Last Contact Date").required(),
applicantstatus: Fields.fixedReference("Applicant Status", "AStatusForReference").required()
},
beforeUpdate: function(Entity, OldEntity, Crud, Security, Console) {
Console.log(applicantStatus.name);
Console.log(applicantStatus.id);
return Security.asSystem(function () {
if (Entity.ApplicantStatus.name != OldEntity.ApplicantAtatus.name) {
if (Entity.ApplicantStatus.name == 'Applicant Joined') {
return Crud.crudFor('Positions').find({}).then(function(last) {
Entity.vacanciesopen = last[0].vacanciesopen;
return Crud.crudFor('Positions').updateEntity({
id: last[0].id,
vacanciesopen: last[0].vacanciesopen - 1,
vacanciesclosed: last[0].vacanciesclosed + 1
});
})
} else if (OldEntity.applicantstatus.name == 'Applicant Joined') {
return Crud.crudFor('Positions').find({}).then(function(last) {
Entity.vacanciesopen = last[0].vacanciesopen;
return Crud.crudFor('Positions').updateEntity({
id: last[0].id,
vacanciesopen: last[0].vacanciesopen + 1,
vacanciesclosed: last[0].vacanciesclosed - 1
});
})
}
}
});
},
Hello friends
allcountjs started using a couple of days ago, I am making a summary sheet that gathers data from a pesona, but I need 3 different query data to complete the record before recording entities. for now only I can rescue data from an entity could give me a hand? as they would to make a crud on 3 different entities and access data from them?
thanks in advance for your valuable feedback
regards
Hi! CreativeWolf, I am using relationships, exactly reference to quickly complete the form 'Person', but I need to do some calculations before recording your data. I'm using beforeSave and in need do Crud on 3 different entities to make the final calculation and record the data.
thanks for your quick response